# console


# amm


# AaveSwap

> AaveSwap - A StableSwap implementation in solidity, integrated with Aave.

This contract is responsible for custody of closely pegged assets (eg. group of stablecoins) and automatic market making system. Users become an LP (Liquidity Provider) by depositing their tokens in desired ratios for an exchange of the pool token that represents their share of the pool. Users can burn pool tokens and withdraw their share of token(s). Each time a swap between the pooled tokens happens, a set fee incurs which effectively gets distributed to the LPs. In case of emergencies, admin can pause additional deposits, swaps, or single-asset withdraws - which stops the ratio of the tokens in the pool from changing. Users can always withdraw their tokens via multi-asset withdraws.

*Most of the logic is stored as a library `SwapUtils` for the sake of reducing contract's deployment size.*

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

Add liquidity to the pool with the given amounts of tokens

#### Parameters

| Name      | Type       | Description                                                                                                             |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| amounts   | uint256\[] | the amounts of each token to add, in their native precision                                                             |
| minToMint | uint256    | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline  | uint256    | latest timestamp to accept this transaction                                                                             |

#### Returns

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| \_0  | uint256 | amount of LP token user minted and received |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens

#### Parameters

| Name   | Type    | Description                                                |
| ------ | ------- | ---------------------------------------------------------- |
| amount | uint256 | the amount of LP tokens that would be burned on withdrawal |

#### Returns

| Name | Type       | Description                                        |
| ---- | ---------- | -------------------------------------------------- |
| \_0  | uint256\[] | array of token balances that the user will receive |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type    | Description                                                                                                                               |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8   | the token the user wants to buy                                                                                                           |
| dx             | uint256 | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                                                                                                                 |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. If a token charges a fee on transfers, use the amount that gets transferred after the fee. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                                                                                                                   |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### claimAaveRewards

```solidity
function claimAaveRewards() external nonpayable
```

### getA

```solidity
function getA() external view returns (uint256)
```

Return A, the amplification coefficient \* n \* (n - 1)

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | A parameter |

### getAPrecise

```solidity
function getAPrecise() external view returns (uint256)
```

Return A in its raw precision form

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| \_0  | uint256 | A parameter in its raw precision form |

### getAdminBalance

```solidity
function getAdminBalance(uint256 index) external view returns (uint256)
```

This function reads the accumulated amount of admin fees of the token with given index

#### Parameters

| Name  | Type    | Description               |
| ----- | ------- | ------------------------- |
| index | uint256 | Index of the pooled token |

#### Returns

| Name | Type    | Description                                    |
| ---- | ------- | ---------------------------------------------- |
| \_0  | uint256 | admin's token balance in the token's precision |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

Return address of the pooled token at given index. Reverts if tokenIndex is out of range.

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type            | Description                         |
| ---- | --------------- | ----------------------------------- |
| \_0  | contract IERC20 | address of the token at given index |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

Return current balance of the pooled token at given index

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type    | Description                                                                      |
| ---- | ------- | -------------------------------------------------------------------------------- |
| \_0  | uint256 | current balance of the pooled token at given index with token's native precision |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

Return the index of the given token address. Reverts if no matching token is found.

#### Parameters

| Name         | Type    | Description          |
| ------------ | ------- | -------------------- |
| tokenAddress | address | address of the token |

#### Returns

| Name | Type  | Description                          |
| ---- | ----- | ------------------------------------ |
| \_0  | uint8 | the index of the given token address |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

Get the virtual price, to help calculate profit

#### Returns

| Name | Type    | Description                                                |
| ---- | ------- | ---------------------------------------------------------- |
| \_0  | uint256 | the virtual price, scaled to the POOL\_PRECISION\_DECIMALS |

### initialize

```solidity
function initialize(contract IERC20[] _pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 _a, uint256 _fee, uint256 _adminFee, address lpTokenTargetAddress) external nonpayable
```

Initializes this Swap contract with the given parameters. This will also clone a LPToken contract that represents users' LP positions. The owner of LPToken will be this contract - which means only this contract is allowed to mint/burn tokens.

#### Parameters

| Name                 | Type               | Description                                                                                               |
| -------------------- | ------------------ | --------------------------------------------------------------------------------------------------------- |
| \_pooledTokens       | contract IERC20\[] | an array of ERC20s this pool will accept                                                                  |
| decimals             | uint8\[]           | the decimals to use for each pooled token, eg 8 for WBTC. Cannot be larger than POOL\_PRECISION\_DECIMALS |
| lpTokenName          | string             | the long-form name of the token to be deployed                                                            |
| lpTokenSymbol        | string             | the short symbol for the token to be deployed                                                             |
| \_a                  | uint256            | the amplification coefficient \* n \* (n - 1). See the StableSwap paper for details                       |
| \_fee                | uint256            | default swap fee to be initialized with                                                                   |
| \_adminFee           | uint256            | default adminFee to be initialized with                                                                   |
| lpTokenTargetAddress | address            | the address of an existing LPToken contract to use as a target                                            |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

Pause the contract. Revert if already paused.

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### rampA

```solidity
function rampA(uint256 futureA, uint256 futureTime) external nonpayable
```

Start ramping up or down A parameter towards given futureA and futureTime Checks if the change is too rapid, and commits the new A value only when it falls under the limit range.

#### Parameters

| Name       | Type    | Description                                |
| ---------- | ------- | ------------------------------------------ |
| futureA    | uint256 | the new A to ramp towards                  |
| futureTime | uint256 | timestamp when the new A should be reached |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

Burn LP tokens to remove liquidity from the pool. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

*Liquidity can always be removed, even when the pool is paused.*

#### Parameters

| Name       | Type       | Description                                                                                                  |
| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| amount     | uint256    | the amount of LP tokens to burn                                                                              |
| minAmounts | uint256\[] | the minimum amounts of each token in the pool acceptable for this burn. Useful as a front-running mitigation |
| deadline   | uint256    | latest timestamp to accept this transaction                                                                  |

#### Returns

| Name | Type       | Description                     |
| ---- | ---------- | ------------------------------- |
| \_0  | uint256\[] | amounts of tokens user received |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool, weighted differently than the pool's current balances. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name          | Type       | Description                                                                                            |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------ |
| amounts       | uint256\[] | how much of each token to withdraw                                                                     |
| maxBurnAmount | uint256    | the max LP token provider is willing to pay to remove liquidity. Useful as a front-running mitigation. |
| deadline      | uint256    | latest timestamp to accept this transaction                                                            |

#### Returns

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| \_0  | uint256 | amount of LP tokens burned |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool all in one token. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| tokenAmount | uint256 | the amount of the token you want to receive      |
| tokenIndex  | uint8   | the index of the token you want to receive       |
| minAmount   | uint256 | the minimum amount to withdraw, otherwise revert |
| deadline    | uint256 | latest timestamp to accept this transaction      |

#### Returns

| Name | Type    | Description                          |
| ---- | ------- | ------------------------------------ |
| \_0  | uint256 | amount of chosen token user received |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setAdminFee

```solidity
function setAdminFee(uint256 newAdminFee) external nonpayable
```

Update the admin fee. Admin fee takes portion of the swap fee.

#### Parameters

| Name        | Type    | Description                                        |
| ----------- | ------- | -------------------------------------------------- |
| newAdminFee | uint256 | new admin fee to be applied on future transactions |

### setRewardReceiver

```solidity
function setRewardReceiver(address _reward_receiver) external nonpayable
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| \_reward\_receiver | address | undefined   |

### setSwapFee

```solidity
function setSwapFee(uint256 newSwapFee) external nonpayable
```

Update the swap fee to be applied on swaps

#### Parameters

| Name       | Type    | Description                                       |
| ---------- | ------- | ------------------------------------------------- |
| newSwapFee | uint256 | new swap fee to be applied on future transactions |

### stopRampA

```solidity
function stopRampA() external nonpayable
```

Stop ramping A immediately. Reverts if ramp A is already stopped.

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

Swap two tokens using this pool

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swapStorage

```solidity
function swapStorage() external view returns (uint256 initialA, uint256 futureA, uint256 initialATime, uint256 futureATime, uint256 swapFee, uint256 adminFee, contract LPToken lpToken)
```

#### Returns

| Name         | Type             | Description |
| ------------ | ---------------- | ----------- |
| initialA     | uint256          | undefined   |
| futureA      | uint256          | undefined   |
| initialATime | uint256          | undefined   |
| futureATime  | uint256          | undefined   |
| swapFee      | uint256          | undefined   |
| adminFee     | uint256          | undefined   |
| lpToken      | contract LPToken | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

Unpause the contract. Revert if already unpaused.

### withdrawAdminFees

```solidity
function withdrawAdminFees() external nonpayable
```

Withdraw all admin fees to the contract owner

## Events

### AddLiquidity

```solidity
event AddLiquidity(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### NewAdminFee

```solidity
event NewAdminFee(uint256 newAdminFee)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| newAdminFee | uint256 | undefined   |

### NewSwapFee

```solidity
event NewSwapFee(uint256 newSwapFee)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| newSwapFee | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RampA

```solidity
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| oldA        | uint256 | undefined   |
| newA        | uint256 | undefined   |
| initialTime | uint256 | undefined   |
| futureTime  | uint256 | undefined   |

### RemoveLiquidity

```solidity
event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityImbalance

```solidity
event RemoveLiquidityImbalance(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityOne

```solidity
event RemoveLiquidityOne(address indexed provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| provider `indexed` | address | undefined   |
| lpTokenAmount      | uint256 | undefined   |
| lpTokenSupply      | uint256 | undefined   |
| boughtId           | uint256 | undefined   |
| tokensBought       | uint256 | undefined   |

### StopRampA

```solidity
event StopRampA(uint256 currentA, uint256 time)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| currentA | uint256 | undefined   |
| time     | uint256 | undefined   |

### TokenSwap

```solidity
event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| buyer `indexed` | address | undefined   |
| tokensSold      | uint256 | undefined   |
| tokensBought    | uint256 | undefined   |
| soldId          | uint128 | undefined   |
| boughtId        | uint128 | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# AaveSwapWrapper

> AaveSwapWrapper

A wrapper contract for interacting with aTokens

## Methods

### LENDING\_POOL

```solidity
function LENDING_POOL() external view returns (contract ILendingPool)
```

#### Returns

| Name | Type                  | Description |
| ---- | --------------------- | ----------- |
| \_0  | contract ILendingPool | undefined   |

### LP\_TOKEN

```solidity
function LP_TOKEN() external view returns (contract LPToken)
```

#### Returns

| Name | Type             | Description |
| ---- | ---------------- | ----------- |
| \_0  | contract LPToken | undefined   |

### OWNER

```solidity
function OWNER() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### POOLED\_TOKENS

```solidity
function POOLED_TOKENS(uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### SWAP

```solidity
function SWAP() external view returns (contract Swap)
```

#### Returns

| Name | Type          | Description |
| ---- | ------------- | ----------- |
| \_0  | contract Swap | undefined   |

### UNDERLYING\_TOKENS

```solidity
function UNDERLYING_TOKENS(uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

Add liquidity to the pool with the given amounts of tokens.

#### Parameters

| Name      | Type       | Description                                                                                                             |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| amounts   | uint256\[] | the amounts of each token to add, in their native precision                                                             |
| minToMint | uint256    | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline  | uint256    | latest timestamp to accept this transaction                                                                             |

#### Returns

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| \_0  | uint256 | amount of LP token user minted and received |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens

#### Parameters

| Name   | Type    | Description                                                |
| ------ | ------- | ---------------------------------------------------------- |
| amount | uint256 | the amount of LP tokens that would be burned on withdrawal |

#### Returns

| Name | Type       | Description                                        |
| ---- | ---------- | -------------------------------------------------- |
| \_0  | uint256\[] | array of token balances that the user will receive |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type    | Description                                                                                                                               |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8   | the token the user wants to buy                                                                                                           |
| dx             | uint256 | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                                                                                                                 |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. If a token charges a fee on transfers, use the amount that gets transferred after the fee. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                                                                                                                   |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

Return address of the pooled token at given index. Reverts if tokenIndex is out of range.

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type            | Description                         |
| ---- | --------------- | ----------------------------------- |
| \_0  | contract IERC20 | address of the token at given index |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

Burn LP tokens to remove liquidity from the pool.

*Liquidity can always be removed, even when the pool is paused. Caller will receive ETH instead of WETH9.*

#### Parameters

| Name       | Type       | Description                                                                                                  |
| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| amount     | uint256    | the amount of LP tokens to burn                                                                              |
| minAmounts | uint256\[] | the minimum amounts of each token in the pool acceptable for this burn. Useful as a front-running mitigation |
| deadline   | uint256    | latest timestamp to accept this transaction                                                                  |

#### Returns

| Name | Type       | Description                     |
| ---- | ---------- | ------------------------------- |
| \_0  | uint256\[] | amounts of tokens user received |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool all in one token.

*Caller will receive ETH instead of WETH9.*

#### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| tokenAmount | uint256 | the amount of the token you want to receive      |
| tokenIndex  | uint8   | the index of the token you want to receive       |
| minAmount   | uint256 | the minimum amount to withdraw, otherwise revert |
| deadline    | uint256 | latest timestamp to accept this transaction      |

#### Returns

| Name | Type    | Description                          |
| ---- | ------- | ------------------------------------ |
| \_0  | uint256 | amount of chosen token user received |

### rescue

```solidity
function rescue() external nonpayable
```

Rescues any of the ETH, the pooled tokens, or the LPToken that may be stuck in this contract. Only the OWNER can call this function.

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

Swap two tokens using the underlying pool. If tokenIndexFrom represents WETH9 in the pool, the caller must set msg.value equal to dx. If the user is swapping to WETH9 in the pool, the user will receive ETH instead.

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# AmplificationUtils

> AmplificationUtils library

A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct. This library assumes the struct is fully validated.

## Methods

### A\_PRECISION

```solidity
function A_PRECISION() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### MAX\_A

```solidity
function MAX_A() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

## Events

### RampA

```solidity
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| oldA        | uint256 | undefined   |
| newA        | uint256 | undefined   |
| initialTime | uint256 | undefined   |
| futureTime  | uint256 | undefined   |

### StopRampA

```solidity
event StopRampA(uint256 currentA, uint256 time)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| currentA | uint256 | undefined   |
| time     | uint256 | undefined   |


# ILendingPool

## Methods

### deposit

```solidity
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external nonpayable
```

*Deposits an `amount` of underlying asset into the reserve, receiving in return overlying aTokens. - E.g. User deposits 100 USDC and gets in return 100 aUSDC*

#### Parameters

| Name         | Type    | Description                                                                                                                                                                                   |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| asset        | address | The address of the underlying asset to deposit                                                                                                                                                |
| amount       | uint256 | The amount to be deposited                                                                                                                                                                    |
| onBehalfOf   | address | The address that will receive the aTokens, same as msg.sender if the user wants to receive them on his own wallet, or a different address if the beneficiary of aTokens is a different wallet |
| referralCode | uint16  | Code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man\*                             |

### withdraw

```solidity
function withdraw(address asset, uint256 amount, address to) external nonpayable returns (uint256)
```

*Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC*

#### Parameters

| Name   | Type    | Description                                                                                                                                                                     |
| ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| asset  | address | The address of the underlying asset to withdraw                                                                                                                                 |
| amount | uint256 | The underlying amount to be withdrawn - Send the value type(uint256).max in order to withdraw the whole aToken balance                                                          |
| to     | address | Address that will receive the underlying, same as msg.sender if the user wants to receive it on his own wallet, or a different address if the beneficiary is a different wallet |

#### Returns

| Name | Type    | Description                  |
| ---- | ------- | ---------------------------- |
| \_0  | uint256 | The final amount withdrawn\* |


# LPToken

> Liquidity Provider Token

This token is an ERC20 detailed token with added capability to be minted by the owner. It is used to represent user's shares when providing liquidity to swap contracts.

*Only Swap contracts should initialize and own LPToken contracts.*

## Methods

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*See {IERC20-allowance}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*See {IERC20-balanceOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### burn

```solidity
function burn(uint256 amount) external nonpayable
```

*Destroys `amount` tokens from the caller. See {ERC20-\_burn}.*

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### burnFrom

```solidity
function burnFrom(address account, uint256 amount) external nonpayable
```

*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-\_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for `accounts`'s tokens of at least `amount`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |
| amount  | uint256 | undefined   |

### decimals

```solidity
function decimals() external view returns (uint8)
```

*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {\_setupDecimals} is called. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### decreaseAllowance

```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```

*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| spender         | address | undefined   |
| subtractedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increaseAllowance

```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```

*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| spender    | address | undefined   |
| addedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize(string name, string symbol) external nonpayable returns (bool)
```

Initializes this LPToken contract with the given name and symbol

*The caller of this function will become the owner. A Swap contract should call this in its initializer function.*

#### Parameters

| Name   | Type   | Description          |
| ------ | ------ | -------------------- |
| name   | string | name of this token   |
| symbol | string | symbol of this token |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address recipient, uint256 amount) external nonpayable
```

Mints the given amount of LPToken to the recipient.

*only owner can call this mint function*

#### Parameters

| Name      | Type    | Description                              |
| --------- | ------- | ---------------------------------------- |
| recipient | address | address of account to receive the tokens |
| amount    | uint256 | amount of tokens to mint                 |

### name

```solidity
function name() external view returns (string)
```

*Returns the name of the token.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### symbol

```solidity
function symbol() external view returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC20-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# MathUtils

> MathUtils library

A library to be used in conjunction with SafeMath. Contains functions for calculating differences between two uint256.


# OwnerPausableUpgradeable

> OwnerPausable

An ownable contract allows the owner to pause and unpause the contract without a delay.

*Only methods using the provided modifiers will be paused.*

## Methods

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

Pause the contract. Revert if already paused.

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

Unpause the contract. Revert if already unpaused.

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# Swap

> Swap - A StableSwap implementation in solidity.

This contract is responsible for custody of closely pegged assets (eg. group of stablecoins) and automatic market making system. Users become an LP (Liquidity Provider) by depositing their tokens in desired ratios for an exchange of the pool token that represents their share of the pool. Users can burn pool tokens and withdraw their share of token(s). Each time a swap between the pooled tokens happens, a set fee incurs which effectively gets distributed to the LPs. In case of emergencies, admin can pause additional deposits, swaps, or single-asset withdraws - which stops the ratio of the tokens in the pool from changing. Users can always withdraw their tokens via multi-asset withdraws.

*Most of the logic is stored as a library `SwapUtils` for the sake of reducing contract's deployment size.*

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

Add liquidity to the pool with the given amounts of tokens

#### Parameters

| Name      | Type       | Description                                                                                                             |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| amounts   | uint256\[] | the amounts of each token to add, in their native precision                                                             |
| minToMint | uint256    | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline  | uint256    | latest timestamp to accept this transaction                                                                             |

#### Returns

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| \_0  | uint256 | amount of LP token user minted and received |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens

#### Parameters

| Name   | Type    | Description                                                |
| ------ | ------- | ---------------------------------------------------------- |
| amount | uint256 | the amount of LP tokens that would be burned on withdrawal |

#### Returns

| Name | Type       | Description                                        |
| ---- | ---------- | -------------------------------------------------- |
| \_0  | uint256\[] | array of token balances that the user will receive |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type    | Description                                                                                                                               |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8   | the token the user wants to buy                                                                                                           |
| dx             | uint256 | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                                                                                                                 |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. If a token charges a fee on transfers, use the amount that gets transferred after the fee. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                                                                                                                   |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### getA

```solidity
function getA() external view returns (uint256)
```

Return A, the amplification coefficient \* n \* (n - 1)

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | A parameter |

### getAPrecise

```solidity
function getAPrecise() external view returns (uint256)
```

Return A in its raw precision form

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| \_0  | uint256 | A parameter in its raw precision form |

### getAdminBalance

```solidity
function getAdminBalance(uint256 index) external view returns (uint256)
```

This function reads the accumulated amount of admin fees of the token with given index

#### Parameters

| Name  | Type    | Description               |
| ----- | ------- | ------------------------- |
| index | uint256 | Index of the pooled token |

#### Returns

| Name | Type    | Description                                    |
| ---- | ------- | ---------------------------------------------- |
| \_0  | uint256 | admin's token balance in the token's precision |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

Return address of the pooled token at given index. Reverts if tokenIndex is out of range.

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type            | Description                         |
| ---- | --------------- | ----------------------------------- |
| \_0  | contract IERC20 | address of the token at given index |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

Return current balance of the pooled token at given index

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type    | Description                                                                      |
| ---- | ------- | -------------------------------------------------------------------------------- |
| \_0  | uint256 | current balance of the pooled token at given index with token's native precision |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

Return the index of the given token address. Reverts if no matching token is found.

#### Parameters

| Name         | Type    | Description          |
| ------------ | ------- | -------------------- |
| tokenAddress | address | address of the token |

#### Returns

| Name | Type  | Description                          |
| ---- | ----- | ------------------------------------ |
| \_0  | uint8 | the index of the given token address |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

Get the virtual price, to help calculate profit

#### Returns

| Name | Type    | Description                                                |
| ---- | ------- | ---------------------------------------------------------- |
| \_0  | uint256 | the virtual price, scaled to the POOL\_PRECISION\_DECIMALS |

### initialize

```solidity
function initialize(contract IERC20[] _pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 _a, uint256 _fee, uint256 _adminFee, address lpTokenTargetAddress) external nonpayable
```

Initializes this Swap contract with the given parameters. This will also clone a LPToken contract that represents users' LP positions. The owner of LPToken will be this contract - which means only this contract is allowed to mint/burn tokens.

#### Parameters

| Name                 | Type               | Description                                                                                               |
| -------------------- | ------------------ | --------------------------------------------------------------------------------------------------------- |
| \_pooledTokens       | contract IERC20\[] | an array of ERC20s this pool will accept                                                                  |
| decimals             | uint8\[]           | the decimals to use for each pooled token, eg 8 for WBTC. Cannot be larger than POOL\_PRECISION\_DECIMALS |
| lpTokenName          | string             | the long-form name of the token to be deployed                                                            |
| lpTokenSymbol        | string             | the short symbol for the token to be deployed                                                             |
| \_a                  | uint256            | the amplification coefficient \* n \* (n - 1). See the StableSwap paper for details                       |
| \_fee                | uint256            | default swap fee to be initialized with                                                                   |
| \_adminFee           | uint256            | default adminFee to be initialized with                                                                   |
| lpTokenTargetAddress | address            | the address of an existing LPToken contract to use as a target                                            |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

Pause the contract. Revert if already paused.

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### rampA

```solidity
function rampA(uint256 futureA, uint256 futureTime) external nonpayable
```

Start ramping up or down A parameter towards given futureA and futureTime Checks if the change is too rapid, and commits the new A value only when it falls under the limit range.

#### Parameters

| Name       | Type    | Description                                |
| ---------- | ------- | ------------------------------------------ |
| futureA    | uint256 | the new A to ramp towards                  |
| futureTime | uint256 | timestamp when the new A should be reached |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

Burn LP tokens to remove liquidity from the pool. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

*Liquidity can always be removed, even when the pool is paused.*

#### Parameters

| Name       | Type       | Description                                                                                                  |
| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| amount     | uint256    | the amount of LP tokens to burn                                                                              |
| minAmounts | uint256\[] | the minimum amounts of each token in the pool acceptable for this burn. Useful as a front-running mitigation |
| deadline   | uint256    | latest timestamp to accept this transaction                                                                  |

#### Returns

| Name | Type       | Description                     |
| ---- | ---------- | ------------------------------- |
| \_0  | uint256\[] | amounts of tokens user received |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool, weighted differently than the pool's current balances. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name          | Type       | Description                                                                                            |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------ |
| amounts       | uint256\[] | how much of each token to withdraw                                                                     |
| maxBurnAmount | uint256    | the max LP token provider is willing to pay to remove liquidity. Useful as a front-running mitigation. |
| deadline      | uint256    | latest timestamp to accept this transaction                                                            |

#### Returns

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| \_0  | uint256 | amount of LP tokens burned |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool all in one token. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| tokenAmount | uint256 | the amount of the token you want to receive      |
| tokenIndex  | uint8   | the index of the token you want to receive       |
| minAmount   | uint256 | the minimum amount to withdraw, otherwise revert |
| deadline    | uint256 | latest timestamp to accept this transaction      |

#### Returns

| Name | Type    | Description                          |
| ---- | ------- | ------------------------------------ |
| \_0  | uint256 | amount of chosen token user received |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setAdminFee

```solidity
function setAdminFee(uint256 newAdminFee) external nonpayable
```

Update the admin fee. Admin fee takes portion of the swap fee.

#### Parameters

| Name        | Type    | Description                                        |
| ----------- | ------- | -------------------------------------------------- |
| newAdminFee | uint256 | new admin fee to be applied on future transactions |

### setSwapFee

```solidity
function setSwapFee(uint256 newSwapFee) external nonpayable
```

Update the swap fee to be applied on swaps

#### Parameters

| Name       | Type    | Description                                       |
| ---------- | ------- | ------------------------------------------------- |
| newSwapFee | uint256 | new swap fee to be applied on future transactions |

### stopRampA

```solidity
function stopRampA() external nonpayable
```

Stop ramping A immediately. Reverts if ramp A is already stopped.

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

Swap two tokens using this pool

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swapStorage

```solidity
function swapStorage() external view returns (uint256 initialA, uint256 futureA, uint256 initialATime, uint256 futureATime, uint256 swapFee, uint256 adminFee, contract LPToken lpToken)
```

#### Returns

| Name         | Type             | Description |
| ------------ | ---------------- | ----------- |
| initialA     | uint256          | undefined   |
| futureA      | uint256          | undefined   |
| initialATime | uint256          | undefined   |
| futureATime  | uint256          | undefined   |
| swapFee      | uint256          | undefined   |
| adminFee     | uint256          | undefined   |
| lpToken      | contract LPToken | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

Unpause the contract. Revert if already unpaused.

### withdrawAdminFees

```solidity
function withdrawAdminFees() external nonpayable
```

Withdraw all admin fees to the contract owner

## Events

### AddLiquidity

```solidity
event AddLiquidity(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### NewAdminFee

```solidity
event NewAdminFee(uint256 newAdminFee)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| newAdminFee | uint256 | undefined   |

### NewSwapFee

```solidity
event NewSwapFee(uint256 newSwapFee)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| newSwapFee | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RampA

```solidity
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| oldA        | uint256 | undefined   |
| newA        | uint256 | undefined   |
| initialTime | uint256 | undefined   |
| futureTime  | uint256 | undefined   |

### RemoveLiquidity

```solidity
event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityImbalance

```solidity
event RemoveLiquidityImbalance(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityOne

```solidity
event RemoveLiquidityOne(address indexed provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| provider `indexed` | address | undefined   |
| lpTokenAmount      | uint256 | undefined   |
| lpTokenSupply      | uint256 | undefined   |
| boughtId           | uint256 | undefined   |
| tokensBought       | uint256 | undefined   |

### StopRampA

```solidity
event StopRampA(uint256 currentA, uint256 time)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| currentA | uint256 | undefined   |
| time     | uint256 | undefined   |

### TokenSwap

```solidity
event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| buyer `indexed` | address | undefined   |
| tokensSold      | uint256 | undefined   |
| tokensBought    | uint256 | undefined   |
| soldId          | uint128 | undefined   |
| boughtId        | uint128 | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# SwapDeployer

## Methods

### deploy

```solidity
function deploy(address swapAddress, contract IERC20[] _pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 _a, uint256 _fee, uint256 _adminFee, address lpTokenTargetAddress) external nonpayable returns (address)
```

#### Parameters

| Name                 | Type               | Description |
| -------------------- | ------------------ | ----------- |
| swapAddress          | address            | undefined   |
| \_pooledTokens       | contract IERC20\[] | undefined   |
| decimals             | uint8\[]           | undefined   |
| lpTokenName          | string             | undefined   |
| lpTokenSymbol        | string             | undefined   |
| \_a                  | uint256            | undefined   |
| \_fee                | uint256            | undefined   |
| \_adminFee           | uint256            | undefined   |
| lpTokenTargetAddress | address            | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### NewSwapPool

```solidity
event NewSwapPool(address indexed deployer, address swapAddress, contract IERC20[] pooledTokens)
```

#### Parameters

| Name               | Type               | Description |
| ------------------ | ------------------ | ----------- |
| deployer `indexed` | address            | undefined   |
| swapAddress        | address            | undefined   |
| pooledTokens       | contract IERC20\[] | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# SwapEthWrapper

*Jongseung Lim (@weeb\_mcgee)*

> SwapEthWrapper

A wrapper contract for Swap contracts that have WETH as one of the pooled tokens.

## Methods

### LP\_TOKEN

```solidity
function LP_TOKEN() external view returns (contract LPToken)
```

#### Returns

| Name | Type             | Description |
| ---- | ---------------- | ----------- |
| \_0  | contract LPToken | undefined   |

### OWNER

```solidity
function OWNER() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### SWAP

```solidity
function SWAP() external view returns (contract Swap)
```

#### Returns

| Name | Type          | Description |
| ---- | ------------- | ----------- |
| \_0  | contract Swap | undefined   |

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### WETH\_INDEX

```solidity
function WETH_INDEX() external view returns (uint8)
```

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external payable returns (uint256)
```

Add liquidity to the pool with the given amounts of tokens.

*The msg.value of this call should match the value in amounts array in position of WETH9.*

#### Parameters

| Name      | Type       | Description                                                                                                             |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| amounts   | uint256\[] | the amounts of each token to add, in their native precision                                                             |
| minToMint | uint256    | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline  | uint256    | latest timestamp to accept this transaction                                                                             |

#### Returns

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| \_0  | uint256 | amount of LP token user minted and received |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens

#### Parameters

| Name   | Type    | Description                                                |
| ------ | ------- | ---------------------------------------------------------- |
| amount | uint256 | the amount of LP tokens that would be burned on withdrawal |

#### Returns

| Name | Type       | Description                                        |
| ---- | ---------- | -------------------------------------------------- |
| \_0  | uint256\[] | array of token balances that the user will receive |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                                                                                                                 |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. If a token charges a fee on transfers, use the amount that gets transferred after the fee. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                                                                                                                   |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### pooledTokens

```solidity
function pooledTokens(uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

Burn LP tokens to remove liquidity from the pool.

*Liquidity can always be removed, even when the pool is paused. Caller will receive ETH instead of WETH9.*

#### Parameters

| Name       | Type       | Description                                                                                                  |
| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| amount     | uint256    | the amount of LP tokens to burn                                                                              |
| minAmounts | uint256\[] | the minimum amounts of each token in the pool acceptable for this burn. Useful as a front-running mitigation |
| deadline   | uint256    | latest timestamp to accept this transaction                                                                  |

#### Returns

| Name | Type       | Description                     |
| ---- | ---------- | ------------------------------- |
| \_0  | uint256\[] | amounts of tokens user received |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool, weighted differently than the pool's current balances.

*Caller will receive ETH instead of WETH9.*

#### Parameters

| Name          | Type       | Description                                                                                            |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------ |
| amounts       | uint256\[] | how much of each token to withdraw                                                                     |
| maxBurnAmount | uint256    | the max LP token provider is willing to pay to remove liquidity. Useful as a front-running mitigation. |
| deadline      | uint256    | latest timestamp to accept this transaction                                                            |

#### Returns

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| \_0  | uint256 | amount of LP tokens burned |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool all in one token.

*Caller will receive ETH instead of WETH9.*

#### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| tokenAmount | uint256 | the amount of the token you want to receive      |
| tokenIndex  | uint8   | the index of the token you want to receive       |
| minAmount   | uint256 | the minimum amount to withdraw, otherwise revert |
| deadline    | uint256 | latest timestamp to accept this transaction      |

#### Returns

| Name | Type    | Description                          |
| ---- | ------- | ------------------------------------ |
| \_0  | uint256 | amount of chosen token user received |

### rescue

```solidity
function rescue() external nonpayable
```

Rescues any of the ETH, the pooled tokens, or the LPToken that may be stuck in this contract. Only the OWNER can call this function.

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external payable returns (uint256)
```

Swap two tokens using the underlying pool. If tokenIndexFrom represents WETH9 in the pool, the caller must set msg.value equal to dx. If the user is swapping to WETH9 in the pool, the user will receive ETH instead.

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# SwapFlashLoan

> Swap - A StableSwap implementation in solidity.

This contract is responsible for custody of closely pegged assets (eg. group of stablecoins) and automatic market making system. Users become an LP (Liquidity Provider) by depositing their tokens in desired ratios for an exchange of the pool token that represents their share of the pool. Users can burn pool tokens and withdraw their share of token(s). Each time a swap between the pooled tokens happens, a set fee incurs which effectively gets distributed to the LPs. In case of emergencies, admin can pause additional deposits, swaps, or single-asset withdraws - which stops the ratio of the tokens in the pool from changing. Users can always withdraw their tokens via multi-asset withdraws.

*Most of the logic is stored as a library `SwapUtils` for the sake of reducing contract's deployment size.*

## Methods

### MAX\_BPS

```solidity
function MAX_BPS() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

Add liquidity to the pool with the given amounts of tokens

#### Parameters

| Name      | Type       | Description                                                                                                             |
| --------- | ---------- | ----------------------------------------------------------------------------------------------------------------------- |
| amounts   | uint256\[] | the amounts of each token to add, in their native precision                                                             |
| minToMint | uint256    | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline  | uint256    | latest timestamp to accept this transaction                                                                             |

#### Returns

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| \_0  | uint256 | amount of LP token user minted and received |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

A simple method to calculate amount of each underlying tokens that is returned upon burning given amount of LP tokens

#### Parameters

| Name   | Type    | Description                                                |
| ------ | ------- | ---------------------------------------------------------- |
| amount | uint256 | the amount of LP tokens that would be burned on withdrawal |

#### Returns

| Name | Type       | Description                                        |
| ---- | ---------- | -------------------------------------------------- |
| \_0  | uint256\[] | array of token balances that the user will receive |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type    | Description                                                                                                                               |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8   | the token the user wants to buy                                                                                                           |
| dx             | uint256 | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                                                                                                                 |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. If a token charges a fee on transfers, use the amount that gets transferred after the fee. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                                                                                                                   |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### flashLoan

```solidity
function flashLoan(address receiver, contract IERC20 token, uint256 amount, bytes params) external nonpayable
```

Borrow the specified token from this pool for this transaction only. This function will call `IFlashLoanReceiver(receiver).executeOperation` and the `receiver` must return the full amount of the token and the associated fee by the end of the callback transaction. If the conditions are not met, this call is reverted.

#### Parameters

| Name     | Type            | Description                                                                                                                                          |
| -------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| receiver | address         | the address of the receiver of the token. This address must implement the IFlashLoanReceiver interface and the callback function `executeOperation`. |
| token    | contract IERC20 | the protocol fee in bps to be applied on the total flash loan fee                                                                                    |
| amount   | uint256         | the total amount to borrow in this transaction                                                                                                       |
| params   | bytes           | optional data to pass along to the callback function                                                                                                 |

### flashLoanFeeBPS

```solidity
function flashLoanFeeBPS() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getA

```solidity
function getA() external view returns (uint256)
```

Return A, the amplification coefficient \* n \* (n - 1)

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | A parameter |

### getAPrecise

```solidity
function getAPrecise() external view returns (uint256)
```

Return A in its raw precision form

*See the StableSwap paper for details*

#### Returns

| Name | Type    | Description                           |
| ---- | ------- | ------------------------------------- |
| \_0  | uint256 | A parameter in its raw precision form |

### getAdminBalance

```solidity
function getAdminBalance(uint256 index) external view returns (uint256)
```

This function reads the accumulated amount of admin fees of the token with given index

#### Parameters

| Name  | Type    | Description               |
| ----- | ------- | ------------------------- |
| index | uint256 | Index of the pooled token |

#### Returns

| Name | Type    | Description                                    |
| ---- | ------- | ---------------------------------------------- |
| \_0  | uint256 | admin's token balance in the token's precision |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

Return address of the pooled token at given index. Reverts if tokenIndex is out of range.

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type            | Description                         |
| ---- | --------------- | ----------------------------------- |
| \_0  | contract IERC20 | address of the token at given index |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

Return current balance of the pooled token at given index

#### Parameters

| Name  | Type  | Description            |
| ----- | ----- | ---------------------- |
| index | uint8 | the index of the token |

#### Returns

| Name | Type    | Description                                                                      |
| ---- | ------- | -------------------------------------------------------------------------------- |
| \_0  | uint256 | current balance of the pooled token at given index with token's native precision |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

Return the index of the given token address. Reverts if no matching token is found.

#### Parameters

| Name         | Type    | Description          |
| ------------ | ------- | -------------------- |
| tokenAddress | address | address of the token |

#### Returns

| Name | Type  | Description                          |
| ---- | ----- | ------------------------------------ |
| \_0  | uint8 | the index of the given token address |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

Get the virtual price, to help calculate profit

#### Returns

| Name | Type    | Description                                                |
| ---- | ------- | ---------------------------------------------------------- |
| \_0  | uint256 | the virtual price, scaled to the POOL\_PRECISION\_DECIMALS |

### initialize

```solidity
function initialize(contract IERC20[] _pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 _a, uint256 _fee, uint256 _adminFee, address lpTokenTargetAddress) external nonpayable
```

Initializes this Swap contract with the given parameters. This will also clone a LPToken contract that represents users' LP positions. The owner of LPToken will be this contract - which means only this contract is allowed to mint/burn tokens.

#### Parameters

| Name                 | Type               | Description                                                                                               |
| -------------------- | ------------------ | --------------------------------------------------------------------------------------------------------- |
| \_pooledTokens       | contract IERC20\[] | an array of ERC20s this pool will accept                                                                  |
| decimals             | uint8\[]           | the decimals to use for each pooled token, eg 8 for WBTC. Cannot be larger than POOL\_PRECISION\_DECIMALS |
| lpTokenName          | string             | the long-form name of the token to be deployed                                                            |
| lpTokenSymbol        | string             | the short symbol for the token to be deployed                                                             |
| \_a                  | uint256            | the amplification coefficient \* n \* (n - 1). See the StableSwap paper for details                       |
| \_fee                | uint256            | default swap fee to be initialized with                                                                   |
| \_adminFee           | uint256            | default adminFee to be initialized with                                                                   |
| lpTokenTargetAddress | address            | the address of an existing LPToken contract to use as a target                                            |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

Pause the contract. Revert if already paused.

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### protocolFeeShareBPS

```solidity
function protocolFeeShareBPS() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### rampA

```solidity
function rampA(uint256 futureA, uint256 futureTime) external nonpayable
```

Start ramping up or down A parameter towards given futureA and futureTime Checks if the change is too rapid, and commits the new A value only when it falls under the limit range.

#### Parameters

| Name       | Type    | Description                                |
| ---------- | ------- | ------------------------------------------ |
| futureA    | uint256 | the new A to ramp towards                  |
| futureTime | uint256 | timestamp when the new A should be reached |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

Burn LP tokens to remove liquidity from the pool. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

*Liquidity can always be removed, even when the pool is paused.*

#### Parameters

| Name       | Type       | Description                                                                                                  |
| ---------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| amount     | uint256    | the amount of LP tokens to burn                                                                              |
| minAmounts | uint256\[] | the minimum amounts of each token in the pool acceptable for this burn. Useful as a front-running mitigation |
| deadline   | uint256    | latest timestamp to accept this transaction                                                                  |

#### Returns

| Name | Type       | Description                     |
| ---- | ---------- | ------------------------------- |
| \_0  | uint256\[] | amounts of tokens user received |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool, weighted differently than the pool's current balances. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name          | Type       | Description                                                                                            |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------ |
| amounts       | uint256\[] | how much of each token to withdraw                                                                     |
| maxBurnAmount | uint256    | the max LP token provider is willing to pay to remove liquidity. Useful as a front-running mitigation. |
| deadline      | uint256    | latest timestamp to accept this transaction                                                            |

#### Returns

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| \_0  | uint256 | amount of LP tokens burned |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

Remove liquidity from the pool all in one token. Withdraw fee that decays linearly over period of 4 weeks since last deposit will apply.

#### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| tokenAmount | uint256 | the amount of the token you want to receive      |
| tokenIndex  | uint8   | the index of the token you want to receive       |
| minAmount   | uint256 | the minimum amount to withdraw, otherwise revert |
| deadline    | uint256 | latest timestamp to accept this transaction      |

#### Returns

| Name | Type    | Description                          |
| ---- | ------- | ------------------------------------ |
| \_0  | uint256 | amount of chosen token user received |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setAdminFee

```solidity
function setAdminFee(uint256 newAdminFee) external nonpayable
```

Update the admin fee. Admin fee takes portion of the swap fee.

#### Parameters

| Name        | Type    | Description                                        |
| ----------- | ------- | -------------------------------------------------- |
| newAdminFee | uint256 | new admin fee to be applied on future transactions |

### setFlashLoanFees

```solidity
function setFlashLoanFees(uint256 newFlashLoanFeeBPS, uint256 newProtocolFeeShareBPS) external nonpayable
```

Updates the flash loan fee parameters. This function can only be called by the owner.

#### Parameters

| Name                   | Type    | Description                                                       |
| ---------------------- | ------- | ----------------------------------------------------------------- |
| newFlashLoanFeeBPS     | uint256 | the total fee in bps to be applied on future flash loans          |
| newProtocolFeeShareBPS | uint256 | the protocol fee in bps to be applied on the total flash loan fee |

### setSwapFee

```solidity
function setSwapFee(uint256 newSwapFee) external nonpayable
```

Update the swap fee to be applied on swaps

#### Parameters

| Name       | Type    | Description                                       |
| ---------- | ------- | ------------------------------------------------- |
| newSwapFee | uint256 | new swap fee to be applied on future transactions |

### stopRampA

```solidity
function stopRampA() external nonpayable
```

Stop ramping A immediately. Reverts if ramp A is already stopped.

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

Swap two tokens using this pool

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swapStorage

```solidity
function swapStorage() external view returns (uint256 initialA, uint256 futureA, uint256 initialATime, uint256 futureATime, uint256 swapFee, uint256 adminFee, contract LPToken lpToken)
```

#### Returns

| Name         | Type             | Description |
| ------------ | ---------------- | ----------- |
| initialA     | uint256          | undefined   |
| futureA      | uint256          | undefined   |
| initialATime | uint256          | undefined   |
| futureATime  | uint256          | undefined   |
| swapFee      | uint256          | undefined   |
| adminFee     | uint256          | undefined   |
| lpToken      | contract LPToken | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

Unpause the contract. Revert if already unpaused.

### withdrawAdminFees

```solidity
function withdrawAdminFees() external nonpayable
```

Withdraw all admin fees to the contract owner

## Events

### AddLiquidity

```solidity
event AddLiquidity(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### FlashLoan

```solidity
event FlashLoan(address indexed receiver, uint8 tokenIndex, uint256 amount, uint256 amountFee, uint256 protocolFee)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| receiver `indexed` | address | undefined   |
| tokenIndex         | uint8   | undefined   |
| amount             | uint256 | undefined   |
| amountFee          | uint256 | undefined   |
| protocolFee        | uint256 | undefined   |

### NewAdminFee

```solidity
event NewAdminFee(uint256 newAdminFee)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| newAdminFee | uint256 | undefined   |

### NewSwapFee

```solidity
event NewSwapFee(uint256 newSwapFee)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| newSwapFee | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RampA

```solidity
event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| oldA        | uint256 | undefined   |
| newA        | uint256 | undefined   |
| initialTime | uint256 | undefined   |
| futureTime  | uint256 | undefined   |

### RemoveLiquidity

```solidity
event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityImbalance

```solidity
event RemoveLiquidityImbalance(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityOne

```solidity
event RemoveLiquidityOne(address indexed provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| provider `indexed` | address | undefined   |
| lpTokenAmount      | uint256 | undefined   |
| lpTokenSupply      | uint256 | undefined   |
| boughtId           | uint256 | undefined   |
| tokensBought       | uint256 | undefined   |

### StopRampA

```solidity
event StopRampA(uint256 currentA, uint256 time)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| currentA | uint256 | undefined   |
| time     | uint256 | undefined   |

### TokenSwap

```solidity
event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| buyer `indexed` | address | undefined   |
| tokensSold      | uint256 | undefined   |
| tokensBought    | uint256 | undefined   |
| soldId          | uint128 | undefined   |
| boughtId        | uint128 | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# SwapUtils

> SwapUtils library

A library to be used within Swap.sol. Contains functions responsible for custody and AMM functionalities.

*Contracts relying on this library must initialize SwapUtils.Swap struct then use this library for SwapUtils.Swap struct. Note that this library contains both functions called by users and admins. Admin functions should be protected within contracts using this library.*

## Methods

### MAX\_ADMIN\_FEE

```solidity
function MAX_ADMIN_FEE() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### MAX\_SWAP\_FEE

```solidity
function MAX_SWAP_FEE() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### POOL\_PRECISION\_DECIMALS

```solidity
function POOL_PRECISION_DECIMALS() external view returns (uint8)
```

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

## Events

### AddLiquidity

```solidity
event AddLiquidity(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### NewAdminFee

```solidity
event NewAdminFee(uint256 newAdminFee)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| newAdminFee | uint256 | undefined   |

### NewSwapFee

```solidity
event NewSwapFee(uint256 newSwapFee)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| newSwapFee | uint256 | undefined   |

### RemoveLiquidity

```solidity
event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityImbalance

```solidity
event RemoveLiquidityImbalance(address indexed provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
```

#### Parameters

| Name               | Type       | Description |
| ------------------ | ---------- | ----------- |
| provider `indexed` | address    | undefined   |
| tokenAmounts       | uint256\[] | undefined   |
| fees               | uint256\[] | undefined   |
| invariant          | uint256    | undefined   |
| lpTokenSupply      | uint256    | undefined   |

### RemoveLiquidityOne

```solidity
event RemoveLiquidityOne(address indexed provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| provider `indexed` | address | undefined   |
| lpTokenAmount      | uint256 | undefined   |
| lpTokenSupply      | uint256 | undefined   |
| boughtId           | uint256 | undefined   |
| tokensBought       | uint256 | undefined   |

### TokenSwap

```solidity
event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| buyer `indexed` | address | undefined   |
| tokensSold      | uint256 | undefined   |
| tokensBought    | uint256 | undefined   |
| soldId          | uint128 | undefined   |
| boughtId        | uint128 | undefined   |


# helper


# BaseSwapDeposit

## Methods

### baseSwap

```solidity
function baseSwap() external view returns (contract ISwap)
```

#### Returns

| Name | Type           | Description |
| ---- | -------------- | ----------- |
| \_0  | contract ISwap | undefined   |

### baseTokens

```solidity
function baseTokens(uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type    | Description                                                                                                                               |
| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8   | the token the user wants to buy                                                                                                           |
| dx             | uint256 | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### getToken

```solidity
function getToken(uint256 index) external view returns (contract IERC20)
```

Returns the address of the pooled token at given index. Reverts if tokenIndex is out of range.

#### Parameters

| Name  | Type    | Description            |
| ----- | ------- | ---------------------- |
| index | uint256 | the index of the token |

#### Returns

| Name | Type            | Description                         |
| ---- | --------------- | ----------------------------------- |
| \_0  | contract IERC20 | address of the token at given index |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

Swap two underlying tokens using the meta pool and the base pool

#### Parameters

| Name           | Type    | Description                                               |
| -------------- | ------- | --------------------------------------------------------- |
| tokenIndexFrom | uint8   | the token the user wants to swap from                     |
| tokenIndexTo   | uint8   | the token the user wants to swap to                       |
| dx             | uint256 | the amount of tokens the user wants to swap from          |
| minDy          | uint256 | the min amount the user would like to receive, or revert. |
| deadline       | uint256 | latest timestamp to accept this transaction               |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# FlashLoanBorrowerExample

## Methods

### executeOperation

```solidity
function executeOperation(address pool, address token, uint256 amount, uint256 fee, bytes params) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| pool   | address | undefined   |
| token  | address | undefined   |
| amount | uint256 | undefined   |
| fee    | uint256 | undefined   |
| params | bytes   | undefined   |

### flashLoan

```solidity
function flashLoan(contract ISwapFlashLoan swap, contract IERC20 token, uint256 amount, bytes params) external nonpayable
```

#### Parameters

| Name   | Type                    | Description |
| ------ | ----------------------- | ----------- |
| swap   | contract ISwapFlashLoan | undefined   |
| token  | contract IERC20         | undefined   |
| amount | uint256                 | undefined   |
| params | bytes                   | undefined   |


# GenericERC20

> Generic ERC20 token

This contract simulates a generic ERC20 token that is mintable and burnable.

## Methods

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*See {IERC20-allowance}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*See {IERC20-balanceOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### decimals

```solidity
function decimals() external view returns (uint8)
```

*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {\_setupDecimals} is called. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### decreaseAllowance

```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```

*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| spender         | address | undefined   |
| subtractedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increaseAllowance

```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```

*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| spender    | address | undefined   |
| addedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address recipient, uint256 amount) external nonpayable
```

Mints given amount of tokens to recipient

*only owner can call this mint function*

#### Parameters

| Name      | Type    | Description                              |
| --------- | ------- | ---------------------------------------- |
| recipient | address | address of account to receive the tokens |
| amount    | uint256 | amount of tokens to mint                 |

### name

```solidity
function name() external view returns (string)
```

*Returns the name of the token.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### symbol

```solidity
function symbol() external view returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC20-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# Multicall2

*Michael Elliot <<mike@makerdao.com>>Joshua Levine <<joshua@makerdao.com>>Nick Johnson <<arachnid@notdot.net>>*

> Multicall2 - Aggregate results from multiple read-only function calls

## Methods

### aggregate

```solidity
function aggregate(Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes[] returnData)
```

#### Parameters

| Name  | Type               | Description |
| ----- | ------------------ | ----------- |
| calls | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type     | Description |
| ----------- | -------- | ----------- |
| blockNumber | uint256  | undefined   |
| returnData  | bytes\[] | undefined   |

### blockAndAggregate

```solidity
function blockAndAggregate(Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes32 blockHash, struct Multicall2.Result[] returnData)
```

#### Parameters

| Name  | Type               | Description |
| ----- | ------------------ | ----------- |
| calls | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type                 | Description |
| ----------- | -------------------- | ----------- |
| blockNumber | uint256              | undefined   |
| blockHash   | bytes32              | undefined   |
| returnData  | Multicall2.Result\[] | undefined   |

### getBlockHash

```solidity
function getBlockHash(uint256 blockNumber) external view returns (bytes32 blockHash)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| blockNumber | uint256 | undefined   |

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| blockHash | bytes32 | undefined   |

### getBlockNumber

```solidity
function getBlockNumber() external view returns (uint256 blockNumber)
```

#### Returns

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| blockNumber | uint256 | undefined   |

### getCurrentBlockCoinbase

```solidity
function getCurrentBlockCoinbase() external view returns (address coinbase)
```

#### Returns

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| coinbase | address | undefined   |

### getCurrentBlockDifficulty

```solidity
function getCurrentBlockDifficulty() external view returns (uint256 difficulty)
```

#### Returns

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| difficulty | uint256 | undefined   |

### getCurrentBlockGasLimit

```solidity
function getCurrentBlockGasLimit() external view returns (uint256 gaslimit)
```

#### Returns

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| gaslimit | uint256 | undefined   |

### getCurrentBlockTimestamp

```solidity
function getCurrentBlockTimestamp() external view returns (uint256 timestamp)
```

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| timestamp | uint256 | undefined   |

### getEthBalance

```solidity
function getEthBalance(address addr) external view returns (uint256 balance)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| addr | address | undefined   |

#### Returns

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| balance | uint256 | undefined   |

### getLastBlockHash

```solidity
function getLastBlockHash() external view returns (bytes32 blockHash)
```

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| blockHash | bytes32 | undefined   |

### tryAggregate

```solidity
function tryAggregate(bool requireSuccess, Multicall2.Call[] calls) external nonpayable returns (struct Multicall2.Result[] returnData)
```

#### Parameters

| Name           | Type               | Description |
| -------------- | ------------------ | ----------- |
| requireSuccess | bool               | undefined   |
| calls          | Multicall2.Call\[] | undefined   |

#### Returns

| Name       | Type                 | Description |
| ---------- | -------------------- | ----------- |
| returnData | Multicall2.Result\[] | undefined   |

### tryBlockAndAggregate

```solidity
function tryBlockAndAggregate(bool requireSuccess, Multicall2.Call[] calls) external nonpayable returns (uint256 blockNumber, bytes32 blockHash, struct Multicall2.Result[] returnData)
```

#### Parameters

| Name           | Type               | Description |
| -------------- | ------------------ | ----------- |
| requireSuccess | bool               | undefined   |
| calls          | Multicall2.Call\[] | undefined   |

#### Returns

| Name        | Type                 | Description |
| ----------- | -------------------- | ----------- |
| blockNumber | uint256              | undefined   |
| blockHash   | bytes32              | undefined   |
| returnData  | Multicall2.Result\[] | undefined   |


# test


# TestMathUtils

## Methods

### difference

```solidity
function difference(uint256 a, uint256 b) external pure returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| a    | uint256 | undefined   |
| b    | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### within1

```solidity
function within1(uint256 a, uint256 b) external pure returns (bool)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| a    | uint256 | undefined   |
| b    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |


# TestSwapReturnValues

## Methods

### MAX\_INT

```solidity
function MAX_INT() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### lpToken

```solidity
function lpToken() external view returns (contract IERC20)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### n

```solidity
function n() external view returns (uint8)
```

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### swap

```solidity
function swap() external view returns (contract ISwap)
```

#### Returns

| Name | Type           | Description |
| ---- | -------------- | ----------- |
| \_0  | contract ISwap | undefined   |

### test\_addLiquidity

```solidity
function test_addLiquidity(uint256[] amounts, uint256 minToMint) external nonpayable
```

#### Parameters

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| amounts   | uint256\[] | undefined   |
| minToMint | uint256    | undefined   |

### test\_removeLiquidity

```solidity
function test_removeLiquidity(uint256 amount, uint256[] minAmounts) external nonpayable
```

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| amount     | uint256    | undefined   |
| minAmounts | uint256\[] | undefined   |

### test\_removeLiquidityImbalance

```solidity
function test_removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount) external nonpayable
```

#### Parameters

| Name          | Type       | Description |
| ------------- | ---------- | ----------- |
| amounts       | uint256\[] | undefined   |
| maxBurnAmount | uint256    | undefined   |

### test\_removeLiquidityOneToken

```solidity
function test_removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount) external nonpayable
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |
| minAmount   | uint256 | undefined   |

### test\_swap

```solidity
function test_swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy) external nonpayable
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |


# interfaces


# IFlashLoanReceiver

*Aave*

> IFlashLoanReceiver interface

Interface for the Nerve fee IFlashLoanReceiver. Modified from Aave's IFlashLoanReceiver interface. <https://github.com/aave/aave-protocol/blob/4b4545fb583fd4f400507b10f3c3114f45b8a037/contracts/flashloan/interfaces/IFlashLoanReceiver.sol>

*implement this interface to develop a flashloan-compatible flashLoanReceiver contract*\*

## Methods

### executeOperation

```solidity
function executeOperation(address pool, address token, uint256 amount, uint256 fee, bytes params) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| pool   | address | undefined   |
| token  | address | undefined   |
| amount | uint256 | undefined   |
| fee    | uint256 | undefined   |
| params | bytes   | undefined   |


# IMetaSwap

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| amounts   | uint256\[] | undefined   |
| minToMint | uint256    | undefined   |
| deadline  | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |

#### Returns

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| availableTokenAmount | uint256 | undefined   |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateSwapUnderlying

```solidity
function calculateSwapUnderlying(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

#### Parameters

| Name    | Type       | Description |
| ------- | ---------- | ----------- |
| amounts | uint256\[] | undefined   |
| deposit | bool       | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getA

```solidity
function getA() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initializeMetaSwap

```solidity
function initializeMetaSwap(contract IERC20[] pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 a, uint256 fee, uint256 adminFee, address lpTokenTargetAddress, address baseSwap) external nonpayable
```

#### Parameters

| Name                 | Type               | Description |
| -------------------- | ------------------ | ----------- |
| pooledTokens         | contract IERC20\[] | undefined   |
| decimals             | uint8\[]           | undefined   |
| lpTokenName          | string             | undefined   |
| lpTokenSymbol        | string             | undefined   |
| a                    | uint256            | undefined   |
| fee                  | uint256            | undefined   |
| adminFee             | uint256            | undefined   |
| lpTokenTargetAddress | address            | undefined   |
| baseSwap             | address            | undefined   |

### isGuarded

```solidity
function isGuarded() external view returns (bool)
```

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| amount     | uint256    | undefined   |
| minAmounts | uint256\[] | undefined   |
| deadline   | uint256    | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type       | Description |
| ------------- | ---------- | ----------- |
| amounts       | uint256\[] | undefined   |
| maxBurnAmount | uint256    | undefined   |
| deadline      | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |
| minAmount   | uint256 | undefined   |
| deadline    | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swapStorage

```solidity
function swapStorage() external view returns (uint256 initialA, uint256 futureA, uint256 initialATime, uint256 futureATime, uint256 swapFee, uint256 adminFee, address lpToken)
```

#### Returns

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| initialA     | uint256 | undefined   |
| futureA      | uint256 | undefined   |
| initialATime | uint256 | undefined   |
| futureATime  | uint256 | undefined   |
| swapFee      | uint256 | undefined   |
| adminFee     | uint256 | undefined   |
| lpToken      | address | undefined   |

### swapUnderlying

```solidity
function swapUnderlying(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# IMetaSwapDeposit

## Methods

### initialize

```solidity
function initialize(contract ISwap baseSwap_, contract IMetaSwap metaSwap_, contract IERC20 metaLPToken_) external nonpayable
```

#### Parameters

| Name          | Type               | Description |
| ------------- | ------------------ | ----------- |
| baseSwap\_    | contract ISwap     | undefined   |
| metaSwap\_    | contract IMetaSwap | undefined   |
| metaLPToken\_ | contract IERC20    | undefined   |


# ISwap

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| amounts   | uint256\[] | undefined   |
| minToMint | uint256    | undefined   |
| deadline  | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |

#### Returns

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| availableTokenAmount | uint256 | undefined   |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

#### Parameters

| Name    | Type       | Description |
| ------- | ---------- | ----------- |
| amounts | uint256\[] | undefined   |
| deposit | bool       | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getA

```solidity
function getA() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initialize

```solidity
function initialize(contract IERC20[] pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 a, uint256 fee, uint256 adminFee, address lpTokenTargetAddress) external nonpayable
```

#### Parameters

| Name                 | Type               | Description |
| -------------------- | ------------------ | ----------- |
| pooledTokens         | contract IERC20\[] | undefined   |
| decimals             | uint8\[]           | undefined   |
| lpTokenName          | string             | undefined   |
| lpTokenSymbol        | string             | undefined   |
| a                    | uint256            | undefined   |
| fee                  | uint256            | undefined   |
| adminFee             | uint256            | undefined   |
| lpTokenTargetAddress | address            | undefined   |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| amount     | uint256    | undefined   |
| minAmounts | uint256\[] | undefined   |
| deadline   | uint256    | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type       | Description |
| ------------- | ---------- | ----------- |
| amounts       | uint256\[] | undefined   |
| maxBurnAmount | uint256    | undefined   |
| deadline      | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |
| minAmount   | uint256 | undefined   |
| deadline    | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# ISwapFlashLoan

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| amounts   | uint256\[] | undefined   |
| minToMint | uint256    | undefined   |
| deadline  | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |

#### Returns

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| availableTokenAmount | uint256 | undefined   |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

#### Parameters

| Name    | Type       | Description |
| ------- | ---------- | ----------- |
| amounts | uint256\[] | undefined   |
| deposit | bool       | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### flashLoan

```solidity
function flashLoan(address receiver, contract IERC20 token, uint256 amount, bytes params) external nonpayable
```

#### Parameters

| Name     | Type            | Description |
| -------- | --------------- | ----------- |
| receiver | address         | undefined   |
| token    | contract IERC20 | undefined   |
| amount   | uint256         | undefined   |
| params   | bytes           | undefined   |

### getA

```solidity
function getA() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initialize

```solidity
function initialize(contract IERC20[] pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 a, uint256 fee, uint256 adminFee, address lpTokenTargetAddress) external nonpayable
```

#### Parameters

| Name                 | Type               | Description |
| -------------------- | ------------------ | ----------- |
| pooledTokens         | contract IERC20\[] | undefined   |
| decimals             | uint8\[]           | undefined   |
| lpTokenName          | string             | undefined   |
| lpTokenSymbol        | string             | undefined   |
| a                    | uint256            | undefined   |
| fee                  | uint256            | undefined   |
| adminFee             | uint256            | undefined   |
| lpTokenTargetAddress | address            | undefined   |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| amount     | uint256    | undefined   |
| minAmounts | uint256\[] | undefined   |
| deadline   | uint256    | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type       | Description |
| ------------- | ---------- | ----------- |
| amounts       | uint256\[] | undefined   |
| maxBurnAmount | uint256    | undefined   |
| deadline      | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |
| minAmount   | uint256 | undefined   |
| deadline    | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# auxiliary


# DummyWeth

## Methods

### WETH

```solidity
function WETH() external view returns (contract IWETH9)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IWETH9 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### rescue

```solidity
function rescue(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### setWETHAddress

```solidity
function setWETHAddress(address payable _weth) external nonpayable
```

#### Parameters

| Name   | Type            | Description |
| ------ | --------------- | ----------- |
| \_weth | address payable | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### withdrawToSelf

```solidity
function withdrawToSelf(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# DummyWethProxy

## Methods

### WETH

```solidity
function WETH() external view returns (contract IWETH9)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IWETH9 | undefined   |

### initialize

```solidity
function initialize() external nonpayable
```

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### rescue

```solidity
function rescue(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### setWETHAddress

```solidity
function setWETHAddress(address payable _weth) external nonpayable
```

#### Parameters

| Name   | Type            | Description |
| ------ | --------------- | ----------- |
| \_weth | address payable | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### withdrawToSelf

```solidity
function withdrawToSelf(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# bridge


# BridgeConfigV3

> BridgeConfig contract

This token is used for configuring different tokens on the bridge and mapping them across chains.\*

## Methods

### BRIDGEMANAGER\_ROLE

```solidity
function BRIDGEMANAGER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### bridgeConfigVersion

```solidity
function bridgeConfigVersion() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateSwapFee

```solidity
function calculateSwapFee(string tokenAddress, uint256 chainID, uint256 amount) external view returns (uint256)
```

Calculates bridge swap fee based on the destination chain's token transfer.

*This means the fee should be calculated based on the chain that the nodes emit a tx on*

#### Parameters

| Name         | Type    | Description                                                |
| ------------ | ------- | ---------------------------------------------------------- |
| tokenAddress | string  | address of the destination token to query token config for |
| chainID      | uint256 | destination chain ID to query the token config for         |
| amount       | uint256 | in native token decimals                                   |

#### Returns

| Name | Type    | Description                      |
| ---- | ------- | -------------------------------- |
| \_0  | uint256 | Fee calculated in token decimals |

### calculateSwapFee

```solidity
function calculateSwapFee(address tokenAddress, uint256 chainID, uint256 amount) external view returns (uint256)
```

Calculates bridge swap fee based on the destination chain's token transfer.

*This means the fee should be calculated based on the chain that the nodes emit a tx on*

#### Parameters

| Name         | Type    | Description                                                |
| ------------ | ------- | ---------------------------------------------------------- |
| tokenAddress | address | address of the destination token to query token config for |
| chainID      | uint256 | destination chain ID to query the token config for         |
| amount       | uint256 | in native token decimals                                   |

#### Returns

| Name | Type    | Description                      |
| ---- | ------- | -------------------------------- |
| \_0  | uint256 | Fee calculated in token decimals |

### getAllTokenIDs

```solidity
function getAllTokenIDs() external view returns (string[] result)
```

Returns a list of all existing token IDs converted to strings

#### Returns

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| result | string\[] | undefined   |

### getMaxGasPrice

```solidity
function getMaxGasPrice(uint256 chainID) external view returns (uint256)
```

gets the max gas price for a chain

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| chainID | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getPoolConfig

```solidity
function getPoolConfig(address tokenAddress, uint256 chainID) external view returns (struct BridgeConfigV3.Pool)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |
| chainID      | uint256 | undefined   |

#### Returns

| Name | Type                | Description |
| ---- | ------------------- | ----------- |
| \_0  | BridgeConfigV3.Pool | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(string tokenID, uint256 chainID) external view returns (struct BridgeConfigV3.Token token)
```

Returns the full token config struct

#### Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| tokenID | string  | String input of the token ID for the token      |
| chainID | uint256 | Chain ID of which token address + config to get |

#### Returns

| Name  | Type                 | Description |
| ----- | -------------------- | ----------- |
| token | BridgeConfigV3.Token | undefined   |

### getTokenByAddress

```solidity
function getTokenByAddress(string tokenAddress, uint256 chainID) external view returns (struct BridgeConfigV3.Token token)
```

Returns token config struct, given an address and chainID

#### Parameters

| Name         | Type    | Description                                                 |
| ------------ | ------- | ----------------------------------------------------------- |
| tokenAddress | string  | Matches the token ID by using a combo of address + chain ID |
| chainID      | uint256 | Chain ID of which token to get config for                   |

#### Returns

| Name  | Type                 | Description |
| ----- | -------------------- | ----------- |
| token | BridgeConfigV3.Token | undefined   |

### getTokenByEVMAddress

```solidity
function getTokenByEVMAddress(address tokenAddress, uint256 chainID) external view returns (struct BridgeConfigV3.Token token)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |
| chainID      | uint256 | undefined   |

#### Returns

| Name  | Type                 | Description |
| ----- | -------------------- | ----------- |
| token | BridgeConfigV3.Token | undefined   |

### getTokenByID

```solidity
function getTokenByID(string tokenID, uint256 chainID) external view returns (struct BridgeConfigV3.Token token)
```

Returns the full token config struct

#### Parameters

| Name    | Type    | Description                                     |
| ------- | ------- | ----------------------------------------------- |
| tokenID | string  | String input of the token ID for the token      |
| chainID | uint256 | Chain ID of which token address + config to get |

#### Returns

| Name  | Type                 | Description |
| ----- | -------------------- | ----------- |
| token | BridgeConfigV3.Token | undefined   |

### getTokenID

```solidity
function getTokenID(address tokenAddress, uint256 chainID) external view returns (string)
```

Returns the token ID (string) of the cross-chain token inputted

#### Parameters

| Name         | Type    | Description                          |
| ------------ | ------- | ------------------------------------ |
| tokenAddress | address | address of token to get ID for       |
| chainID      | uint256 | chainID of which to get token ID for |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### getTokenID

```solidity
function getTokenID(string tokenAddress, uint256 chainID) external view returns (string)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | string  | undefined   |
| chainID      | uint256 | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### getUnderlyingToken

```solidity
function getUnderlyingToken(string tokenID) external view returns (struct BridgeConfigV3.Token token)
```

Returns which token is the underlying token to withdraw

#### Parameters

| Name    | Type   | Description     |
| ------- | ------ | --------------- |
| tokenID | string | string token ID |

#### Returns

| Name  | Type                 | Description |
| ----- | -------------------- | ----------- |
| token | BridgeConfigV3.Token | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### hasUnderlyingToken

```solidity
function hasUnderlyingToken(string tokenID) external view returns (bool)
```

Returns true if the token has an underlying token -- meaning the token is deposited into the bridge

#### Parameters

| Name    | Type   | Description                                          |
| ------- | ------ | ---------------------------------------------------- |
| tokenID | string | String to check if it is a withdraw/underlying token |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### isTokenIDExist

```solidity
function isTokenIDExist(string tokenID) external view returns (bool)
```

Public function returning if token ID exists given a string

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| tokenID | string | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setMaxGasPrice

```solidity
function setMaxGasPrice(uint256 chainID, uint256 maxPrice) external nonpayable
```

sets the max gas price for a chain

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| chainID  | uint256 | undefined   |
| maxPrice | uint256 | undefined   |

### setPoolConfig

```solidity
function setPoolConfig(address tokenAddress, uint256 chainID, address poolAddress, bool metaswap) external nonpayable returns (struct BridgeConfigV3.Pool)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |
| chainID      | uint256 | undefined   |
| poolAddress  | address | undefined   |
| metaswap     | bool    | undefined   |

#### Returns

| Name | Type                | Description |
| ---- | ------------------- | ----------- |
| \_0  | BridgeConfigV3.Pool | undefined   |

### setTokenConfig

```solidity
function setTokenConfig(string tokenID, uint256 chainID, address tokenAddress, uint8 tokenDecimals, uint256 maxSwap, uint256 minSwap, uint256 swapFee, uint256 maxSwapFee, uint256 minSwapFee, bool hasUnderlying, bool isUnderlying) external nonpayable returns (bool)
```

Main write function of this contract - Handles creating the struct and passing it to the internal logic function

#### Parameters

| Name          | Type    | Description                                                                               |
| ------------- | ------- | ----------------------------------------------------------------------------------------- |
| tokenID       | string  | string ID to set the token config object form                                             |
| chainID       | uint256 | chain ID to use for the token config object                                               |
| tokenAddress  | address | token address of the token on the given chain                                             |
| tokenDecimals | uint8   | decimals of token                                                                         |
| maxSwap       | uint256 | maximum amount of token allowed to be transferred at once - in native token decimals      |
| minSwap       | uint256 | minimum amount of token needed to be transferred at once - in native token decimals       |
| swapFee       | uint256 | percent based swap fee -- 10e6 == 10bps                                                   |
| maxSwapFee    | uint256 | max swap fee to be charged - in native token decimals                                     |
| minSwapFee    | uint256 | min swap fee to be charged - in native token decimals - especially useful for mainnet ETH |
| hasUnderlying | bool    | bool which represents whether this is a global mint token or one to withdraw()            |
| isUnderlying  | bool    | bool which represents if this token is the one to withdraw on the given chain             |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### setTokenConfig

```solidity
function setTokenConfig(string tokenID, uint256 chainID, string tokenAddress, uint8 tokenDecimals, uint256 maxSwap, uint256 minSwap, uint256 swapFee, uint256 maxSwapFee, uint256 minSwapFee, bool hasUnderlying, bool isUnderlying) external nonpayable returns (bool)
```

Main write function of this contract - Handles creating the struct and passing it to the internal logic function

#### Parameters

| Name          | Type    | Description                                                                               |
| ------------- | ------- | ----------------------------------------------------------------------------------------- |
| tokenID       | string  | string ID to set the token config object form                                             |
| chainID       | uint256 | chain ID to use for the token config object                                               |
| tokenAddress  | string  | token address of the token on the given chain                                             |
| tokenDecimals | uint8   | decimals of token                                                                         |
| maxSwap       | uint256 | maximum amount of token allowed to be transferred at once - in native token decimals      |
| minSwap       | uint256 | minimum amount of token needed to be transferred at once - in native token decimals       |
| swapFee       | uint256 | percent based swap fee -- 10e6 == 10bps                                                   |
| maxSwapFee    | uint256 | max swap fee to be charged - in native token decimals                                     |
| minSwapFee    | uint256 | min swap fee to be charged - in native token decimals - especially useful for mainnet ETH |
| hasUnderlying | bool    | bool which represents whether this is a global mint token or one to withdraw()            |
| isUnderlying  | bool    | bool which represents if this token is the one to withdraw on the given chain             |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |


# ECDSAFactory

## Methods

### deploy

```solidity
function deploy(address nodeMgmtAddress, address owner, address[] members, uint256 honestThreshold) external nonpayable returns (address)
```

Deploys a new node

#### Parameters

| Name            | Type       | Description                                                                                       |
| --------------- | ---------- | ------------------------------------------------------------------------------------------------- |
| nodeMgmtAddress | address    | address of the ECDSANodeManagement contract to initialize with                                    |
| owner           | address    | Owner of the ECDSANodeManagement contract who can determine if the node group is closed or active |
| members         | address\[] | Array of node group members addresses                                                             |
| honestThreshold | uint256    | Number of signers to process a transaction                                                        |

#### Returns

| Name | Type    | Description                                              |
| ---- | ------- | -------------------------------------------------------- |
| \_0  | address | Address of the newest node management contract created\* |

### getMembers

```solidity
function getMembers() external view returns (address[])
```

Returns members of the keep.

#### Returns

| Name | Type       | Description                          |
| ---- | ---------- | ------------------------------------ |
| \_0  | address\[] | List of the keep members' addresses. |

### latestNodeGroup

```solidity
function latestNodeGroup() external view returns (address keepAddress, address owner, uint256 honestThreshold)
```

#### Returns

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| keepAddress     | address | undefined   |
| owner           | address | undefined   |
| honestThreshold | uint256 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### ECDSANodeGroupCreated

```solidity
event ECDSANodeGroupCreated(address indexed keepAddress, address[] members, address indexed owner, uint256 honestThreshold)
```

#### Parameters

| Name                  | Type       | Description |
| --------------------- | ---------- | ----------- |
| keepAddress `indexed` | address    | undefined   |
| members               | address\[] | undefined   |
| owner `indexed`       | address    | undefined   |
| honestThreshold       | uint256    | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# ECDSANodeManagement

## Methods

### closeKeep

```solidity
function closeKeep() external nonpayable
```

Closes keep when owner decides that they no longer need it. Releases bonds to the keep members.

*The function can be called only by the owner of the keep and only if the keep has not been already closed.*

### getMembers

```solidity
function getMembers() external view returns (address[])
```

Returns members of the keep.

#### Returns

| Name | Type       | Description                          |
| ---- | ---------- | ------------------------------------ |
| \_0  | address\[] | List of the keep members' addresses. |

### getOpenedTimestamp

```solidity
function getOpenedTimestamp() external view returns (uint256)
```

Gets the timestamp the keep was opened at.

#### Returns

| Name | Type    | Description                       |
| ---- | ------- | --------------------------------- |
| \_0  | uint256 | Timestamp the keep was opened at. |

### getOwner

```solidity
function getOwner() external view returns (address)
```

Gets the owner of the keep.

#### Returns

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| \_0  | address | Address of the keep owner. |

### getPublicKey

```solidity
function getPublicKey() external view returns (bytes)
```

Returns keep's ECDSA public key.

#### Returns

| Name | Type  | Description              |
| ---- | ----- | ------------------------ |
| \_0  | bytes | Keep's ECDSA public key. |

### honestThreshold

```solidity
function honestThreshold() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initialize

```solidity
function initialize(address _owner, address[] _members, uint256 _honestThreshold) external nonpayable
```

Initialization function.

*We use clone factory to create new keep. That is why this contract doesn't have a constructor. We provide keep parameters for each instance function after cloning instances from the master contract. Initialization must happen in the same transaction in which the clone is created.*

#### Parameters

| Name              | Type       | Description                            |
| ----------------- | ---------- | -------------------------------------- |
| \_owner           | address    | Address of the keep owner.             |
| \_members         | address\[] | Addresses of the keep members.         |
| \_honestThreshold | uint256    | Minimum number of honest keep members. |

### isActive

```solidity
function isActive() external view returns (bool)
```

Returns true if the keep is active.

#### Returns

| Name | Type | Description                                  |
| ---- | ---- | -------------------------------------------- |
| \_0  | bool | true if the keep is active, false otherwise. |

### isClosed

```solidity
function isClosed() external view returns (bool)
```

Returns true if the keep is closed and members no longer support this keep.

#### Returns

| Name | Type | Description                                  |
| ---- | ---- | -------------------------------------------- |
| \_0  | bool | true if the keep is closed, false otherwise. |

### isTerminated

```solidity
function isTerminated() external view returns (bool)
```

Returns true if the keep has been terminated. Keep is terminated when bonds are seized and members no longer support this keep.

#### Returns

| Name | Type | Description                                            |
| ---- | ---- | ------------------------------------------------------ |
| \_0  | bool | true if the keep has been terminated, false otherwise. |

### members

```solidity
function members(uint256) external view returns (address)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### publicKey

```solidity
function publicKey() external view returns (bytes)
```

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | bytes | undefined   |

### submitPublicKey

```solidity
function submitPublicKey(bytes _publicKey) external nonpayable
```

Submits a public key to the keep.

*Public key is published successfully if all members submit the same value. In case of conflicts with others members submissions it will emit `ConflictingPublicKeySubmitted` event. When all submitted keys match it will store the key as keep's public key and emit a `PublicKeyPublished` event.*

#### Parameters

| Name        | Type  | Description          |
| ----------- | ----- | -------------------- |
| \_publicKey | bytes | Signer's public key. |

## Events

### ConflictingPublicKeySubmitted

```solidity
event ConflictingPublicKeySubmitted(address indexed submittingMember, bytes conflictingPublicKey)
```

#### Parameters

| Name                       | Type    | Description |
| -------------------------- | ------- | ----------- |
| submittingMember `indexed` | address | undefined   |
| conflictingPublicKey       | bytes   | undefined   |

### KeepClosed

```solidity
event KeepClosed()
```

### KeepTerminated

```solidity
event KeepTerminated()
```

### PublicKeyPublished

```solidity
event PublicKeyPublished(bytes publicKey)
```

#### Parameters

| Name      | Type  | Description |
| --------- | ----- | ----------- |
| publicKey | bytes | undefined   |


# ERC20Migrator

## Methods

### legacyToken

```solidity
function legacyToken() external view returns (contract IERC20)
```

*Returns the legacy token that is being migrated.*

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### migrate

```solidity
function migrate(uint256 amount) external nonpayable
```

*Transfers part of an account's balance in the old token to this contract, and mints the same amount of new tokens for that account.*

#### Parameters

| Name   | Type    | Description                     |
| ------ | ------- | ------------------------------- |
| amount | uint256 | amount of tokens to be migrated |

### newToken

```solidity
function newToken() external view returns (contract IERC20)
```

*Returns the new token to which we are migrating.*

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |


# HarmonySynapseBridge

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### GOVERNANCE\_ROLE

```solidity
function GOVERNANCE_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### NODEGROUP\_ROLE

```solidity
function NODEGROUP_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### addKappas

```solidity
function addKappas(bytes32[] kappas) external nonpayable
```

#### Parameters

| Name   | Type       | Description |
| ------ | ---------- | ----------- |
| kappas | bytes32\[] | undefined   |

### bridgeVersion

```solidity
function bridgeVersion() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### chainGasAmount

```solidity
function chainGasAmount() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Relays to nodes to transfers an ERC20 token cross-chain

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositAndSwap

```solidity
function depositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes to both transfer an ERC20 token cross-chain, and then have the nodes execute a swap through a liquidity pool on behalf of the user.

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to bridge assets to                                                              |
| chainId        | uint256         | which chain to bridge assets onto                                                                       |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### getFeeBalance

```solidity
function getFeeBalance(address tokenAddress) external view returns (uint256)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize() external nonpayable
```

### kappaExists

```solidity
function kappaExists(bytes32 kappa) external view returns (bool)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| kappa | bytes32 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to). This is called by the nodes after a TokenDeposit event is emitted.

*This means the SynapseBridge.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name   | Type                    | Description                                                       |
| ------ | ----------------------- | ----------------------------------------------------------------- |
| to     | address payable         | address on other chain to redeem underlying assets to             |
| token  | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                 |
| amount | uint256                 | Amount in native token decimals to transfer cross-chain post-fees |
| fee    | uint256                 | Amount in native token decimals to save to the contract as fees   |
| kappa  | bytes32                 | kappa\*                                                           |

### mintAndSwap

```solidity
function mintAndSwap(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, contract ISwap pool, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to), and then attempt to swap the SynERC20 into the desired destination asset. This is called by the nodes after a TokenDepositAndSwap event is emitted.

*This means the BridgeDeposit.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name           | Type                    | Description                                                                                                      |
| -------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| to             | address payable         | address on other chain to redeem underlying assets to                                                            |
| token          | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                                                                |
| amount         | uint256                 | Amount in native token decimals to transfer cross-chain post-fees                                                |
| fee            | uint256                 | Amount in native token decimals to save to the contract as fees                                                  |
| pool           | contract ISwap          | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol.     |
| tokenIndexFrom | uint8                   | Index of the SynERC20 asset in the pool                                                                          |
| tokenIndexTo   | uint8                   | Index of the desired final asset                                                                                 |
| minDy          | uint256                 | Minumum amount (in final asset decimals) that must be swapped for, otherwise the user will receive the SynERC20. |
| deadline       | uint256                 | Epoch time of the deadline that the swap is allowed to be executed.                                              |
| kappa          | bytes32                 | kappa\*                                                                                                          |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | address                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                          |
| -------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                         |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                    |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                     |
| swapTokenIndex | uint8                  | Specifies which of the underlying LP assets the nodes should attempt to redeem for                   |
| swapMinAmount  | uint256                | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap |
| swapDeadline   | uint256                | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*             |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                             |
| -------------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                            |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8                  | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8                  | the token the user wants to swap to                                                                     |
| minDy          | uint256                | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256                | latest timestamp to accept this transaction\*                                                           |

### redeemV2

```solidity
function redeemV2(bytes32 to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | bytes32                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setChainGasAmount

```solidity
function setChainGasAmount(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### setWethAddress

```solidity
function setWethAddress(address payable _wethAddress) external nonpayable
```

#### Parameters

| Name          | Type            | Description |
| ------------- | --------------- | ----------- |
| \_wethAddress | address payable | undefined   |

### startBlockNumber

```solidity
function startBlockNumber() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### withdraw

```solidity
function withdraw(address to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name   | Type            | Description                                                     |
| ------ | --------------- | --------------------------------------------------------------- |
| to     | address         | address on chain to send underlying assets to                   |
| token  | contract IERC20 | ERC20 compatible token to withdraw from the bridge              |
| amount | uint256         | Amount in native token decimals to withdraw                     |
| fee    | uint256         | Amount in native token decimals to save to the contract as fees |
| kappa  | bytes32         | kappa\*                                                         |

### withdrawAndRemove

```solidity
function withdrawAndRemove(address to, contract IERC20 token, uint256 amount, uint256 fee, contract ISwap pool, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name           | Type            | Description                                                                                                  |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| to             | address         | address on chain to send underlying assets to                                                                |
| token          | contract IERC20 | ERC20 compatible token to withdraw from the bridge                                                           |
| amount         | uint256         | Amount in native token decimals to withdraw                                                                  |
| fee            | uint256         | Amount in native token decimals to save to the contract as fees                                              |
| pool           | contract ISwap  | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol. |
| swapTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                           |
| swapMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap         |
| swapDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token                       |
| kappa          | bytes32         | kappa\*                                                                                                      |

### withdrawFees

```solidity
function withdrawFees(contract IERC20 token, address to) external nonpayable
```

withdraw specified ERC20 token fees to a given address

#### Parameters

| Name  | Type            | Description                                        |
| ----- | --------------- | -------------------------------------------------- |
| token | contract IERC20 | ERC20 token in which fees acccumulated to transfer |
| to    | address         | Address to send the fees to                        |

## Events

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### TokenDeposit

```solidity
event TokenDeposit(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenDepositAndSwap

```solidity
event TokenDepositAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenMint

```solidity
event TokenMint(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenMintAndSwap

```solidity
event TokenMintAndSwap(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| tokenIndexFrom  | uint8                   | undefined   |
| tokenIndexTo    | uint8                   | undefined   |
| minDy           | uint256                 | undefined   |
| deadline        | uint256                 | undefined   |
| swapSuccess     | bool                    | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenRedeem

```solidity
event TokenRedeem(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenRedeemAndRemove

```solidity
event TokenRedeemAndRemove(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| swapTokenIndex | uint8           | undefined   |
| swapMinAmount  | uint256         | undefined   |
| swapDeadline   | uint256         | undefined   |

### TokenRedeemAndSwap

```solidity
event TokenRedeemAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenRedeemV2

```solidity
event TokenRedeemV2(bytes32 indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | bytes32         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenWithdraw

```solidity
event TokenWithdraw(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### TokenWithdrawAndRemove

```solidity
event TokenWithdrawAndRemove(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| swapTokenIndex  | uint8           | undefined   |
| swapMinAmount   | uint256         | undefined   |
| swapDeadline    | uint256         | undefined   |
| swapSuccess     | bool            | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# IERC20Mintable

## Methods

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: <https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729> Emits an {Approval} event.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*Returns the amount of tokens owned by `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*Returns the amount of tokens in existence.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# IFrax

## Methods

### exchangeOldForCanonical

```solidity
function exchangeOldForCanonical(address bridge_token_address, uint256 token_amount) external nonpayable returns (uint256)
```

#### Parameters

| Name                   | Type    | Description |
| ---------------------- | ------- | ----------- |
| bridge\_token\_address | address | undefined   |
| token\_amount          | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# MRSynapseBridge

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### GOVERNANCE\_ROLE

```solidity
function GOVERNANCE_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### NODEGROUP\_ROLE

```solidity
function NODEGROUP_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### addKappas

```solidity
function addKappas(bytes32[] kappas) external nonpayable
```

#### Parameters

| Name   | Type       | Description |
| ------ | ---------- | ----------- |
| kappas | bytes32\[] | undefined   |

### bridgeVersion

```solidity
function bridgeVersion() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### chainGasAmount

```solidity
function chainGasAmount() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Relays to nodes to transfers an ERC20 token cross-chain

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositAndSwap

```solidity
function depositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes to both transfer an ERC20 token cross-chain, and then have the nodes execute a swap through a liquidity pool on behalf of the user.

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to bridge assets to                                                              |
| chainId        | uint256         | which chain to bridge assets onto                                                                       |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### getFeeBalance

```solidity
function getFeeBalance(address tokenAddress) external view returns (uint256)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize() external nonpayable
```

### kappaExists

```solidity
function kappaExists(bytes32 kappa) external view returns (bool)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| kappa | bytes32 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to). This is called by the nodes after a TokenDeposit event is emitted.

*This means the SynapseBridge.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name   | Type                    | Description                                                       |
| ------ | ----------------------- | ----------------------------------------------------------------- |
| to     | address payable         | address on other chain to redeem underlying assets to             |
| token  | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                 |
| amount | uint256                 | Amount in native token decimals to transfer cross-chain post-fees |
| fee    | uint256                 | Amount in native token decimals to save to the contract as fees   |
| kappa  | bytes32                 | kappa\*                                                           |

### mintAndSwap

```solidity
function mintAndSwap(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, contract ISwap pool, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to), and then attempt to swap the SynERC20 into the desired destination asset. This is called by the nodes after a TokenDepositAndSwap event is emitted.

*This means the BridgeDeposit.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name           | Type                    | Description                                                                                                      |
| -------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| to             | address payable         | address on other chain to redeem underlying assets to                                                            |
| token          | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                                                                |
| amount         | uint256                 | Amount in native token decimals to transfer cross-chain post-fees                                                |
| fee            | uint256                 | Amount in native token decimals to save to the contract as fees                                                  |
| pool           | contract ISwap          | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol.     |
| tokenIndexFrom | uint8                   | Index of the SynERC20 asset in the pool                                                                          |
| tokenIndexTo   | uint8                   | Index of the desired final asset                                                                                 |
| minDy          | uint256                 | Minumum amount (in final asset decimals) that must be swapped for, otherwise the user will receive the SynERC20. |
| deadline       | uint256                 | Epoch time of the deadline that the swap is allowed to be executed.                                              |
| kappa          | bytes32                 | kappa\*                                                                                                          |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | address                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                          |
| -------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                         |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                    |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                     |
| swapTokenIndex | uint8                  | Specifies which of the underlying LP assets the nodes should attempt to redeem for                   |
| swapMinAmount  | uint256                | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap |
| swapDeadline   | uint256                | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*             |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                             |
| -------------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                            |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8                  | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8                  | the token the user wants to swap to                                                                     |
| minDy          | uint256                | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256                | latest timestamp to accept this transaction\*                                                           |

### redeemV2

```solidity
function redeemV2(bytes32 to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | bytes32                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setChainGasAmount

```solidity
function setChainGasAmount(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### setWethAddress

```solidity
function setWethAddress(address payable _wethAddress) external nonpayable
```

#### Parameters

| Name          | Type            | Description |
| ------------- | --------------- | ----------- |
| \_wethAddress | address payable | undefined   |

### startBlockNumber

```solidity
function startBlockNumber() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### withdraw

```solidity
function withdraw(address to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name   | Type            | Description                                                     |
| ------ | --------------- | --------------------------------------------------------------- |
| to     | address         | address on chain to send underlying assets to                   |
| token  | contract IERC20 | ERC20 compatible token to withdraw from the bridge              |
| amount | uint256         | Amount in native token decimals to withdraw                     |
| fee    | uint256         | Amount in native token decimals to save to the contract as fees |
| kappa  | bytes32         | kappa\*                                                         |

### withdrawAndRemove

```solidity
function withdrawAndRemove(address to, contract IERC20 token, uint256 amount, uint256 fee, contract ISwap pool, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name           | Type            | Description                                                                                                  |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| to             | address         | address on chain to send underlying assets to                                                                |
| token          | contract IERC20 | ERC20 compatible token to withdraw from the bridge                                                           |
| amount         | uint256         | Amount in native token decimals to withdraw                                                                  |
| fee            | uint256         | Amount in native token decimals to save to the contract as fees                                              |
| pool           | contract ISwap  | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol. |
| swapTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                           |
| swapMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap         |
| swapDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token                       |
| kappa          | bytes32         | kappa\*                                                                                                      |

### withdrawFees

```solidity
function withdrawFees(contract IERC20 token, address to) external nonpayable
```

withdraw specified ERC20 token fees to a given address

#### Parameters

| Name  | Type            | Description                                        |
| ----- | --------------- | -------------------------------------------------- |
| token | contract IERC20 | ERC20 token in which fees acccumulated to transfer |
| to    | address         | Address to send the fees to                        |

## Events

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### TokenDeposit

```solidity
event TokenDeposit(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenDepositAndSwap

```solidity
event TokenDepositAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenMint

```solidity
event TokenMint(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenMintAndSwap

```solidity
event TokenMintAndSwap(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| tokenIndexFrom  | uint8                   | undefined   |
| tokenIndexTo    | uint8                   | undefined   |
| minDy           | uint256                 | undefined   |
| deadline        | uint256                 | undefined   |
| swapSuccess     | bool                    | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenRedeem

```solidity
event TokenRedeem(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenRedeemAndRemove

```solidity
event TokenRedeemAndRemove(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| swapTokenIndex | uint8           | undefined   |
| swapMinAmount  | uint256         | undefined   |
| swapDeadline   | uint256         | undefined   |

### TokenRedeemAndSwap

```solidity
event TokenRedeemAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenRedeemV2

```solidity
event TokenRedeemV2(bytes32 indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | bytes32         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenWithdraw

```solidity
event TokenWithdraw(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### TokenWithdrawAndRemove

```solidity
event TokenWithdrawAndRemove(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| swapTokenIndex  | uint8           | undefined   |
| swapMinAmount   | uint256         | undefined   |
| swapDeadline    | uint256         | undefined   |
| swapSuccess     | bool            | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# MiniChefV2

The (older) MasterChef contract gives out a constant number of SYNAPSE tokens per block. It is the only address with minting rights for SYNAPSE. The idea for this MasterChef V2 (MCV2) contract is therefore to be the owner of a dummy token that is deposited into the MasterChef V1 (MCV1) contract. The allocation point for this pool on MCV1 is the total allocation point for all pools that receive double incentives.

## Methods

### SYNAPSE

```solidity
function SYNAPSE() external view returns (contract IERC20)
```

Address of SYNAPSE contract.

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### add

```solidity
function add(uint256 allocPoint, contract IERC20 _lpToken, contract IRewarder _rewarder) external nonpayable
```

Add a new LP to the pool. Can only be called by the owner. DO NOT add the same LP token more than once. Rewards will be messed up if you do.

#### Parameters

| Name       | Type               | Description                       |
| ---------- | ------------------ | --------------------------------- |
| allocPoint | uint256            | AP of the new pool.               |
| \_lpToken  | contract IERC20    | Address of the LP ERC-20 token.   |
| \_rewarder | contract IRewarder | Address of the rewarder delegate. |

### batch

```solidity
function batch(bytes[] calls, bool revertOnFail) external payable returns (bool[] successes, bytes[] results)
```

#### Parameters

| Name         | Type     | Description |
| ------------ | -------- | ----------- |
| calls        | bytes\[] | undefined   |
| revertOnFail | bool     | undefined   |

#### Returns

| Name      | Type     | Description |
| --------- | -------- | ----------- |
| successes | bool\[]  | undefined   |
| results   | bytes\[] | undefined   |

### claimOwnership

```solidity
function claimOwnership() external nonpayable
```

### deposit

```solidity
function deposit(uint256 pid, uint256 amount, address to) external nonpayable
```

Deposit LP tokens to MCV2 for SYNAPSE allocation.

#### Parameters

| Name   | Type    | Description                               |
| ------ | ------- | ----------------------------------------- |
| pid    | uint256 | The index of the pool. See `poolInfo`.    |
| amount | uint256 | LP token amount to deposit.               |
| to     | address | The receiver of `amount` deposit benefit. |

### emergencyWithdraw

```solidity
function emergencyWithdraw(uint256 pid, address to) external nonpayable
```

Withdraw without caring about rewards. EMERGENCY ONLY.

#### Parameters

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| pid  | uint256 | The index of the pool. See `poolInfo`. |
| to   | address | Receiver of the LP tokens.             |

### harvest

```solidity
function harvest(uint256 pid, address to) external nonpayable
```

Harvest proceeds for transaction sender to `to`.

#### Parameters

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| pid  | uint256 | The index of the pool. See `poolInfo`. |
| to   | address | Receiver of SYNAPSE rewards.           |

### lpToken

```solidity
function lpToken(uint256) external view returns (contract IERC20)
```

Address of the LP token for each MCV2 pool.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### massUpdatePools

```solidity
function massUpdatePools(uint256[] pids) external nonpayable
```

Update reward variables for all pools. Be careful of gas spending!

#### Parameters

| Name | Type       | Description                                                          |
| ---- | ---------- | -------------------------------------------------------------------- |
| pids | uint256\[] | Pool IDs of all to be updated. Make sure to update all active pools. |

### owner

```solidity
function owner() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pendingOwner

```solidity
function pendingOwner() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pendingSynapse

```solidity
function pendingSynapse(uint256 _pid, address _user) external view returns (uint256 pending)
```

View function to see pending SYNAPSE on frontend.

#### Parameters

| Name   | Type    | Description                            |
| ------ | ------- | -------------------------------------- |
| \_pid  | uint256 | The index of the pool. See `poolInfo`. |
| \_user | address | Address of user.                       |

#### Returns

| Name    | Type    | Description                      |
| ------- | ------- | -------------------------------- |
| pending | uint256 | SYNAPSE reward for a given user. |

### permitToken

```solidity
function permitToken(contract IERC20 token, address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
```

#### Parameters

| Name     | Type            | Description |
| -------- | --------------- | ----------- |
| token    | contract IERC20 | undefined   |
| from     | address         | undefined   |
| to       | address         | undefined   |
| amount   | uint256         | undefined   |
| deadline | uint256         | undefined   |
| v        | uint8           | undefined   |
| r        | bytes32         | undefined   |
| s        | bytes32         | undefined   |

### poolInfo

```solidity
function poolInfo(uint256) external view returns (uint128 accSynapsePerShare, uint64 lastRewardTime, uint64 allocPoint)
```

Info of each MCV2 pool.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| accSynapsePerShare | uint128 | undefined   |
| lastRewardTime     | uint64  | undefined   |
| allocPoint         | uint64  | undefined   |

### poolLength

```solidity
function poolLength() external view returns (uint256 pools)
```

Returns the number of MCV2 pools.

#### Returns

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| pools | uint256 | undefined   |

### rewarder

```solidity
function rewarder(uint256) external view returns (contract IRewarder)
```

Address of each `IRewarder` contract in MCV2.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type               | Description |
| ---- | ------------------ | ----------- |
| \_0  | contract IRewarder | undefined   |

### set

```solidity
function set(uint256 _pid, uint256 _allocPoint, contract IRewarder _rewarder, bool overwrite) external nonpayable
```

Update the given pool's SYNAPSE allocation point and `IRewarder` contract. Can only be called by the owner.

#### Parameters

| Name         | Type               | Description                                                           |
| ------------ | ------------------ | --------------------------------------------------------------------- |
| \_pid        | uint256            | The index of the pool. See `poolInfo`.                                |
| \_allocPoint | uint256            | New AP of the pool.                                                   |
| \_rewarder   | contract IRewarder | Address of the rewarder delegate.                                     |
| overwrite    | bool               | True if \_rewarder should be `set`. Otherwise `_rewarder` is ignored. |

### setSynapsePerSecond

```solidity
function setSynapsePerSecond(uint256 _synapsePerSecond) external nonpayable
```

Sets the synapse per second to be distributed. Can only be called by the owner.

#### Parameters

| Name               | Type    | Description                                         |
| ------------------ | ------- | --------------------------------------------------- |
| \_synapsePerSecond | uint256 | The amount of Synapse to be distributed per second. |

### synapsePerSecond

```solidity
function synapsePerSecond() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### totalAllocPoint

```solidity
function totalAllocPoint() external view returns (uint256)
```

*Total allocation points. Must be the sum of all allocation points in all pools.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner, bool direct, bool renounce) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |
| direct   | bool    | undefined   |
| renounce | bool    | undefined   |

### updatePool

```solidity
function updatePool(uint256 pid) external nonpayable returns (struct MiniChefV2.PoolInfo pool)
```

Update reward variables of the given pool.

#### Parameters

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| pid  | uint256 | The index of the pool. See `poolInfo`. |

#### Returns

| Name | Type                | Description                        |
| ---- | ------------------- | ---------------------------------- |
| pool | MiniChefV2.PoolInfo | Returns the pool that was updated. |

### userInfo

```solidity
function userInfo(uint256, address) external view returns (uint256 amount, int256 rewardDebt)
```

Info of each user that stakes LP tokens.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |
| \_1  | address | undefined   |

#### Returns

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| amount     | uint256 | undefined   |
| rewardDebt | int256  | undefined   |

### withdraw

```solidity
function withdraw(uint256 pid, uint256 amount, address to) external nonpayable
```

Withdraw LP tokens from MCV2.

#### Parameters

| Name   | Type    | Description                            |
| ------ | ------- | -------------------------------------- |
| pid    | uint256 | The index of the pool. See `poolInfo`. |
| amount | uint256 | LP token amount to withdraw.           |
| to     | address | Receiver of the LP tokens.             |

### withdrawAndHarvest

```solidity
function withdrawAndHarvest(uint256 pid, uint256 amount, address to) external nonpayable
```

Withdraw LP tokens from MCV2 and harvest proceeds for transaction sender to `to`.

#### Parameters

| Name   | Type    | Description                                    |
| ------ | ------- | ---------------------------------------------- |
| pid    | uint256 | The index of the pool. See `poolInfo`.         |
| amount | uint256 | LP token amount to withdraw.                   |
| to     | address | Receiver of the LP tokens and SYNAPSE rewards. |

## Events

### Deposit

```solidity
event Deposit(address indexed user, uint256 indexed pid, uint256 amount, address indexed to)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| user `indexed` | address | undefined   |
| pid `indexed`  | uint256 | undefined   |
| amount         | uint256 | undefined   |
| to `indexed`   | address | undefined   |

### EmergencyWithdraw

```solidity
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount, address indexed to)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| user `indexed` | address | undefined   |
| pid `indexed`  | uint256 | undefined   |
| amount         | uint256 | undefined   |
| to `indexed`   | address | undefined   |

### Harvest

```solidity
event Harvest(address indexed user, uint256 indexed pid, uint256 amount)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| user `indexed` | address | undefined   |
| pid `indexed`  | uint256 | undefined   |
| amount         | uint256 | undefined   |

### LogPoolAddition

```solidity
event LogPoolAddition(uint256 indexed pid, uint256 allocPoint, contract IERC20 indexed lpToken, contract IRewarder indexed rewarder)
```

#### Parameters

| Name               | Type               | Description |
| ------------------ | ------------------ | ----------- |
| pid `indexed`      | uint256            | undefined   |
| allocPoint         | uint256            | undefined   |
| lpToken `indexed`  | contract IERC20    | undefined   |
| rewarder `indexed` | contract IRewarder | undefined   |

### LogSetPool

```solidity
event LogSetPool(uint256 indexed pid, uint256 allocPoint, contract IRewarder indexed rewarder, bool overwrite)
```

#### Parameters

| Name               | Type               | Description |
| ------------------ | ------------------ | ----------- |
| pid `indexed`      | uint256            | undefined   |
| allocPoint         | uint256            | undefined   |
| rewarder `indexed` | contract IRewarder | undefined   |
| overwrite          | bool               | undefined   |

### LogSynapsePerSecond

```solidity
event LogSynapsePerSecond(uint256 synapsePerSecond)
```

#### Parameters

| Name             | Type    | Description |
| ---------------- | ------- | ----------- |
| synapsePerSecond | uint256 | undefined   |

### LogUpdatePool

```solidity
event LogUpdatePool(uint256 indexed pid, uint64 lastRewardTime, uint256 lpSupply, uint256 accSynapsePerShare)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| pid `indexed`      | uint256 | undefined   |
| lastRewardTime     | uint64  | undefined   |
| lpSupply           | uint256 | undefined   |
| accSynapsePerShare | uint256 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### Withdraw

```solidity
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount, address indexed to)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| user `indexed` | address | undefined   |
| pid `indexed`  | uint256 | undefined   |
| amount         | uint256 | undefined   |
| to `indexed`   | address | undefined   |


# PoolConfig

## Methods

### BRIDGEMANAGER\_ROLE

```solidity
function BRIDGEMANAGER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getPoolConfig

```solidity
function getPoolConfig(address tokenAddress, uint256 chainID) external view returns (struct PoolConfig.Pool)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |
| chainID      | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | PoolConfig.Pool | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setPoolConfig

```solidity
function setPoolConfig(address tokenAddress, uint256 chainID, address poolAddress, bool metaswap) external nonpayable returns (struct PoolConfig.Pool)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |
| chainID      | uint256 | undefined   |
| poolAddress  | address | undefined   |
| metaswap     | bool    | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | PoolConfig.Pool | undefined   |

## Events

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |


# SynapseBridge

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### GOVERNANCE\_ROLE

```solidity
function GOVERNANCE_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### NODEGROUP\_ROLE

```solidity
function NODEGROUP_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### addKappas

```solidity
function addKappas(bytes32[] kappas) external nonpayable
```

#### Parameters

| Name   | Type       | Description |
| ------ | ---------- | ----------- |
| kappas | bytes32\[] | undefined   |

### bridgeVersion

```solidity
function bridgeVersion() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### chainGasAmount

```solidity
function chainGasAmount() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Relays to nodes to transfers an ERC20 token cross-chain

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositAndSwap

```solidity
function depositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes to both transfer an ERC20 token cross-chain, and then have the nodes execute a swap through a liquidity pool on behalf of the user.

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to bridge assets to                                                              |
| chainId        | uint256         | which chain to bridge assets onto                                                                       |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### getFeeBalance

```solidity
function getFeeBalance(address tokenAddress) external view returns (uint256)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize() external nonpayable
```

### kappaExists

```solidity
function kappaExists(bytes32 kappa) external view returns (bool)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| kappa | bytes32 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to). This is called by the nodes after a TokenDeposit event is emitted.

*This means the SynapseBridge.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name   | Type                    | Description                                                       |
| ------ | ----------------------- | ----------------------------------------------------------------- |
| to     | address payable         | address on other chain to redeem underlying assets to             |
| token  | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                 |
| amount | uint256                 | Amount in native token decimals to transfer cross-chain post-fees |
| fee    | uint256                 | Amount in native token decimals to save to the contract as fees   |
| kappa  | bytes32                 | kappa\*                                                           |

### mintAndSwap

```solidity
function mintAndSwap(address payable to, contract IERC20Mintable token, uint256 amount, uint256 fee, contract ISwap pool, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bytes32 kappa) external nonpayable
```

Nodes call this function to mint a SynERC20 (or any asset that the bridge is given minter access to), and then attempt to swap the SynERC20 into the desired destination asset. This is called by the nodes after a TokenDepositAndSwap event is emitted.

*This means the BridgeDeposit.sol contract must have minter access to the token attempting to be minted*

#### Parameters

| Name           | Type                    | Description                                                                                                      |
| -------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| to             | address payable         | address on other chain to redeem underlying assets to                                                            |
| token          | contract IERC20Mintable | ERC20 compatible token to deposit into the bridge                                                                |
| amount         | uint256                 | Amount in native token decimals to transfer cross-chain post-fees                                                |
| fee            | uint256                 | Amount in native token decimals to save to the contract as fees                                                  |
| pool           | contract ISwap          | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol.     |
| tokenIndexFrom | uint8                   | Index of the SynERC20 asset in the pool                                                                          |
| tokenIndexTo   | uint8                   | Index of the desired final asset                                                                                 |
| minDy          | uint256                 | Minumum amount (in final asset decimals) that must be swapped for, otherwise the user will receive the SynERC20. |
| deadline       | uint256                 | Epoch time of the deadline that the swap is allowed to be executed.                                              |
| kappa          | bytes32                 | kappa\*                                                                                                          |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | address                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                          |
| -------------- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                         |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                    |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                     |
| swapTokenIndex | uint8                  | Specifies which of the underlying LP assets the nodes should attempt to redeem for                   |
| swapMinAmount  | uint256                | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap |
| swapDeadline   | uint256                | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*             |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract ERC20Burnable token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type                   | Description                                                                                             |
| -------------- | ---------------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address                | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256                | which underlying chain to bridge assets onto                                                            |
| token          | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256                | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8                  | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8                  | the token the user wants to swap to                                                                     |
| minDy          | uint256                | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256                | latest timestamp to accept this transaction\*                                                           |

### redeemV2

```solidity
function redeemV2(bytes32 to, uint256 chainId, contract ERC20Burnable token, uint256 amount) external nonpayable
```

Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain

#### Parameters

| Name    | Type                   | Description                                                        |
| ------- | ---------------------- | ------------------------------------------------------------------ |
| to      | bytes32                | address on other chain to redeem underlying assets to              |
| chainId | uint256                | which underlying chain to bridge assets onto                       |
| token   | contract ERC20Burnable | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256                | Amount in native token decimals to transfer cross-chain pre-fees\* |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setChainGasAmount

```solidity
function setChainGasAmount(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### setWethAddress

```solidity
function setWethAddress(address payable _wethAddress) external nonpayable
```

#### Parameters

| Name          | Type            | Description |
| ------------- | --------------- | ----------- |
| \_wethAddress | address payable | undefined   |

### startBlockNumber

```solidity
function startBlockNumber() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### withdraw

```solidity
function withdraw(address to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name   | Type            | Description                                                     |
| ------ | --------------- | --------------------------------------------------------------- |
| to     | address         | address on chain to send underlying assets to                   |
| token  | contract IERC20 | ERC20 compatible token to withdraw from the bridge              |
| amount | uint256         | Amount in native token decimals to withdraw                     |
| fee    | uint256         | Amount in native token decimals to save to the contract as fees |
| kappa  | bytes32         | kappa\*                                                         |

### withdrawAndRemove

```solidity
function withdrawAndRemove(address to, contract IERC20 token, uint256 amount, uint256 fee, contract ISwap pool, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bytes32 kappa) external nonpayable
```

Function to be called by the node group to withdraw the underlying assets from the contract

#### Parameters

| Name           | Type            | Description                                                                                                  |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------------ |
| to             | address         | address on chain to send underlying assets to                                                                |
| token          | contract IERC20 | ERC20 compatible token to withdraw from the bridge                                                           |
| amount         | uint256         | Amount in native token decimals to withdraw                                                                  |
| fee            | uint256         | Amount in native token decimals to save to the contract as fees                                              |
| pool           | contract ISwap  | Destination chain's pool to use to swap SynERC20 -> Asset. The nodes determine this by using PoolConfig.sol. |
| swapTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                           |
| swapMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap         |
| swapDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token                       |
| kappa          | bytes32         | kappa\*                                                                                                      |

### withdrawFees

```solidity
function withdrawFees(contract IERC20 token, address to) external nonpayable
```

withdraw specified ERC20 token fees to a given address

#### Parameters

| Name  | Type            | Description                                        |
| ----- | --------------- | -------------------------------------------------- |
| token | contract IERC20 | ERC20 token in which fees acccumulated to transfer |
| to    | address         | Address to send the fees to                        |

## Events

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### TokenDeposit

```solidity
event TokenDeposit(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenDepositAndSwap

```solidity
event TokenDepositAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenMint

```solidity
event TokenMint(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenMintAndSwap

```solidity
event TokenMintAndSwap(address indexed to, contract IERC20Mintable token, uint256 amount, uint256 fee, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type                    | Description |
| --------------- | ----------------------- | ----------- |
| to `indexed`    | address                 | undefined   |
| token           | contract IERC20Mintable | undefined   |
| amount          | uint256                 | undefined   |
| fee             | uint256                 | undefined   |
| tokenIndexFrom  | uint8                   | undefined   |
| tokenIndexTo    | uint8                   | undefined   |
| minDy           | uint256                 | undefined   |
| deadline        | uint256                 | undefined   |
| swapSuccess     | bool                    | undefined   |
| kappa `indexed` | bytes32                 | undefined   |

### TokenRedeem

```solidity
event TokenRedeem(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | address         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenRedeemAndRemove

```solidity
event TokenRedeemAndRemove(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| swapTokenIndex | uint8           | undefined   |
| swapMinAmount  | uint256         | undefined   |
| swapDeadline   | uint256         | undefined   |

### TokenRedeemAndSwap

```solidity
event TokenRedeemAndSwap(address indexed to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline)
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to `indexed`   | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### TokenRedeemV2

```solidity
event TokenRedeemV2(bytes32 indexed to, uint256 chainId, contract IERC20 token, uint256 amount)
```

#### Parameters

| Name         | Type            | Description |
| ------------ | --------------- | ----------- |
| to `indexed` | bytes32         | undefined   |
| chainId      | uint256         | undefined   |
| token        | contract IERC20 | undefined   |
| amount       | uint256         | undefined   |

### TokenWithdraw

```solidity
event TokenWithdraw(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### TokenWithdrawAndRemove

```solidity
event TokenWithdrawAndRemove(address indexed to, contract IERC20 token, uint256 amount, uint256 fee, uint8 swapTokenIndex, uint256 swapMinAmount, uint256 swapDeadline, bool swapSuccess, bytes32 indexed kappa)
```

#### Parameters

| Name            | Type            | Description |
| --------------- | --------------- | ----------- |
| to `indexed`    | address         | undefined   |
| token           | contract IERC20 | undefined   |
| amount          | uint256         | undefined   |
| fee             | uint256         | undefined   |
| swapTokenIndex  | uint8           | undefined   |
| swapMinAmount   | uint256         | undefined   |
| swapDeadline    | uint256         | undefined   |
| swapSuccess     | bool            | undefined   |
| kappa `indexed` | bytes32         | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# SynapseERC20

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DOMAIN\_SEPARATOR

```solidity
function DOMAIN_SEPARATOR() external view returns (bytes32)
```

*See {IERC20Permit-DOMAIN\_SEPARATOR}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MINTER\_ROLE

```solidity
function MINTER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*See {IERC20-allowance}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*See {IERC20-balanceOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### burn

```solidity
function burn(uint256 amount) external nonpayable
```

*Destroys `amount` tokens from the caller. See {ERC20-\_burn}.*

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### burnFrom

```solidity
function burnFrom(address account, uint256 amount) external nonpayable
```

*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-\_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for `accounts`'s tokens of at least `amount`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |
| amount  | uint256 | undefined   |

### decimals

```solidity
function decimals() external view returns (uint8)
```

*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {\_setupDecimals} is called. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### decreaseAllowance

```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```

*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| spender         | address | undefined   |
| subtractedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increaseAllowance

```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```

*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| spender    | address | undefined   |
| addedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize(string name, string symbol, uint8 decimals, address owner) external nonpayable
```

Initializes this ERC20 contract with the given parameters.

#### Parameters

| Name     | Type    | Description                          |
| -------- | ------- | ------------------------------------ |
| name     | string  | Token name                           |
| symbol   | string  | Token symbol                         |
| decimals | uint8   | Token name                           |
| owner    | address | admin address to be initialized with |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |

### name

```solidity
function name() external view returns (string)
```

*Returns the name of the token.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### nonces

```solidity
function nonces(address owner) external view returns (uint256)
```

*See {IERC20Permit-nonces}.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### permit

```solidity
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
```

*See {IERC20Permit-permit}.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| owner    | address | undefined   |
| spender  | address | undefined   |
| value    | uint256 | undefined   |
| deadline | uint256 | undefined   |
| v        | uint8   | undefined   |
| r        | bytes32 | undefined   |
| s        | bytes32 | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### symbol

```solidity
function symbol() external view returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC20-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# SynapseERC20DeterministicFactory

## Methods

### deploy

```solidity
function deploy(address synapseERC20Address, string name, string symbol, uint8 decimals, address owner) external nonpayable returns (address synERC20Clone)
```

Deploys a new SynapseERC20 token

#### Parameters

| Name                | Type    | Description                                                    |
| ------------------- | ------- | -------------------------------------------------------------- |
| synapseERC20Address | address | address of the synapseERC20Address contract to initialize with |
| name                | string  | Token name                                                     |
| symbol              | string  | Token symbol                                                   |
| decimals            | uint8   | Token name                                                     |
| owner               | address | admin address to be initialized with                           |

#### Returns

| Name          | Type    | Description                                        |
| ------------- | ------- | -------------------------------------------------- |
| synERC20Clone | address | Address of the newest SynapseERC20 token created\* |

### deployDeterministic

```solidity
function deployDeterministic(address synapseERC20Address, bytes32 salt, string name, string symbol, uint8 decimals, address owner) external nonpayable returns (address synERC20Clone)
```

Deploys a new SynapseERC20 token

*Use the same salt for the same token on different chains to get the same deployment address. Requires having SynapseERC20Factory deployed at the same address on different chains as well. NOTE: this function has onlyOwner modifier to prevent bad actors from taking a token's address on another chain*

#### Parameters

| Name                | Type    | Description                                                    |
| ------------------- | ------- | -------------------------------------------------------------- |
| synapseERC20Address | address | address of the synapseERC20Address contract to initialize with |
| salt                | bytes32 | Salt for creating a clone                                      |
| name                | string  | Token name                                                     |
| symbol              | string  | Token symbol                                                   |
| decimals            | uint8   | Token name                                                     |
| owner               | address | admin address to be initialized with                           |

#### Returns

| Name          | Type    | Description                                        |
| ------------- | ------- | -------------------------------------------------- |
| synERC20Clone | address | Address of the newest SynapseERC20 token created\* |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### predictDeterministicAddress

```solidity
function predictDeterministicAddress(address synapseERC20Address, bytes32 salt) external view returns (address)
```

#### Parameters

| Name                | Type    | Description |
| ------------------- | ------- | ----------- |
| synapseERC20Address | address | undefined   |
| salt                | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### SynapseERC20Created

```solidity
event SynapseERC20Created(address contractAddress)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| contractAddress | address | undefined   |


# SynapseERC20Factory

## Methods

### deploy

```solidity
function deploy(address synapseERC20Address, string name, string symbol, uint8 decimals, address owner) external nonpayable returns (address)
```

Deploys a new node

#### Parameters

| Name                | Type    | Description                                                    |
| ------------------- | ------- | -------------------------------------------------------------- |
| synapseERC20Address | address | address of the synapseERC20Address contract to initialize with |
| name                | string  | Token name                                                     |
| symbol              | string  | Token symbol                                                   |
| decimals            | uint8   | Token name                                                     |
| owner               | address | admin address to be initialized with                           |

#### Returns

| Name | Type    | Description                                              |
| ---- | ------- | -------------------------------------------------------- |
| \_0  | address | Address of the newest node management contract created\* |

## Events

### SynapseERC20Created

```solidity
event SynapseERC20Created(address contractAddress)
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| contractAddress | address | undefined   |


# interfaces


# IECDSANodeManagement

> IECDSANodeManagement interface

Interface for the ECDSA node management interface.

*implement this interface to develop a a factory-patterned ECDSA node management contract*\*

## Methods

### initialize

```solidity
function initialize(address _owner, address[] _members, uint256 _honestThreshold) external nonpayable
```

#### Parameters

| Name              | Type       | Description |
| ----------------- | ---------- | ----------- |
| \_owner           | address    | undefined   |
| \_members         | address\[] | undefined   |
| \_honestThreshold | uint256    | undefined   |


# IERC20Migrator

## Methods

### migrate

```solidity
function migrate(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |


# IMasterChef

## Methods

### deposit

```solidity
function deposit(uint256 _pid, uint256 _amount) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_pid    | uint256 | undefined   |
| \_amount | uint256 | undefined   |

### poolInfo

```solidity
function poolInfo(uint256 pid) external view returns (struct IMasterChef.PoolInfo)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| pid  | uint256 | undefined   |

#### Returns

| Name | Type                 | Description |
| ---- | -------------------- | ----------- |
| \_0  | IMasterChef.PoolInfo | undefined   |

### totalAllocPoint

```solidity
function totalAllocPoint() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# IMetaSwapDeposit

> IMetaSwapDeposit interface

Interface for the meta swap contract.

*implement this interface to develop a a factory-patterned ECDSA node management contract*\*

## Methods

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(uint256 index) external view returns (contract IERC20)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| index | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# IMiniChefV2

## Methods

### deposit

```solidity
function deposit(uint256 pid, uint256 amount, address to) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| pid    | uint256 | undefined   |
| amount | uint256 | undefined   |
| to     | address | undefined   |

### emergencyWithdraw

```solidity
function emergencyWithdraw(uint256 pid, address to) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| pid  | uint256 | undefined   |
| to   | address | undefined   |

### harvest

```solidity
function harvest(uint256 pid, address to) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| pid  | uint256 | undefined   |
| to   | address | undefined   |

### poolLength

```solidity
function poolLength() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### updatePool

```solidity
function updatePool(uint256 pid) external nonpayable returns (struct IMiniChefV2.PoolInfo)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| pid  | uint256 | undefined   |

#### Returns

| Name | Type                 | Description |
| ---- | -------------------- | ----------- |
| \_0  | IMiniChefV2.PoolInfo | undefined   |

### userInfo

```solidity
function userInfo(uint256 _pid, address _user) external view returns (uint256, uint256)
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| \_pid  | uint256 | undefined   |
| \_user | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |
| \_1  | uint256 | undefined   |

### withdraw

```solidity
function withdraw(uint256 pid, uint256 amount, address to) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| pid    | uint256 | undefined   |
| amount | uint256 | undefined   |
| to     | address | undefined   |

### withdrawAndHarvest

```solidity
function withdrawAndHarvest(uint256 pid, uint256 amount, address to) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| pid    | uint256 | undefined   |
| amount | uint256 | undefined   |
| to     | address | undefined   |


# IRewarder

## Methods

### onSynapseReward

```solidity
function onSynapseReward(uint256 pid, address user, address recipient, uint256 synapseAmount, uint256 newLpAmount) external nonpayable
```

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| pid           | uint256 | undefined   |
| user          | address | undefined   |
| recipient     | address | undefined   |
| synapseAmount | uint256 | undefined   |
| newLpAmount   | uint256 | undefined   |

### pendingTokens

```solidity
function pendingTokens(uint256 pid, address user, uint256 synapseAmount) external view returns (contract IERC20[], uint256[])
```

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| pid           | uint256 | undefined   |
| user          | address | undefined   |
| synapseAmount | uint256 | undefined   |

#### Returns

| Name | Type               | Description |
| ---- | ------------------ | ----------- |
| \_0  | contract IERC20\[] | undefined   |
| \_1  | uint256\[]         | undefined   |


# ISwap

## Methods

### addLiquidity

```solidity
function addLiquidity(uint256[] amounts, uint256 minToMint, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name      | Type       | Description |
| --------- | ---------- | ----------- |
| amounts   | uint256\[] | undefined   |
| minToMint | uint256    | undefined   |
| deadline  | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateRemoveLiquidity

```solidity
function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[])
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |

#### Returns

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| availableTokenAmount | uint256 | undefined   |

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

#### Parameters

| Name    | Type       | Description |
| ------- | ---------- | ----------- |
| amounts | uint256\[] | undefined   |
| deposit | bool       | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getA

```solidity
function getA() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getToken

```solidity
function getToken(uint8 index) external view returns (contract IERC20)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### getTokenBalance

```solidity
function getTokenBalance(uint8 index) external view returns (uint256)
```

#### Parameters

| Name  | Type  | Description |
| ----- | ----- | ----------- |
| index | uint8 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getTokenIndex

```solidity
function getTokenIndex(address tokenAddress) external view returns (uint8)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| tokenAddress | address | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getVirtualPrice

```solidity
function getVirtualPrice() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initialize

```solidity
function initialize(contract IERC20[] pooledTokens, uint8[] decimals, string lpTokenName, string lpTokenSymbol, uint256 a, uint256 fee, uint256 adminFee, address lpTokenTargetAddress) external nonpayable
```

#### Parameters

| Name                 | Type               | Description |
| -------------------- | ------------------ | ----------- |
| pooledTokens         | contract IERC20\[] | undefined   |
| decimals             | uint8\[]           | undefined   |
| lpTokenName          | string             | undefined   |
| lpTokenSymbol        | string             | undefined   |
| a                    | uint256            | undefined   |
| fee                  | uint256            | undefined   |
| adminFee             | uint256            | undefined   |
| lpTokenTargetAddress | address            | undefined   |

### removeLiquidity

```solidity
function removeLiquidity(uint256 amount, uint256[] minAmounts, uint256 deadline) external nonpayable returns (uint256[])
```

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| amount     | uint256    | undefined   |
| minAmounts | uint256\[] | undefined   |
| deadline   | uint256    | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### removeLiquidityImbalance

```solidity
function removeLiquidityImbalance(uint256[] amounts, uint256 maxBurnAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type       | Description |
| ------------- | ---------- | ----------- |
| amounts       | uint256\[] | undefined   |
| maxBurnAmount | uint256    | undefined   |
| deadline      | uint256    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### removeLiquidityOneToken

```solidity
function removeLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| tokenAmount | uint256 | undefined   |
| tokenIndex  | uint8   | undefined   |
| minAmount   | uint256 | undefined   |
| deadline    | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# ISynapseBridge

## Methods

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

#### Parameters

| Name    | Type            | Description |
| ------- | --------------- | ----------- |
| to      | address         | undefined   |
| chainId | uint256         | undefined   |
| token   | contract IERC20 | undefined   |
| amount  | uint256         | undefined   |

### depositAndSwap

```solidity
function depositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

#### Parameters

| Name    | Type            | Description |
| ------- | --------------- | ----------- |
| to      | address         | undefined   |
| chainId | uint256         | undefined   |
| token   | contract IERC20 | undefined   |
| amount  | uint256         | undefined   |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

#### Parameters

| Name          | Type            | Description |
| ------------- | --------------- | ----------- |
| to            | address         | undefined   |
| chainId       | uint256         | undefined   |
| token         | contract IERC20 | undefined   |
| amount        | uint256         | undefined   |
| liqTokenIndex | uint8           | undefined   |
| liqMinAmount  | uint256         | undefined   |
| liqDeadline   | uint256         | undefined   |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| amount         | uint256         | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### redeemv2

```solidity
function redeemv2(bytes32 to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

#### Parameters

| Name    | Type            | Description |
| ------- | --------------- | ----------- |
| to      | bytes32         | undefined   |
| chainId | uint256         | undefined   |
| token   | contract IERC20 | undefined   |
| amount  | uint256         | undefined   |


# ISynapseERC20

## Methods

### initialize

```solidity
function initialize(string _name, string _symbol, uint8 _decimals, address owner) external nonpayable
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| \_name     | string  | undefined   |
| \_symbol   | string  | undefined   |
| \_decimals | uint8   | undefined   |
| owner      | address | undefined   |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |


# libraries


# SignedSafeMath


# mocks


# ERC20Mock

## Methods

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*See {IERC20-allowance}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*See {IERC20-balanceOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### decimals

```solidity
function decimals() external view returns (uint8)
```

*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {\_setupDecimals} is called. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### decreaseAllowance

```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```

*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| spender         | address | undefined   |
| subtractedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increaseAllowance

```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```

*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| spender    | address | undefined   |
| addedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |

### name

```solidity
function name() external view returns (string)
```

*Returns the name of the token.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### symbol

```solidity
function symbol() external view returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC20-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# RewarderBrokenMock

## Methods

### onSynapseReward

```solidity
function onSynapseReward(uint256, address, address, uint256, uint256) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |
| \_1  | address | undefined   |
| \_2  | address | undefined   |
| \_3  | uint256 | undefined   |
| \_4  | uint256 | undefined   |

### pendingTokens

```solidity
function pendingTokens(uint256 pid, address user, uint256 synapseAmount) external view returns (contract IERC20[] rewardTokens, uint256[] rewardAmounts)
```

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| pid           | uint256 | undefined   |
| user          | address | undefined   |
| synapseAmount | uint256 | undefined   |

#### Returns

| Name          | Type               | Description |
| ------------- | ------------------ | ----------- |
| rewardTokens  | contract IERC20\[] | undefined   |
| rewardAmounts | uint256\[]         | undefined   |


# RewarderMock

## Methods

### onSynapseReward

```solidity
function onSynapseReward(uint256, address user, address to, uint256 synapseAmount, uint256) external nonpayable
```

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| \_0           | uint256 | undefined   |
| user          | address | undefined   |
| to            | address | undefined   |
| synapseAmount | uint256 | undefined   |
| \_4           | uint256 | undefined   |

### pendingTokens

```solidity
function pendingTokens(uint256 pid, address user, uint256 synapseAmount) external view returns (contract IERC20[] rewardTokens, uint256[] rewardAmounts)
```

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| pid           | uint256 | undefined   |
| user          | address | undefined   |
| synapseAmount | uint256 | undefined   |

#### Returns

| Name          | Type               | Description |
| ------------- | ------------------ | ----------- |
| rewardTokens  | contract IERC20\[] | undefined   |
| rewardAmounts | uint256\[]         | undefined   |


# testing


# NodeEnv

*Synapse Authors*

> NodeEnv contract

This contract implements a key-value store for storing variables on which synapse nodes must coordinate methods are purposely arbitrary to allow these fields to be defined in synapse improvement proposals.This token is used for configuring different tokens on the bridge and mapping them across chains.\*

## Methods

### BRIDGEMANAGER\_ROLE

```solidity
function BRIDGEMANAGER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### get

```solidity
function get(string _key) external view returns (string)
```

gets the value associated with the key

#### Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| \_key | string | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### keyCount

```solidity
function keyCount() external view returns (uint256)
```

get the length of the config

*this is useful for enumerating through all keys in the env*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### keyValueByIndex

```solidity
function keyValueByIndex(uint256 index) external view returns (string, string)
```

gets the key/value pair by it's index Requirements: - `index` must be strictly less than {length}.

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| index | uint256 | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |
| \_1  | string | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### set

```solidity
function set(string _key, string _value) external nonpayable returns (bool)
```

sets the key

*caller must have bridge manager role*

#### Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| \_key   | string | undefined   |
| \_value | string | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### ConfigUpdate

```solidity
event ConfigUpdate(string key)
```

#### Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| key  | string | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |


# Synapse

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DOMAIN\_SEPARATOR

```solidity
function DOMAIN_SEPARATOR() external view returns (bytes32)
```

*See {IERC20Permit-DOMAIN\_SEPARATOR}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MINTER\_ROLE

```solidity
function MINTER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*See {IERC20-allowance}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*See {IERC20-balanceOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### burn

```solidity
function burn(uint256 amount) external nonpayable
```

*Destroys `amount` tokens from the caller. See {ERC20-\_burn}.*

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### burnFrom

```solidity
function burnFrom(address account, uint256 amount) external nonpayable
```

*Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-\_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for `accounts`'s tokens of at least `amount`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |
| amount  | uint256 | undefined   |

### decimals

```solidity
function decimals() external view returns (uint8)
```

*Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless {\_setupDecimals} is called. NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.*

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### decreaseAllowance

```solidity
function decreaseAllowance(address spender, uint256 subtractedValue) external nonpayable returns (bool)
```

*Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| spender         | address | undefined   |
| subtractedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

*Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following <https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296\\[forum> post] for more information.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

*Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increaseAllowance

```solidity
function increaseAllowance(address spender, uint256 addedValue) external nonpayable returns (bool)
```

*Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.*

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| spender    | address | undefined   |
| addedValue | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |

### name

```solidity
function name() external view returns (string)
```

*Returns the name of the token.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### nonces

```solidity
function nonces(address owner) external view returns (uint256)
```

*See {IERC20Permit-nonces}.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### permit

```solidity
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable
```

*See {IERC20Permit-permit}.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| owner    | address | undefined   |
| spender  | address | undefined   |
| value    | uint256 | undefined   |
| deadline | uint256 | undefined   |
| v        | uint8   | undefined   |
| r        | bytes32 | undefined   |
| s        | bytes32 | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### symbol

```solidity
function symbol() external view returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC20-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for `sender`'s tokens of at least `amount`.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# utils


# AddressArrayUtils


# EnumerableStringMap

> EnumerableStringMap

*Library for managing an enumerable variant of Solidity's <https://solidity.readthedocs.io/en/latest/types.html#mapping-types\\[`mapping`>] type. Maps have the following properties: - Entries are added, removed, and checked for existence in constant time (O(1)). - Entries are enumerated in O(n). No guarantees are made on the ordering. this isn't a terribly gas efficient implementation because it emphasizes usability over gas efficiency by allowing arbitrary length string memorys. If Gettetrs/Setters are going to be used frequently in contracts consider using the OpenZeppeling Bytes32 implementation this also differs from the OpenZeppelin implementation by keccac256 hashing the string memorys so we can use enumerable bytes32 set*


# TimelockController

*Contract module which acts as a timelocked controller. When set as the owner of an `Ownable` smart contract, it enforces a timelock on all `onlyOwner` maintenance operations. This gives time for users of the controlled contract to exit before a potentially dangerous maintenance operation is applied. By default, this contract is self administered, meaning administration tasks have to go through the timelock process. The proposer (resp executor) role is in charge of proposing (resp executing) operations. A common use case is to position this {TimelockController} as the owner of a smart contract, with a multisig or a DAO as the sole proposer. Available since v3.3.*

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### EXECUTOR\_ROLE

```solidity
function EXECUTOR_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### PROPOSER\_ROLE

```solidity
function PROPOSER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### TIMELOCK\_ADMIN\_ROLE

```solidity
function TIMELOCK_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### cancel

```solidity
function cancel(bytes32 id) external nonpayable
```

*Cancel an operation. Requirements: - the caller must have the 'proposer' role.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

### execute

```solidity
function execute(address target, uint256 value, bytes data, bytes32 predecessor, bytes32 salt) external payable
```

*Execute an (ready) operation containing a single transaction. Emits a {CallExecuted} event. Requirements: - the caller must have the 'executor' role.*

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| target      | address | undefined   |
| value       | uint256 | undefined   |
| data        | bytes   | undefined   |
| predecessor | bytes32 | undefined   |
| salt        | bytes32 | undefined   |

### executeBatch

```solidity
function executeBatch(address[] targets, uint256[] values, bytes[] datas, bytes32 predecessor, bytes32 salt) external payable
```

*Execute an (ready) operation containing a batch of transactions. Emits one {CallExecuted} event per transaction in the batch. Requirements: - the caller must have the 'executor' role.*

#### Parameters

| Name        | Type       | Description |
| ----------- | ---------- | ----------- |
| targets     | address\[] | undefined   |
| values      | uint256\[] | undefined   |
| datas       | bytes\[]   | undefined   |
| predecessor | bytes32    | undefined   |
| salt        | bytes32    | undefined   |

### getMinDelay

```solidity
function getMinDelay() external view returns (uint256 duration)
```

*Returns the minimum delay for an operation to become valid. This value can be changed by executing an operation that calls `updateDelay`.*

#### Returns

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| duration | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getTimestamp

```solidity
function getTimestamp(bytes32 id) external view returns (uint256 timestamp)
```

*Returns the timestamp at with an operation becomes ready (0 for unset operations, 1 for done operations).*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

#### Returns

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| timestamp | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### hashOperation

```solidity
function hashOperation(address target, uint256 value, bytes data, bytes32 predecessor, bytes32 salt) external pure returns (bytes32 hash)
```

*Returns the identifier of an operation containing a single transaction.*

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| target      | address | undefined   |
| value       | uint256 | undefined   |
| data        | bytes   | undefined   |
| predecessor | bytes32 | undefined   |
| salt        | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| hash | bytes32 | undefined   |

### hashOperationBatch

```solidity
function hashOperationBatch(address[] targets, uint256[] values, bytes[] datas, bytes32 predecessor, bytes32 salt) external pure returns (bytes32 hash)
```

*Returns the identifier of an operation containing a batch of transactions.*

#### Parameters

| Name        | Type       | Description |
| ----------- | ---------- | ----------- |
| targets     | address\[] | undefined   |
| values      | uint256\[] | undefined   |
| datas       | bytes\[]   | undefined   |
| predecessor | bytes32    | undefined   |
| salt        | bytes32    | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| hash | bytes32 | undefined   |

### isOperation

```solidity
function isOperation(bytes32 id) external view returns (bool pending)
```

*Returns whether an id correspond to a registered operation. This includes both Pending, Ready and Done operations.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

#### Returns

| Name    | Type | Description |
| ------- | ---- | ----------- |
| pending | bool | undefined   |

### isOperationDone

```solidity
function isOperationDone(bytes32 id) external view returns (bool done)
```

*Returns whether an operation is done or not.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| done | bool | undefined   |

### isOperationPending

```solidity
function isOperationPending(bytes32 id) external view returns (bool pending)
```

*Returns whether an operation is pending or not.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

#### Returns

| Name    | Type | Description |
| ------- | ---- | ----------- |
| pending | bool | undefined   |

### isOperationReady

```solidity
function isOperationReady(bytes32 id) external view returns (bool ready)
```

*Returns whether an operation is ready or not.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| id   | bytes32 | undefined   |

#### Returns

| Name  | Type | Description |
| ----- | ---- | ----------- |
| ready | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### schedule

```solidity
function schedule(address target, uint256 value, bytes data, bytes32 predecessor, bytes32 salt, uint256 delay) external nonpayable
```

*Schedule an operation containing a single transaction. Emits a {CallScheduled} event. Requirements: - the caller must have the 'proposer' role.*

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| target      | address | undefined   |
| value       | uint256 | undefined   |
| data        | bytes   | undefined   |
| predecessor | bytes32 | undefined   |
| salt        | bytes32 | undefined   |
| delay       | uint256 | undefined   |

### scheduleBatch

```solidity
function scheduleBatch(address[] targets, uint256[] values, bytes[] datas, bytes32 predecessor, bytes32 salt, uint256 delay) external nonpayable
```

*Schedule an operation containing a batch of transactions. Emits one {CallScheduled} event per transaction in the batch. Requirements: - the caller must have the 'proposer' role.*

#### Parameters

| Name        | Type       | Description |
| ----------- | ---------- | ----------- |
| targets     | address\[] | undefined   |
| values      | uint256\[] | undefined   |
| datas       | bytes\[]   | undefined   |
| predecessor | bytes32    | undefined   |
| salt        | bytes32    | undefined   |
| delay       | uint256    | undefined   |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

*See {IERC165-supportsInterface}.*

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### updateDelay

```solidity
function updateDelay(uint256 newDelay) external nonpayable
```

*Changes the minimum timelock duration for future operations. Emits a {MinDelayChange} event. Requirements: - the caller must be the timelock itself. This can only be achieved by scheduling and later executing an operation where the timelock is the target and the data is the ABI-encoded call to this function.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newDelay | uint256 | undefined   |

## Events

### CallExecuted

```solidity
event CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data)
```

*Emitted when a call is performed as part of operation `id`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| id `indexed`    | bytes32 | undefined   |
| index `indexed` | uint256 | undefined   |
| target          | address | undefined   |
| value           | uint256 | undefined   |
| data            | bytes   | undefined   |

### CallScheduled

```solidity
event CallScheduled(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data, bytes32 predecessor, uint256 delay)
```

*Emitted when a call is scheduled as part of operation `id`.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| id `indexed`    | bytes32 | undefined   |
| index `indexed` | uint256 | undefined   |
| target          | address | undefined   |
| value           | uint256 | undefined   |
| data            | bytes   | undefined   |
| predecessor     | bytes32 | undefined   |
| delay           | uint256 | undefined   |

### Cancelled

```solidity
event Cancelled(bytes32 indexed id)
```

*Emitted when operation `id` is cancelled.*

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| id `indexed` | bytes32 | undefined   |

### MinDelayChange

```solidity
event MinDelayChange(uint256 oldDuration, uint256 newDuration)
```

*Emitted when the minimum delay for future operations is modified.*

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| oldDuration | uint256 | undefined   |
| newDuration | uint256 | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |


# wrappers


# AvaxJewelMigration

## Methods

### migrate

```solidity
function migrate(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### migrateAndBridge

```solidity
function migrateAndBridge(uint256 amount, address to, uint256 chainId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| amount  | uint256 | undefined   |
| to      | address | undefined   |
| chainId | uint256 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### redeemLegacy

```solidity
function redeemLegacy() external nonpayable
```

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# AvaxJewelMigrationV2

## Methods

### LEGACY\_TOKEN

```solidity
function LEGACY_TOKEN() external view returns (contract IERC20)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### NEW\_TOKEN

```solidity
function NEW_TOKEN() external view returns (contract IERC20Mintable)
```

#### Returns

| Name | Type                    | Description |
| ---- | ----------------------- | ----------- |
| \_0  | contract IERC20Mintable | undefined   |

### SYNAPSE\_BRIDGE

```solidity
function SYNAPSE_BRIDGE() external view returns (contract ISynapseBridge)
```

#### Returns

| Name | Type                    | Description |
| ---- | ----------------------- | ----------- |
| \_0  | contract ISynapseBridge | undefined   |

### migrate

```solidity
function migrate(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### migrateAndBridge

```solidity
function migrateAndBridge(uint256 amount, address to, uint256 chainId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| amount  | uint256 | undefined   |
| to      | address | undefined   |
| chainId | uint256 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### redeemLegacy

```solidity
function redeemLegacy() external nonpayable
```

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# AvaxJewelSwap

## Methods

### calculateSwap

```solidity
function calculateSwap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### swap

```solidity
function swap(uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable returns (uint256)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| tokenIndexFrom | uint8   | undefined   |
| tokenIndexTo   | uint8   | undefined   |
| dx             | uint256 | undefined   |
| minDy          | uint256 | undefined   |
| deadline       | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# GMXWrapper

## Methods

### bridge

```solidity
function bridge() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### burnFrom

```solidity
function burnFrom(address _addr, uint256 _amount) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_addr   | address | undefined   |
| \_amount | uint256 | undefined   |

### gmx

```solidity
function gmx() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### mint

```solidity
function mint(address _addr, uint256 _amount) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_addr   | address | undefined   |
| \_amount | uint256 | undefined   |

### transfer

```solidity
function transfer(address _recipient, uint256 _amount) external nonpayable returns (bool)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_recipient | address | undefined   |
| \_amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |


# HarmonyBridgeZap

## Methods

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### calculateSwap

```solidity
function calculateSwap(contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type            | Description                                                                                                                               |
| -------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| token          | contract IERC20 | undefined                                                                                                                                 |
| tokenIndexFrom | uint8           | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8           | the token the user wants to buy                                                                                                           |
| dx             | uint256         | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

Wraps redeemAndRemove on SynapseBridge Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name          | Type            | Description                                                                                                                                  |
| ------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| to            | address         | address on other chain to redeem underlying assets to                                                                                        |
| chainId       | uint256         | which underlying chain to bridge assets onto                                                                                                 |
| token         | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                                            |
| amount        | uint256         | Amount of (typically) LP token to pass to the nodes to attempt to removeLiquidity() with to redeem for the underlying assets of the LP token |
| liqTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                                                           |
| liqMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap                                         |
| liqDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*                                                     |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Wraps redeemAndSwap on SynapseBridge.sol Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256         | which underlying chain to bridge assets onto                                                            |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### redeemv2

```solidity
function redeemv2(bytes32 to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge redeemv2() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | bytes32         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to redeem into the bridge                   |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### swapAndRedeem

```solidity
function swapAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapAndRedeemAndRemove

```solidity
function swapAndRedeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |
| liqTokenIndex  | uint8           | undefined   |
| liqMinAmount   | uint256         | undefined   |
| liqDeadline    | uint256         | undefined   |

### swapAndRedeemAndSwap

```solidity
function swapAndRedeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 swapTokenIndexFrom, uint8 swapTokenIndexTo, uint256 swapMinDy, uint256 swapDeadline) external nonpayable
```

#### Parameters

| Name               | Type            | Description |
| ------------------ | --------------- | ----------- |
| to                 | address         | undefined   |
| chainId            | uint256         | undefined   |
| token              | contract IERC20 | undefined   |
| tokenIndexFrom     | uint8           | undefined   |
| tokenIndexTo       | uint8           | undefined   |
| dx                 | uint256         | undefined   |
| minDy              | uint256         | undefined   |
| deadline           | uint256         | undefined   |
| swapTokenIndexFrom | uint8           | undefined   |
| swapTokenIndexTo   | uint8           | undefined   |
| swapMinDy          | uint256         | undefined   |
| swapDeadline       | uint256         | undefined   |

### swapETHAndRedeem

```solidity
function swapETHAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external payable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapMap

```solidity
function swapMap(address) external view returns (address)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### swapTokensMap

```solidity
function swapTokensMap(address, uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |


# IERC20Mintable

## Methods

### allowance

```solidity
function allowance(address owner, address spender) external view returns (uint256)
```

*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| owner   | address | undefined   |
| spender | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### approve

```solidity
function approve(address spender, uint256 amount) external nonpayable returns (bool)
```

*Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: <https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729> Emits an {Approval} event.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| spender | address | undefined   |
| amount  | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

*Returns the amount of tokens owned by `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### mint

```solidity
function mint(address to, uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| to     | address | undefined   |
| amount | uint256 | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*Returns the amount of tokens in existence.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transfer

```solidity
function transfer(address recipient, uint256 amount) external nonpayable returns (bool)
```

*Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### transferFrom

```solidity
function transferFrom(address sender, address recipient, uint256 amount) external nonpayable returns (bool)
```

*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| sender    | address | undefined   |
| recipient | address | undefined   |
| amount    | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed spender, uint256 value)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| owner `indexed`   | address | undefined   |
| spender `indexed` | address | undefined   |
| value             | uint256 | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 value)
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| from `indexed` | address | undefined   |
| to `indexed`   | address | undefined   |
| value          | uint256 | undefined   |


# IFrax

## Methods

### exchangeCanonicalForOld

```solidity
function exchangeCanonicalForOld(address bridge_token_address, uint256 token_amount) external nonpayable returns (uint256)
```

#### Parameters

| Name                   | Type    | Description |
| ---------------------- | ------- | ----------- |
| bridge\_token\_address | address | undefined   |
| token\_amount          | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |


# IGMX

## Methods

### balanceOf

```solidity
function balanceOf(address account) external view returns (uint256)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### burn

```solidity
function burn(address _account, uint256 _amount) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_account | address | undefined   |
| \_amount  | uint256 | undefined   |

### mint

```solidity
function mint(address _account, uint256 _amount) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_account | address | undefined   |
| \_amount  | uint256 | undefined   |


# L1BridgeZap

> L1BridgeZap

This contract is responsible for handling user Zaps into the SynapseBridge contract, through the Synapse Swap contracts. It does so It does so by combining the action of addLiquidity() to the base swap pool, and then calling either deposit() or depositAndSwap() on the bridge. This is done in hopes of automating portions of the bridge user experience to users, while keeping the SynapseBridge contract logic small.

*This contract should be deployed with a base Swap.sol address and a SynapseBridge.sol address, otherwise, it will not function.*

## Methods

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### baseTokens

```solidity
function baseTokens(uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |

### calculateRemoveLiquidityOneToken

```solidity
function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex) external view returns (uint256 availableTokenAmount)
```

Calculate the amount of underlying token available to withdraw when withdrawing via only single token

#### Parameters

| Name        | Type    | Description                            |
| ----------- | ------- | -------------------------------------- |
| tokenAmount | uint256 | the amount of LP token to burn         |
| tokenIndex  | uint8   | index of which token will be withdrawn |

#### Returns

| Name                 | Type    | Description                                                 |
| -------------------- | ------- | ----------------------------------------------------------- |
| availableTokenAmount | uint256 | calculated amount of underlying token available to withdraw |

### calculateTokenAmount

```solidity
function calculateTokenAmount(uint256[] amounts, bool deposit) external view returns (uint256)
```

A simple method to calculate prices from deposits or withdrawals, excluding fees but including slippage. This is helpful as an input into the various "min" parameters on calls to fight front-running

*This shouldn't be used outside frontends for user estimates.*

#### Parameters

| Name    | Type       | Description                                                                                                                                      |
| ------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| amounts | uint256\[] | an array of token amounts to deposit or withdrawal, corresponding to pooledTokens. The amount should be in each pooled token's native precision. |
| deposit | bool       | whether this is a deposit or a withdrawal                                                                                                        |

#### Returns

| Name | Type    | Description                        |
| ---- | ------- | ---------------------------------- |
| \_0  | uint256 | token amount the user will receive |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge deposit() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositAndSwap

```solidity
function depositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Wraps SynapseBridge depositAndSwap() function

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to bridge assets to                                                              |
| chainId        | uint256         | which chain to bridge assets onto                                                                       |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### depositETH

```solidity
function depositETH(address to, uint256 chainId, uint256 amount) external payable
```

Wraps SynapseBridge deposit() function to make it compatible w/ ETH -> WETH conversions

#### Parameters

| Name    | Type    | Description                                                        |
| ------- | ------- | ------------------------------------------------------------------ |
| to      | address | address on other chain to bridge assets to                         |
| chainId | uint256 | which chain to bridge assets onto                                  |
| amount  | uint256 | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositETHAndSwap

```solidity
function depositETHAndSwap(address to, uint256 chainId, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external payable
```

Wraps SynapseBridge depositAndSwap() function to make it compatible w/ ETH -> WETH conversions

#### Parameters

| Name           | Type    | Description                                                                                             |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| to             | address | address on other chain to bridge assets to                                                              |
| chainId        | uint256 | which chain to bridge assets onto                                                                       |
| amount         | uint256 | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8   | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8   | the token the user wants to swap to                                                                     |
| minDy          | uint256 | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256 | latest timestamp to accept this transaction\*                                                           |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge redeem() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to redeem into the bridge                   |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

Wraps redeemAndRemove on SynapseBridge Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name          | Type            | Description                                                                                                                                  |
| ------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| to            | address         | address on other chain to redeem underlying assets to                                                                                        |
| chainId       | uint256         | which underlying chain to bridge assets onto                                                                                                 |
| token         | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                                            |
| amount        | uint256         | Amount of (typically) LP token to pass to the nodes to attempt to removeLiquidity() with to redeem for the underlying assets of the LP token |
| liqTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                                                           |
| liqMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap                                         |
| liqDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*                                                     |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Wraps redeemAndSwap on SynapseBridge.sol Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256         | which underlying chain to bridge assets onto                                                            |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### redeemv2

```solidity
function redeemv2(bytes32 to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge redeemv2() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | bytes32         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to redeem into the bridge                   |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### zapAndDeposit

```solidity
function zapAndDeposit(address to, uint256 chainId, contract IERC20 token, uint256[] liquidityAmounts, uint256 minToMint, uint256 deadline) external nonpayable
```

Combines adding liquidity to the given Swap, and calls deposit() on the bridge using that LP token

#### Parameters

| Name             | Type            | Description                                                                                                             |
| ---------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| to               | address         | address on other chain to bridge assets to                                                                              |
| chainId          | uint256         | which chain to bridge assets onto                                                                                       |
| token            | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                       |
| liquidityAmounts | uint256\[]      | the amounts of each token to add, in their native precision                                                             |
| minToMint        | uint256         | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| deadline         | uint256         | latest timestamp to accept this transaction\*                                                                           |

### zapAndDepositAndSwap

```solidity
function zapAndDepositAndSwap(address to, uint256 chainId, contract IERC20 token, uint256[] liquidityAmounts, uint256 minToMint, uint256 liqDeadline, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 swapDeadline) external nonpayable
```

Combines adding liquidity to the given Swap, and calls depositAndSwap() on the bridge using that LP token

#### Parameters

| Name             | Type            | Description                                                                                                             |
| ---------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| to               | address         | address on other chain to bridge assets to                                                                              |
| chainId          | uint256         | which chain to bridge assets onto                                                                                       |
| token            | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                       |
| liquidityAmounts | uint256\[]      | the amounts of each token to add, in their native precision                                                             |
| minToMint        | uint256         | the minimum LP tokens adding this amount of liquidity should mint, otherwise revert. Handy for front-running mitigation |
| liqDeadline      | uint256         | latest timestamp to accept this transaction                                                                             |
| tokenIndexFrom   | uint8           | the token the user wants to swap from                                                                                   |
| tokenIndexTo     | uint8           | the token the user wants to swap to                                                                                     |
| minDy            | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain.                 |
| swapDeadline     | uint256         | latest timestamp to accept this transaction\*                                                                           |


# L2BridgeZap

## Methods

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### calculateSwap

```solidity
function calculateSwap(contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type            | Description                                                                                                                               |
| -------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| token          | contract IERC20 | undefined                                                                                                                                 |
| tokenIndexFrom | uint8           | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8           | the token the user wants to buy                                                                                                           |
| dx             | uint256         | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositETH

```solidity
function depositETH(address to, uint256 chainId, uint256 amount) external payable
```

Wraps SynapseBridge deposit() function to make it compatible w/ ETH -> WETH conversions

#### Parameters

| Name    | Type    | Description                                                        |
| ------- | ------- | ------------------------------------------------------------------ |
| to      | address | address on other chain to bridge assets to                         |
| chainId | uint256 | which chain to bridge assets onto                                  |
| amount  | uint256 | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositETHAndSwap

```solidity
function depositETHAndSwap(address to, uint256 chainId, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external payable
```

Wraps SynapseBridge depositAndSwap() function to make it compatible w/ ETH -> WETH conversions

#### Parameters

| Name           | Type    | Description                                                                                             |
| -------------- | ------- | ------------------------------------------------------------------------------------------------------- |
| to             | address | address on other chain to bridge assets to                                                              |
| chainId        | uint256 | which chain to bridge assets onto                                                                       |
| amount         | uint256 | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8   | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8   | the token the user wants to swap to                                                                     |
| minDy          | uint256 | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256 | latest timestamp to accept this transaction\*                                                           |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

Wraps redeemAndRemove on SynapseBridge Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name          | Type            | Description                                                                                                                                  |
| ------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| to            | address         | address on other chain to redeem underlying assets to                                                                                        |
| chainId       | uint256         | which underlying chain to bridge assets onto                                                                                                 |
| token         | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                                            |
| amount        | uint256         | Amount of (typically) LP token to pass to the nodes to attempt to removeLiquidity() with to redeem for the underlying assets of the LP token |
| liqTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                                                           |
| liqMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap                                         |
| liqDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*                                                     |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Wraps redeemAndSwap on SynapseBridge.sol Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256         | which underlying chain to bridge assets onto                                                            |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### redeemv2

```solidity
function redeemv2(bytes32 to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge redeemv2() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | bytes32         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to redeem into the bridge                   |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### swapAndRedeem

```solidity
function swapAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapAndRedeemAndRemove

```solidity
function swapAndRedeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |
| liqTokenIndex  | uint8           | undefined   |
| liqMinAmount   | uint256         | undefined   |
| liqDeadline    | uint256         | undefined   |

### swapAndRedeemAndSwap

```solidity
function swapAndRedeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 swapTokenIndexFrom, uint8 swapTokenIndexTo, uint256 swapMinDy, uint256 swapDeadline) external nonpayable
```

#### Parameters

| Name               | Type            | Description |
| ------------------ | --------------- | ----------- |
| to                 | address         | undefined   |
| chainId            | uint256         | undefined   |
| token              | contract IERC20 | undefined   |
| tokenIndexFrom     | uint8           | undefined   |
| tokenIndexTo       | uint8           | undefined   |
| dx                 | uint256         | undefined   |
| minDy              | uint256         | undefined   |
| deadline           | uint256         | undefined   |
| swapTokenIndexFrom | uint8           | undefined   |
| swapTokenIndexTo   | uint8           | undefined   |
| swapMinDy          | uint256         | undefined   |
| swapDeadline       | uint256         | undefined   |

### swapETHAndRedeem

```solidity
function swapETHAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external payable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapETHAndRedeemAndSwap

```solidity
function swapETHAndRedeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 swapTokenIndexFrom, uint8 swapTokenIndexTo, uint256 swapMinDy, uint256 swapDeadline) external payable
```

#### Parameters

| Name               | Type            | Description |
| ------------------ | --------------- | ----------- |
| to                 | address         | undefined   |
| chainId            | uint256         | undefined   |
| token              | contract IERC20 | undefined   |
| tokenIndexFrom     | uint8           | undefined   |
| tokenIndexTo       | uint8           | undefined   |
| dx                 | uint256         | undefined   |
| minDy              | uint256         | undefined   |
| deadline           | uint256         | undefined   |
| swapTokenIndexFrom | uint8           | undefined   |
| swapTokenIndexTo   | uint8           | undefined   |
| swapMinDy          | uint256         | undefined   |
| swapDeadline       | uint256         | undefined   |

### swapMap

```solidity
function swapMap(address) external view returns (address)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### swapTokensMap

```solidity
function swapTokensMap(address, uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |


# MigratorBridgeZap

## Methods

### migrate

```solidity
function migrate(uint256 amount) external nonpayable
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| amount | uint256 | undefined   |

### migrateAndBridge

```solidity
function migrateAndBridge(uint256 amount, address to, uint256 chainId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| amount  | uint256 | undefined   |
| to      | address | undefined   |
| chainId | uint256 | undefined   |


# MoonriverBridgeZap

## Methods

### WETH\_ADDRESS

```solidity
function WETH_ADDRESS() external view returns (address payable)
```

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | address payable | undefined   |

### calculateSwap

```solidity
function calculateSwap(contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) external view returns (uint256)
```

Calculate amount of tokens you receive on swap

#### Parameters

| Name           | Type            | Description                                                                                                                               |
| -------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| token          | contract IERC20 | undefined                                                                                                                                 |
| tokenIndexFrom | uint8           | the token the user wants to sell                                                                                                          |
| tokenIndexTo   | uint8           | the token the user wants to buy                                                                                                           |
| dx             | uint256         | the amount of tokens the user wants to sell. If the token charges a fee on transfers, use the amount that gets transferred after the fee. |

#### Returns

| Name | Type    | Description                            |
| ---- | ------- | -------------------------------------- |
| \_0  | uint256 | amount of tokens the user will receive |

### deposit

```solidity
function deposit(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### depositETH

```solidity
function depositETH(address to, uint256 chainId, uint256 amount) external payable
```

Wraps SynapseBridge deposit() function to make it compatible w/ ETH -> WETH conversions

#### Parameters

| Name    | Type    | Description                                                        |
| ------- | ------- | ------------------------------------------------------------------ |
| to      | address | address on other chain to bridge assets to                         |
| chainId | uint256 | which chain to bridge assets onto                                  |
| amount  | uint256 | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeem

```solidity
function redeem(address to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

wraps SynapseBridge redeem()

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | address         | address on other chain to redeem underlying assets to              |
| chainId | uint256         | which underlying chain to bridge assets onto                       |
| token   | contract IERC20 | ERC20 compatible token to deposit into the bridge                  |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### redeemAndRemove

```solidity
function redeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

Wraps redeemAndRemove on SynapseBridge Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name          | Type            | Description                                                                                                                                  |
| ------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| to            | address         | address on other chain to redeem underlying assets to                                                                                        |
| chainId       | uint256         | which underlying chain to bridge assets onto                                                                                                 |
| token         | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                                                            |
| amount        | uint256         | Amount of (typically) LP token to pass to the nodes to attempt to removeLiquidity() with to redeem for the underlying assets of the LP token |
| liqTokenIndex | uint8           | Specifies which of the underlying LP assets the nodes should attempt to redeem for                                                           |
| liqMinAmount  | uint256         | Specifies the minimum amount of the underlying asset needed for the nodes to execute the redeem/swap                                         |
| liqDeadline   | uint256         | Specificies the deadline that the nodes are allowed to try to redeem/swap the LP token\*                                                     |

### redeemAndSwap

```solidity
function redeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint256 amount, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 minDy, uint256 deadline) external nonpayable
```

Wraps redeemAndSwap on SynapseBridge.sol Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain. This function indicates to the nodes that they should attempt to redeem the LP token for the underlying assets (E.g "swap" out of the LP token)

#### Parameters

| Name           | Type            | Description                                                                                             |
| -------------- | --------------- | ------------------------------------------------------------------------------------------------------- |
| to             | address         | address on other chain to redeem underlying assets to                                                   |
| chainId        | uint256         | which underlying chain to bridge assets onto                                                            |
| token          | contract IERC20 | ERC20 compatible token to deposit into the bridge                                                       |
| amount         | uint256         | Amount in native token decimals to transfer cross-chain pre-fees                                        |
| tokenIndexFrom | uint8           | the token the user wants to swap from                                                                   |
| tokenIndexTo   | uint8           | the token the user wants to swap to                                                                     |
| minDy          | uint256         | the min amount the user would like to receive, or revert to only minting the SynERC20 token crosschain. |
| deadline       | uint256         | latest timestamp to accept this transaction\*                                                           |

### redeemv2

```solidity
function redeemv2(bytes32 to, uint256 chainId, contract IERC20 token, uint256 amount) external nonpayable
```

Wraps SynapseBridge redeemv2() function

#### Parameters

| Name    | Type            | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| to      | bytes32         | address on other chain to bridge assets to                         |
| chainId | uint256         | which chain to bridge assets onto                                  |
| token   | contract IERC20 | ERC20 compatible token to redeem into the bridge                   |
| amount  | uint256         | Amount in native token decimals to transfer cross-chain pre-fees\* |

### swapAndRedeem

```solidity
function swapAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapAndRedeemAndRemove

```solidity
function swapAndRedeemAndRemove(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 liqTokenIndex, uint256 liqMinAmount, uint256 liqDeadline) external nonpayable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |
| liqTokenIndex  | uint8           | undefined   |
| liqMinAmount   | uint256         | undefined   |
| liqDeadline    | uint256         | undefined   |

### swapAndRedeemAndSwap

```solidity
function swapAndRedeemAndSwap(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline, uint8 swapTokenIndexFrom, uint8 swapTokenIndexTo, uint256 swapMinDy, uint256 swapDeadline) external nonpayable
```

#### Parameters

| Name               | Type            | Description |
| ------------------ | --------------- | ----------- |
| to                 | address         | undefined   |
| chainId            | uint256         | undefined   |
| token              | contract IERC20 | undefined   |
| tokenIndexFrom     | uint8           | undefined   |
| tokenIndexTo       | uint8           | undefined   |
| dx                 | uint256         | undefined   |
| minDy              | uint256         | undefined   |
| deadline           | uint256         | undefined   |
| swapTokenIndexFrom | uint8           | undefined   |
| swapTokenIndexTo   | uint8           | undefined   |
| swapMinDy          | uint256         | undefined   |
| swapDeadline       | uint256         | undefined   |

### swapETHAndRedeem

```solidity
function swapETHAndRedeem(address to, uint256 chainId, contract IERC20 token, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy, uint256 deadline) external payable
```

#### Parameters

| Name           | Type            | Description |
| -------------- | --------------- | ----------- |
| to             | address         | undefined   |
| chainId        | uint256         | undefined   |
| token          | contract IERC20 | undefined   |
| tokenIndexFrom | uint8           | undefined   |
| tokenIndexTo   | uint8           | undefined   |
| dx             | uint256         | undefined   |
| minDy          | uint256         | undefined   |
| deadline       | uint256         | undefined   |

### swapMap

```solidity
function swapMap(address) external view returns (address)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### swapTokensMap

```solidity
function swapTokensMap(address, uint256) external view returns (contract IERC20)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | uint256 | undefined   |

#### Returns

| Name | Type            | Description |
| ---- | --------------- | ----------- |
| \_0  | contract IERC20 | undefined   |


# messaging


# AuthVerifier

## Methods

### msgAuth

```solidity
function msgAuth(bytes _authData) external view returns (bool authenticated)
```

Authentication library to allow the validator network to execute cross-chain messages.

#### Parameters

| Name       | Type  | Description                                       |
| ---------- | ----- | ------------------------------------------------- |
| \_authData | bytes | A bytes32 address encoded via abi.encode(address) |

#### Returns

| Name          | Type | Description                                                                                         |
| ------------- | ---- | --------------------------------------------------------------------------------------------------- |
| authenticated | bool | returns true if bytes data submitted and decoded to the address is correct. Reverts if check fails. |

### nodegroup

```solidity
function nodegroup() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setNodeGroup

```solidity
function setNodeGroup(address _nodegroup) external nonpayable
```

Permissioned method to support upgrades to the library

#### Parameters

| Name        | Type    | Description                                          |
| ----------- | ------- | ---------------------------------------------------- |
| \_nodegroup | address | address which has authentication to execute messages |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# GasFeePricing

## Methods

### decodeOptions

```solidity
function decodeOptions(bytes _options) external pure returns (uint16, uint256, uint256, bytes32)
```

#### Parameters

| Name      | Type  | Description |
| --------- | ----- | ----------- |
| \_options | bytes | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint16  | undefined   |
| \_1  | uint256 | undefined   |
| \_2  | uint256 | undefined   |
| \_3  | bytes32 | undefined   |

### dstGasPriceInWei

```solidity
function dstGasPriceInWei(uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### dstGasTokenRatio

```solidity
function dstGasTokenRatio(uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### encodeOptions

```solidity
function encodeOptions(uint16 txType, uint256 gasLimit) external pure returns (bytes)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| txType   | uint16  | undefined   |
| gasLimit | uint256 | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | bytes | undefined   |

### encodeOptions

```solidity
function encodeOptions(uint16 txType, uint256 gasLimit, uint256 dstNativeAmt, bytes32 dstAddress) external pure returns (bytes)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| txType       | uint16  | undefined   |
| gasLimit     | uint256 | undefined   |
| dstNativeAmt | uint256 | undefined   |
| dstAddress   | bytes32 | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | bytes | undefined   |

### estimateGasFee

```solidity
function estimateGasFee(uint256 _dstChainId, bytes _options) external view returns (uint256)
```

Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit

#### Parameters

| Name         | Type    | Description                                                                                                                |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| \_dstChainId | uint256 | undefined                                                                                                                  |
| \_options    | bytes   | Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### setCostPerChain

```solidity
function setCostPerChain(uint256 _dstChainId, uint256 _gasUnitPrice, uint256 _gasTokenPriceRatio) external nonpayable
```

Permissioned method to allow an off-chain party to set what each dstChain's gas cost is priced in the srcChain's native gas currency. Example: call on ETH, setCostPerChain(43114, 30000000000, 25180000000000000) chain ID 43114 Average of 30 gwei cost to transaction on 43114 AVAX/ETH = 0.02518, scaled to gas in wei = 25180000000000000

#### Parameters

| Name                 | Type    | Description                                                                               |
| -------------------- | ------- | ----------------------------------------------------------------------------------------- |
| \_dstChainId         | uint256 | The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains |
| \_gasUnitPrice       | uint256 | The estimated current gas price in wei of the destination chain                           |
| \_gasTokenPriceRatio | uint256 | USD gas ratio of dstGasToken / srcGasToken                                                |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# MessageBus

## Methods

### authVerifier

```solidity
function authVerifier() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### computeMessageId

```solidity
function computeMessageId(address _srcAddress, uint256 _srcChainId, bytes32 _dstAddress, uint256 _dstChainId, uint256 _srcNonce, bytes _message) external view returns (bytes32)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_srcAddress | address | undefined   |
| \_srcChainId | uint256 | undefined   |
| \_dstAddress | bytes32 | undefined   |
| \_dstChainId | uint256 | undefined   |
| \_srcNonce   | uint256 | undefined   |
| \_message    | bytes   | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### estimateFee

```solidity
function estimateFee(uint256 _dstChainId, bytes _options) external nonpayable returns (uint256)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_dstChainId | uint256 | undefined   |
| \_options    | bytes   | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### executeMessage

```solidity
function executeMessage(uint256 _srcChainId, bytes32 _srcAddress, address _dstAddress, uint256 _gasLimit, uint256 _nonce, bytes _message, bytes32 _messageId) external nonpayable
```

Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain

#### Parameters

| Name         | Type    | Description                                                                                                             |
| ------------ | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| \_srcChainId | uint256 | Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains |
| \_srcAddress | bytes32 | Originating bytes32 address of the message sender on the srcChain                                                       |
| \_dstAddress | address | Destination address that the arbitrary message will be passed to                                                        |
| \_gasLimit   | uint256 | Gas limit to be passed alongside the message, depending on the fee paid on srcChain                                     |
| \_nonce      | uint256 | undefined                                                                                                               |
| \_message    | bytes   | Arbitrary message payload to pass to the destination chain receiver                                                     |
| \_messageId  | bytes32 | undefined                                                                                                               |

### fees

```solidity
function fees() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### gasFeePricing

```solidity
function gasFeePricing() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getExecutedMessage

```solidity
function getExecutedMessage(bytes32 _messageId) external view returns (enum MessageBusReceiver.TxStatus)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_messageId | bytes32 | undefined   |

#### Returns

| Name | Type                             | Description |
| ---- | -------------------------------- | ----------- |
| \_0  | enum MessageBusReceiver.TxStatus | undefined   |

### nonce

```solidity
function nonce() external view returns (uint64)
```

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | uint64 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### rescueGas

```solidity
function rescueGas(address payable to) external nonpayable
```

Rescues any gas in contract, aside from fees

#### Parameters

| Name | Type            | Description                       |
| ---- | --------------- | --------------------------------- |
| to   | address payable | Address to which to rescue gas to |

### sendMessage

```solidity
function sendMessage(bytes32 _receiver, uint256 _dstChainId, bytes _message, bytes _options) external payable
```

Sends a message to a receiving contract address on another chain. Sender must make sure that the message is unique and not a duplicate message.

#### Parameters

| Name         | Type    | Description                                                                               |
| ------------ | ------- | ----------------------------------------------------------------------------------------- |
| \_receiver   | bytes32 | The bytes32 address of the destination contract to be called                              |
| \_dstChainId | uint256 | The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains |
| \_message    | bytes   | The arbitrary payload to pass to the destination chain receiver                           |
| \_options    | bytes   | Versioned struct used to instruct relayer on how to proceed with gas limits               |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### updateAuthVerifier

```solidity
function updateAuthVerifier(address _authVerifier) external nonpayable
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| \_authVerifier | address | undefined   |

### updateGasFeePricing

```solidity
function updateGasFeePricing(address _gasFeePricing) external nonpayable
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| \_gasFeePricing | address | undefined   |

### updateMessageStatus

```solidity
function updateMessageStatus(bytes32 _messageId, enum MessageBusReceiver.TxStatus _status) external nonpayable
```

CONTRACT CONFIG

#### Parameters

| Name        | Type                             | Description |
| ----------- | -------------------------------- | ----------- |
| \_messageId | bytes32                          | undefined   |
| \_status    | enum MessageBusReceiver.TxStatus | undefined   |

### withdrawGasFees

```solidity
function withdrawGasFees(address payable to) external nonpayable
```

Withdraws accumulated fees in native gas token, based on fees variable.

#### Parameters

| Name | Type            | Description                                                                                           |
| ---- | --------------- | ----------------------------------------------------------------------------------------------------- |
| to   | address payable | Address to withdraw gas fees to, which can be specified in the event owner() can't receive native gas |

## Events

### CallReverted

```solidity
event CallReverted(string reason)
```

#### Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| reason | string | undefined   |

### Executed

```solidity
event Executed(bytes32 indexed messageId, enum MessageBusReceiver.TxStatus status, address indexed _dstAddress, uint64 srcChainId, uint64 srcNonce)
```

#### Parameters

| Name                   | Type                             | Description |
| ---------------------- | -------------------------------- | ----------- |
| messageId `indexed`    | bytes32                          | undefined   |
| status                 | enum MessageBusReceiver.TxStatus | undefined   |
| \_dstAddress `indexed` | address                          | undefined   |
| srcChainId             | uint64                           | undefined   |
| srcNonce               | uint64                           | undefined   |

### MessageSent

```solidity
event MessageSent(address indexed sender, uint256 srcChainID, bytes32 receiver, uint256 indexed dstChainId, bytes message, uint64 nonce, bytes options, uint256 fee, bytes32 indexed messageId)
```

#### Parameters

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| sender `indexed`     | address | undefined   |
| srcChainID           | uint256 | undefined   |
| receiver             | bytes32 | undefined   |
| dstChainId `indexed` | uint256 | undefined   |
| message              | bytes   | undefined   |
| nonce                | uint64  | undefined   |
| options              | bytes   | undefined   |
| fee                  | uint256 | undefined   |
| messageId `indexed`  | bytes32 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# MessageBusReceiver

## Methods

### authVerifier

```solidity
function authVerifier() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### executeMessage

```solidity
function executeMessage(uint256 _srcChainId, bytes32 _srcAddress, address _dstAddress, uint256 _gasLimit, uint256 _nonce, bytes _message, bytes32 _messageId) external nonpayable
```

Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain

#### Parameters

| Name         | Type    | Description                                                                                                             |
| ------------ | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| \_srcChainId | uint256 | Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains |
| \_srcAddress | bytes32 | Originating bytes32 address of the message sender on the srcChain                                                       |
| \_dstAddress | address | Destination address that the arbitrary message will be passed to                                                        |
| \_gasLimit   | uint256 | Gas limit to be passed alongside the message, depending on the fee paid on srcChain                                     |
| \_nonce      | uint256 | undefined                                                                                                               |
| \_message    | bytes   | Arbitrary message payload to pass to the destination chain receiver                                                     |
| \_messageId  | bytes32 | undefined                                                                                                               |

### getExecutedMessage

```solidity
function getExecutedMessage(bytes32 _messageId) external view returns (enum MessageBusReceiver.TxStatus)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_messageId | bytes32 | undefined   |

#### Returns

| Name | Type                             | Description |
| ---- | -------------------------------- | ----------- |
| \_0  | enum MessageBusReceiver.TxStatus | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### updateAuthVerifier

```solidity
function updateAuthVerifier(address _authVerifier) external nonpayable
```

#### Parameters

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| \_authVerifier | address | undefined   |

### updateMessageStatus

```solidity
function updateMessageStatus(bytes32 _messageId, enum MessageBusReceiver.TxStatus _status) external nonpayable
```

CONTRACT CONFIG

#### Parameters

| Name        | Type                             | Description |
| ----------- | -------------------------------- | ----------- |
| \_messageId | bytes32                          | undefined   |
| \_status    | enum MessageBusReceiver.TxStatus | undefined   |

## Events

### CallReverted

```solidity
event CallReverted(string reason)
```

#### Parameters

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| reason | string | undefined   |

### Executed

```solidity
event Executed(bytes32 indexed messageId, enum MessageBusReceiver.TxStatus status, address indexed _dstAddress, uint64 srcChainId, uint64 srcNonce)
```

#### Parameters

| Name                   | Type                             | Description |
| ---------------------- | -------------------------------- | ----------- |
| messageId `indexed`    | bytes32                          | undefined   |
| status                 | enum MessageBusReceiver.TxStatus | undefined   |
| \_dstAddress `indexed` | address                          | undefined   |
| srcChainId             | uint64                           | undefined   |
| srcNonce               | uint64                           | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# MessageBusSender

## Methods

### computeMessageId

```solidity
function computeMessageId(address _srcAddress, uint256 _srcChainId, bytes32 _dstAddress, uint256 _dstChainId, uint256 _srcNonce, bytes _message) external view returns (bytes32)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_srcAddress | address | undefined   |
| \_srcChainId | uint256 | undefined   |
| \_dstAddress | bytes32 | undefined   |
| \_dstChainId | uint256 | undefined   |
| \_srcNonce   | uint256 | undefined   |
| \_message    | bytes   | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### estimateFee

```solidity
function estimateFee(uint256 _dstChainId, bytes _options) external nonpayable returns (uint256)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_dstChainId | uint256 | undefined   |
| \_options    | bytes   | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### fees

```solidity
function fees() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### gasFeePricing

```solidity
function gasFeePricing() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### nonce

```solidity
function nonce() external view returns (uint64)
```

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | uint64 | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### rescueGas

```solidity
function rescueGas(address payable to) external nonpayable
```

Rescues any gas in contract, aside from fees

#### Parameters

| Name | Type            | Description                       |
| ---- | --------------- | --------------------------------- |
| to   | address payable | Address to which to rescue gas to |

### sendMessage

```solidity
function sendMessage(bytes32 _receiver, uint256 _dstChainId, bytes _message, bytes _options) external payable
```

Sends a message to a receiving contract address on another chain. Sender must make sure that the message is unique and not a duplicate message.

#### Parameters

| Name         | Type    | Description                                                                               |
| ------------ | ------- | ----------------------------------------------------------------------------------------- |
| \_receiver   | bytes32 | The bytes32 address of the destination contract to be called                              |
| \_dstChainId | uint256 | The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains |
| \_message    | bytes   | The arbitrary payload to pass to the destination chain receiver                           |
| \_options    | bytes   | Versioned struct used to instruct relayer on how to proceed with gas limits               |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

### updateGasFeePricing

```solidity
function updateGasFeePricing(address _gasFeePricing) external nonpayable
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| \_gasFeePricing | address | undefined   |

### withdrawGasFees

```solidity
function withdrawGasFees(address payable to) external nonpayable
```

Withdraws accumulated fees in native gas token, based on fees variable.

#### Parameters

| Name | Type            | Description                                                                                           |
| ---- | --------------- | ----------------------------------------------------------------------------------------------------- |
| to   | address payable | Address to withdraw gas fees to, which can be specified in the event owner() can't receive native gas |

## Events

### MessageSent

```solidity
event MessageSent(address indexed sender, uint256 srcChainID, bytes32 receiver, uint256 indexed dstChainId, bytes message, uint64 nonce, bytes options, uint256 fee, bytes32 indexed messageId)
```

#### Parameters

| Name                 | Type    | Description |
| -------------------- | ------- | ----------- |
| sender `indexed`     | address | undefined   |
| srcChainID           | uint256 | undefined   |
| receiver             | bytes32 | undefined   |
| dstChainId `indexed` | uint256 | undefined   |
| message              | bytes   | undefined   |
| nonce                | uint64  | undefined   |
| options              | bytes   | undefined   |
| fee                  | uint256 | undefined   |
| messageId `indexed`  | bytes32 | undefined   |

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |


# apps


# BatchMessageSender

> Example app of sending multiple messages in one transaction

## Methods

### executeMessage

```solidity
function executeMessage(bytes32 _srcAddress, uint256 _srcChainId, bytes _message, address _executor) external nonpayable
```

Executes a message called by MessageBus (MessageBusReceiver)

*Must be called by MessageBug & sent from src chain by a trusted srcApp*

#### Parameters

| Name         | Type    | Description                                                                    |
| ------------ | ------- | ------------------------------------------------------------------------------ |
| \_srcAddress | bytes32 | The bytes32 address of the source app contract                                 |
| \_srcChainId | uint256 | The source chain ID where the transfer is originated from                      |
| \_message    | bytes   | Arbitrary message bytes originated from and encoded by the source app contract |
| \_executor   | address | Address who called the MessageBus execution function                           |

### getTrustedRemote

```solidity
function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_chainId | uint256 | undefined   |

#### Returns

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| trustedRemote | bytes32 | undefined   |

### messageBus

```solidity
function messageBus() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

*Returns the address of the current owner.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

*Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.*

### sendMultipleMessages

```solidity
function sendMultipleMessages(bytes32[] _receiver, uint256[] _dstChainId, bytes[] _message, bytes[] _options) external payable
```

#### Parameters

| Name         | Type       | Description |
| ------------ | ---------- | ----------- |
| \_receiver   | bytes32\[] | undefined   |
| \_dstChainId | uint256\[] | undefined   |
| \_message    | bytes\[]   | undefined   |
| \_options    | bytes\[]   | undefined   |

### setMessageBus

```solidity
function setMessageBus(address _messageBus) external nonpayable
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_messageBus | address | undefined   |

### setTrustedRemote

```solidity
function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external nonpayable
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_srcChainId | uint256 | undefined   |
| \_srcAddress | bytes32 | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

*Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |

## Events

### OwnershipTransferred

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
```

#### Parameters

| Name                    | Type    | Description |
| ----------------------- | ------- | ----------- |
| previousOwner `indexed` | address | undefined   |
| newOwner `indexed`      | address | undefined   |

### SetTrustedRemote

```solidity
event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| \_srcChainId | uint256 | undefined   |
| \_srcAddress | bytes32 | undefined   |


# PingPong

## Methods

### disable

```solidity
function disable() external nonpayable
```

### executeMessage

```solidity
function executeMessage(bytes32 _srcAddress, uint256 _srcChainId, bytes _message, address _executor) external nonpayable
```

Called by MessageBus (MessageBusReceiver)

#### Parameters

| Name         | Type    | Description                                                                    |
| ------------ | ------- | ------------------------------------------------------------------------------ |
| \_srcAddress | bytes32 | The bytes32 address of the source app contract                                 |
| \_srcChainId | uint256 | The source chain ID where the transfer is originated from                      |
| \_message    | bytes   | Arbitrary message bytes originated from and encoded by the source app contract |
| \_executor   | address | Address who called the MessageBus execution function                           |

### maxPings

```solidity
function maxPings() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### messageBus

```solidity
function messageBus() external view returns (contract IMessageBus)
```

#### Returns

| Name | Type                 | Description |
| ---- | -------------------- | ----------- |
| \_0  | contract IMessageBus | undefined   |

### numPings

```solidity
function numPings() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### ping

```solidity
function ping(uint256 _dstChainId, address _dstPingPongAddr, uint256 pings) external nonpayable
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| \_dstChainId      | uint256 | undefined   |
| \_dstPingPongAddr | address | undefined   |
| pings             | uint256 | undefined   |

### pingsEnabled

```solidity
function pingsEnabled() external view returns (bool)
```

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### Ping

```solidity
event Ping(uint256 pings)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| pings | uint256 | undefined   |


# dfk


# HeroCoreUpgradeable

*Frisky Fox - Defi Kingdoms*

> Core contract for Heroes.

*Holds the base structs, events, and data.*

## Methods

### BRIDGE\_ROLE

```solidity
function BRIDGE_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### HERO\_MODERATOR\_ROLE

```solidity
function HERO_MODERATOR_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MINTER\_ROLE

```solidity
function MINTER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MODERATOR\_ROLE

```solidity
function MODERATOR_ROLE() external view returns (bytes32)
```

ROLES ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### approve

```solidity
function approve(address to, uint256 tokenId) external nonpayable
```

*See {IERC721-approve}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### balanceOf

```solidity
function balanceOf(address owner) external view returns (uint256)
```

*See {IERC721-balanceOf}.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### bridgeMint

```solidity
function bridgeMint(uint256 _id, address _to) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_id | uint256 | undefined   |
| \_to | address | undefined   |

### createHero

```solidity
function createHero(uint256 _statGenes, uint256 _visualGenes, enum Rarity _rarity, bool _shiny, HeroCrystal _crystal, uint256 _crystalId) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type        | Description |
| ------------- | ----------- | ----------- |
| \_statGenes   | uint256     | undefined   |
| \_visualGenes | uint256     | undefined   |
| \_rarity      | enum Rarity | undefined   |
| \_shiny       | bool        | undefined   |
| \_crystal     | HeroCrystal | undefined   |
| \_crystalId   | uint256     | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getApproved

```solidity
function getApproved(uint256 tokenId) external view returns (address)
```

*See {IERC721-getApproved}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getHero

```solidity
function getHero(uint256 _id) external view returns (struct Hero)
```

*Gets a hero object.*

#### Parameters

| Name | Type    | Description  |
| ---- | ------- | ------------ |
| \_id | uint256 | The hero id. |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | Hero | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getUserHeroes

```solidity
function getUserHeroes(address _address) external view returns (struct Hero[])
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_address | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | Hero\[] | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### heroes

```solidity
function heroes(uint256) external view returns (uint256 id, struct SummoningInfo summoningInfo, struct HeroInfo info, struct HeroState state, struct HeroStats stats, struct HeroStatGrowth primaryStatGrowth, struct HeroStatGrowth secondaryStatGrowth, struct HeroProfessions professions)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name                | Type            | Description |
| ------------------- | --------------- | ----------- |
| id                  | uint256         | undefined   |
| summoningInfo       | SummoningInfo   | undefined   |
| info                | HeroInfo        | undefined   |
| state               | HeroState       | undefined   |
| stats               | HeroStats       | undefined   |
| primaryStatGrowth   | HeroStatGrowth  | undefined   |
| secondaryStatGrowth | HeroStatGrowth  | undefined   |
| professions         | HeroProfessions | undefined   |

### initialize

```solidity
function initialize(string _name, string _symbol, address _statScience) external nonpayable
```

*The initialize function is the constructor for upgradeable contracts.*

#### Parameters

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| \_name        | string  | undefined   |
| \_symbol      | string  | undefined   |
| \_statScience | address | undefined   |

### isApprovedForAll

```solidity
function isApprovedForAll(address owner, address operator) external view returns (bool)
```

*See {IERC721-isApprovedForAll}.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| owner    | address | undefined   |
| operator | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### name

```solidity
function name() external view returns (string)
```

*See {IERC721Metadata-name}.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### nextHeroId

```solidity
function nextHeroId() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### ownerOf

```solidity
function ownerOf(uint256 tokenId) external view returns (address)
```

*See {IERC721-ownerOf}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

*ADMIN FUNCTION ///*

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
```

*See {IERC721-safeTransferFrom}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) external nonpayable
```

*See {IERC721-safeTransferFrom}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |
| \_data  | bytes   | undefined   |

### setApprovalForAll

```solidity
function setApprovalForAll(address operator, bool approved) external nonpayable
```

*See {IERC721-setApprovalForAll}.*

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| operator | address | undefined   |
| approved | bool    | undefined   |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### symbol

```solidity
function symbol() external view returns (string)
```

*See {IERC721Metadata-symbol}.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### tokenByIndex

```solidity
function tokenByIndex(uint256 index) external view returns (uint256)
```

*See {IERC721Enumerable-tokenByIndex}.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### tokenOfOwnerByIndex

```solidity
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)
```

*See {IERC721Enumerable-tokenOfOwnerByIndex}.*

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### tokenURI

```solidity
function tokenURI(uint256 tokenId) external view returns (string)
```

*See {IERC721Metadata-tokenURI}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

*See {IERC721Enumerable-totalSupply}.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transferFrom

```solidity
function transferFrom(address from, address to, uint256 tokenId) external nonpayable
```

*See {IERC721-transferFrom}.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### updateHero

```solidity
function updateHero(Hero _hero) external nonpayable
```

#### Parameters

| Name   | Type | Description |
| ------ | ---- | ----------- |
| \_hero | Hero | undefined   |

## Events

### Approval

```solidity
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| owner `indexed`    | address | undefined   |
| approved `indexed` | address | undefined   |
| tokenId `indexed`  | uint256 | undefined   |

### ApprovalForAll

```solidity
event ApprovalForAll(address indexed owner, address indexed operator, bool approved)
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| owner `indexed`    | address | undefined   |
| operator `indexed` | address | undefined   |
| approved           | bool    | undefined   |

### HeroSummoned

```solidity
event HeroSummoned(address indexed owner, uint256 heroId, uint256 summonerId, uint256 assistantId, uint256 statGenes, uint256 visualGenes)
```

EVENTS ///

*The HeroSummoned event is fired whenever a new hero is created.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| owner `indexed` | address | undefined   |
| heroId          | uint256 | undefined   |
| summonerId      | uint256 | undefined   |
| assistantId     | uint256 | undefined   |
| statGenes       | uint256 | undefined   |
| visualGenes     | uint256 | undefined   |

### HeroUpdated

```solidity
event HeroUpdated(address indexed owner, uint256 heroId, Hero hero)
```

*The HeroUpdated event is fired whenever a hero is updated.*

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| owner `indexed` | address | undefined   |
| heroId          | uint256 | undefined   |
| hero            | Hero    | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### Transfer

```solidity
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| from `indexed`    | address | undefined   |
| to `indexed`      | address | undefined   |
| tokenId `indexed` | uint256 | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# IAssistingAuction

## Methods

### bid

```solidity
function bid(uint256 _tokenId, uint256 _bidAmount) external nonpayable
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_tokenId   | uint256 | undefined   |
| \_bidAmount | uint256 | undefined   |

### bidFor

```solidity
function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount) external nonpayable
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_bidder    | address | undefined   |
| \_tokenId   | uint256 | undefined   |
| \_bidAmount | uint256 | undefined   |

### cancelAuction

```solidity
function cancelAuction(uint256 _tokenId) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

### cancelAuctionWhenPaused

```solidity
function cancelAuctionWhenPaused(uint256 _tokenId) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

### createAuction

```solidity
function createAuction(uint256 _tokenId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration) external nonpayable
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| \_tokenId       | uint256 | undefined   |
| \_startingPrice | uint256 | undefined   |
| \_endingPrice   | uint256 | undefined   |
| \_duration      | uint256 | undefined   |

### getAuction

```solidity
function getAuction(uint256 _tokenId) external view returns (address seller, uint256 startingPrice, uint256 endingPrice, uint256 duration, uint256 startedAt)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

#### Returns

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| seller        | address | undefined   |
| startingPrice | uint256 | undefined   |
| endingPrice   | uint256 | undefined   |
| duration      | uint256 | undefined   |
| startedAt     | uint256 | undefined   |

### getCurrentPrice

```solidity
function getCurrentPrice(uint256 _tokenId) external view returns (uint256)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### heroCore

```solidity
function heroCore() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### isOnAuction

```solidity
function isOnAuction(uint256 _tokenId) external nonpayable returns (bool)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### jewelToken

```solidity
function jewelToken() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### owner

```solidity
function owner() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### ownerCut

```solidity
function ownerCut() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### paused

```solidity
function paused() external view returns (bool)
```

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceOwnership

```solidity
function renounceOwnership() external nonpayable
```

### setFees

```solidity
function setFees(address[] _feeAddresses, uint256[] _feePercents) external nonpayable
```

#### Parameters

| Name           | Type       | Description |
| -------------- | ---------- | ----------- |
| \_feeAddresses | address\[] | undefined   |
| \_feePercents  | uint256\[] | undefined   |

### transferOwnership

```solidity
function transferOwnership(address newOwner) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| newOwner | address | undefined   |


# IHeroCoreUpgradeable

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### HERO\_MODERATOR\_ROLE

```solidity
function HERO_MODERATOR_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MINTER\_ROLE

```solidity
function MINTER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### MODERATOR\_ROLE

```solidity
function MODERATOR_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### PAUSER\_ROLE

```solidity
function PAUSER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### STAMINA\_ROLE

```solidity
function STAMINA_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### approve

```solidity
function approve(address to, uint256 tokenId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### assistingAuction

```solidity
function assistingAuction() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### balanceOf

```solidity
function balanceOf(address owner) external view returns (uint256)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### baseCooldown

```solidity
function baseCooldown() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### baseSummonFee

```solidity
function baseSummonFee() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### bridgeMint

```solidity
function bridgeMint(uint256 _id, address _to) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_id | uint256 | undefined   |
| \_to | address | undefined   |

### burn

```solidity
function burn(uint256 tokenId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

### calculateSummoningCost

```solidity
function calculateSummoningCost(uint256 _heroId) external view returns (uint256)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_heroId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### cooldownPerGen

```solidity
function cooldownPerGen() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### cooldownPerSummon

```solidity
function cooldownPerSummon() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### cooldowns

```solidity
function cooldowns(uint256) external view returns (uint32)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | uint32 | undefined   |

### createAssistingAuction

```solidity
function createAssistingAuction(uint256 _heroId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration) external nonpayable
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| \_heroId        | uint256 | undefined   |
| \_startingPrice | uint256 | undefined   |
| \_endingPrice   | uint256 | undefined   |
| \_duration      | uint256 | undefined   |

### createHero

```solidity
function createHero(uint256 _statGenes, uint256 _visualGenes, enum Rarity _rarity, bool _shiny, HeroCrystal _crystal, uint256 _crystalId) external nonpayable returns (uint256)
```

#### Parameters

| Name          | Type        | Description |
| ------------- | ----------- | ----------- |
| \_statGenes   | uint256     | undefined   |
| \_visualGenes | uint256     | undefined   |
| \_rarity      | enum Rarity | undefined   |
| \_shiny       | bool        | undefined   |
| \_crystal     | HeroCrystal | undefined   |
| \_crystalId   | uint256     | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### createSaleAuction

```solidity
function createSaleAuction(uint256 _heroId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration) external nonpayable
```

#### Parameters

| Name            | Type    | Description |
| --------------- | ------- | ----------- |
| \_heroId        | uint256 | undefined   |
| \_startingPrice | uint256 | undefined   |
| \_endingPrice   | uint256 | undefined   |
| \_duration      | uint256 | undefined   |

### crystalToken

```solidity
function crystalToken() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### deductStamina

```solidity
function deductStamina(uint256 _heroId, uint256 _staminaDeduction) external nonpayable
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| \_heroId           | uint256 | undefined   |
| \_staminaDeduction | uint256 | undefined   |

### extractNumber

```solidity
function extractNumber(uint256 randomNumber, uint256 digits, uint256 offset) external pure returns (uint256 result)
```

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| randomNumber | uint256 | undefined   |
| digits       | uint256 | undefined   |
| offset       | uint256 | undefined   |

#### Returns

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| result | uint256 | undefined   |

### geneScience

```solidity
function geneScience() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getApproved

```solidity
function getApproved(uint256 tokenId) external view returns (address)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getCurrentStamina

```solidity
function getCurrentStamina(uint256 _heroId) external view returns (uint256)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_heroId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getHero

```solidity
function getHero(uint256 _id) external view returns (struct Hero)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_id | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | Hero | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getRoleMember

```solidity
function getRoleMember(bytes32 role, uint256 index) external view returns (address)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| role  | bytes32 | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### getRoleMemberCount

```solidity
function getRoleMemberCount(bytes32 role) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### increasePerGen

```solidity
function increasePerGen() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### increasePerSummon

```solidity
function increasePerSummon() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### initialize

```solidity
function initialize(string name, string symbol, string baseTokenURI) external nonpayable
```

#### Parameters

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| name         | string | undefined   |
| symbol       | string | undefined   |
| baseTokenURI | string | undefined   |

### initialize

```solidity
function initialize(address _crystalAddress) external nonpayable
```

#### Parameters

| Name             | Type    | Description |
| ---------------- | ------- | ----------- |
| \_crystalAddress | address | undefined   |

### isApprovedForAll

```solidity
function isApprovedForAll(address owner, address operator) external view returns (bool)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| owner    | address | undefined   |
| operator | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### isReadyToSummon

```solidity
function isReadyToSummon(uint256 _heroId) external view returns (bool)
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| \_heroId | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### mint

```solidity
function mint(address to) external nonpayable
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| to   | address | undefined   |

### name

```solidity
function name() external view returns (string)
```

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### openCrystal

```solidity
function openCrystal(uint256 _crystalId) external nonpayable returns (uint256)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| \_crystalId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### ownerOf

```solidity
function ownerOf(uint256 tokenId) external view returns (address)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### safeTransferFrom

```solidity
function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |
| \_data  | bytes   | undefined   |

### saleAuction

```solidity
function saleAuction() external view returns (address)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### setApprovalForAll

```solidity
function setApprovalForAll(address operator, bool approved) external nonpayable
```

#### Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| operator | address | undefined   |
| approved | bool    | undefined   |

### setAssistingAuctionAddress

```solidity
function setAssistingAuctionAddress(address _address) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_address | address | undefined   |

### setFees

```solidity
function setFees(address[] _feeAddresses, uint256[] _feePercents) external nonpayable
```

#### Parameters

| Name           | Type       | Description |
| -------------- | ---------- | ----------- |
| \_feeAddresses | address\[] | undefined   |
| \_feePercents  | uint256\[] | undefined   |

### setSaleAuctionAddress

```solidity
function setSaleAuctionAddress(address _address) external nonpayable
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_address | address | undefined   |

### setSummonCooldowns

```solidity
function setSummonCooldowns(uint256 _baseCooldown, uint256 _cooldownPerSummon, uint256 _cooldownPerGen) external nonpayable
```

#### Parameters

| Name                | Type    | Description |
| ------------------- | ------- | ----------- |
| \_baseCooldown      | uint256 | undefined   |
| \_cooldownPerSummon | uint256 | undefined   |
| \_cooldownPerGen    | uint256 | undefined   |

### setSummonFees

```solidity
function setSummonFees(uint256 _baseSummonFee, uint256 _increasePerSummon, uint256 _increasePerGen) external nonpayable
```

#### Parameters

| Name                | Type    | Description |
| ------------------- | ------- | ----------- |
| \_baseSummonFee     | uint256 | undefined   |
| \_increasePerSummon | uint256 | undefined   |
| \_increasePerGen    | uint256 | undefined   |

### setTimePerStamina

```solidity
function setTimePerStamina(uint256 _timePerStamina) external nonpayable
```

#### Parameters

| Name             | Type    | Description |
| ---------------- | ------- | ----------- |
| \_timePerStamina | uint256 | undefined   |

### summonCrystal

```solidity
function summonCrystal(uint256 _summonerId, uint256 _assistantId, uint8 _summonerTears, uint8 _assistantTears, address _enhancementStone) external nonpayable
```

#### Parameters

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| \_summonerId       | uint256 | undefined   |
| \_assistantId      | uint256 | undefined   |
| \_summonerTears    | uint8   | undefined   |
| \_assistantTears   | uint8   | undefined   |
| \_enhancementStone | address | undefined   |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### symbol

```solidity
function symbol() external view returns (string)
```

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### timePerStamina

```solidity
function timePerStamina() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### tokenByIndex

```solidity
function tokenByIndex(uint256 index) external view returns (uint256)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### tokenOfOwnerByIndex

```solidity
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256)
```

#### Parameters

| Name  | Type    | Description |
| ----- | ------- | ----------- |
| owner | address | undefined   |
| index | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### tokenURI

```solidity
function tokenURI(uint256 tokenId) external view returns (string)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| tokenId | uint256 | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | string | undefined   |

### totalSupply

```solidity
function totalSupply() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### transferFrom

```solidity
function transferFrom(address from, address to, uint256 tokenId) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| from    | address | undefined   |
| to      | address | undefined   |
| tokenId | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### updateHero

```solidity
function updateHero(Hero _hero) external nonpayable
```

#### Parameters

| Name   | Type | Description |
| ------ | ---- | ----------- |
| \_hero | Hero | undefined   |

### vrf

```solidity
function vrf(uint256 blockNumber) external view returns (bytes32 result)
```

#### Parameters

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| blockNumber | uint256 | undefined   |

#### Returns

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| result | bytes32 | undefined   |


# IStatScienceUpgradeable

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### WHITELIST\_ROLE

```solidity
function WHITELIST_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### augmentStat

```solidity
function augmentStat(HeroStats _stats, uint256 _stat, uint8 _increase) external pure returns (struct HeroStats)
```

#### Parameters

| Name       | Type      | Description |
| ---------- | --------- | ----------- |
| \_stats    | HeroStats | undefined   |
| \_stat     | uint256   | undefined   |
| \_increase | uint8     | undefined   |

#### Returns

| Name | Type      | Description |
| ---- | --------- | ----------- |
| \_0  | HeroStats | undefined   |

### generateStatGrowth

```solidity
function generateStatGrowth(uint256 _statGenes, HeroCrystal, enum Rarity, bool _isPrimary) external pure returns (struct HeroStatGrowth)
```

#### Parameters

| Name        | Type        | Description |
| ----------- | ----------- | ----------- |
| \_statGenes | uint256     | undefined   |
| \_1         | HeroCrystal | undefined   |
| \_2         | enum Rarity | undefined   |
| \_isPrimary | bool        | undefined   |

#### Returns

| Name | Type           | Description |
| ---- | -------------- | ----------- |
| \_0  | HeroStatGrowth | undefined   |

### generateStats

```solidity
function generateStats(uint256 _statGenes, HeroCrystal _crystal, enum Rarity _rarity, uint256 _crystalId) external nonpayable returns (struct HeroStats)
```

#### Parameters

| Name        | Type        | Description |
| ----------- | ----------- | ----------- |
| \_statGenes | uint256     | undefined   |
| \_crystal   | HeroCrystal | undefined   |
| \_rarity    | enum Rarity | undefined   |
| \_crystalId | uint256     | undefined   |

#### Returns

| Name | Type      | Description |
| ---- | --------- | ----------- |
| \_0  | HeroStats | undefined   |

### getGene

```solidity
function getGene(uint256 _genes, uint8 _position) external pure returns (uint8)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| \_genes    | uint256 | undefined   |
| \_position | uint8   | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getJobTier

```solidity
function getJobTier(uint8 _class) external pure returns (enum JobTier)
```

#### Parameters

| Name    | Type  | Description |
| ------- | ----- | ----------- |
| \_class | uint8 | undefined   |

#### Returns

| Name | Type         | Description |
| ---- | ------------ | ----------- |
| \_0  | enum JobTier | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |


# StatScienceUpgradeable

*Frisky Fox - Defi Kingdoms*

> StatScience contains the logic to calculate starting stats.

## Methods

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### WHITELIST\_ROLE

```solidity
function WHITELIST_ROLE() external view returns (bytes32)
```

ROLES ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### addRarityBonus

```solidity
function addRarityBonus(HeroStats _heroStats, enum Rarity _rarity, HeroCrystal _crystal, uint256 _crystalId) external nonpayable returns (struct HeroStats, uint8[8])
```

#### Parameters

| Name        | Type        | Description |
| ----------- | ----------- | ----------- |
| \_heroStats | HeroStats   | undefined   |
| \_rarity    | enum Rarity | undefined   |
| \_crystal   | HeroCrystal | undefined   |
| \_crystalId | uint256     | undefined   |

#### Returns

| Name | Type      | Description |
| ---- | --------- | ----------- |
| \_0  | HeroStats | undefined   |
| \_1  | uint8\[8] | undefined   |

### augmentStat

```solidity
function augmentStat(HeroStats _stats, uint256 _stat, uint8 _increase) external pure returns (struct HeroStats)
```

#### Parameters

| Name       | Type      | Description |
| ---------- | --------- | ----------- |
| \_stats    | HeroStats | undefined   |
| \_stat     | uint256   | undefined   |
| \_increase | uint8     | undefined   |

#### Returns

| Name | Type      | Description |
| ---- | --------- | ----------- |
| \_0  | HeroStats | undefined   |

### generateStatGrowth

```solidity
function generateStatGrowth(uint256 _statGenes, HeroCrystal, enum Rarity, bool _isPrimary) external pure returns (struct HeroStatGrowth)
```

#### Parameters

| Name        | Type        | Description |
| ----------- | ----------- | ----------- |
| \_statGenes | uint256     | undefined   |
| \_1         | HeroCrystal | undefined   |
| \_2         | enum Rarity | undefined   |
| \_isPrimary | bool        | undefined   |

#### Returns

| Name | Type           | Description |
| ---- | -------------- | ----------- |
| \_0  | HeroStatGrowth | undefined   |

### generateStats

```solidity
function generateStats(uint256 _statGenes, HeroCrystal _crystal, enum Rarity _rarity, uint256 _crystalId) external nonpayable returns (struct HeroStats)
```

#### Parameters

| Name        | Type        | Description |
| ----------- | ----------- | ----------- |
| \_statGenes | uint256     | undefined   |
| \_crystal   | HeroCrystal | undefined   |
| \_rarity    | enum Rarity | undefined   |
| \_crystalId | uint256     | undefined   |

#### Returns

| Name | Type      | Description |
| ---- | --------- | ----------- |
| \_0  | HeroStats | undefined   |

### getGene

```solidity
function getGene(uint256 _genes, uint8 _position) external pure returns (uint8)
```

#### Parameters

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| \_genes    | uint256 | undefined   |
| \_position | uint8   | undefined   |

#### Returns

| Name | Type  | Description |
| ---- | ----- | ----------- |
| \_0  | uint8 | undefined   |

### getJobTier

```solidity
function getJobTier(uint8 _class) external pure returns (enum JobTier)
```

*Gets the job tier for genes.*

#### Parameters

| Name    | Type  | Description |
| ------- | ----- | ----------- |
| \_class | uint8 | undefined   |

#### Returns

| Name | Type         | Description |
| ---- | ------------ | ----------- |
| \_0  | enum JobTier | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

*See {IERC165-supportsInterface}.*

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

## Events

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |


# auctions


# AssistingAuctionUpgradeable

> Reverse auction modified for assisting

We omit a fallback function to prevent accidental sends to this contract.

## Methods

### BIDDER\_ROLE

```solidity
function BIDDER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### ERC721

```solidity
function ERC721() external view returns (contract IERC721Upgradeable)
```

CONTRACTS ///

#### Returns

| Name | Type                        | Description |
| ---- | --------------------------- | ----------- |
| \_0  | contract IERC721Upgradeable | undefined   |

### MODERATOR\_ROLE

```solidity
function MODERATOR_ROLE() external view returns (bytes32)
```

ROLES ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### auctionIdOffset

```solidity
function auctionIdOffset() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### auctions

```solidity
function auctions(uint256) external view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| seller        | address | undefined   |
| tokenId       | uint256 | undefined   |
| startingPrice | uint128 | undefined   |
| endingPrice   | uint128 | undefined   |
| duration      | uint64  | undefined   |
| startedAt     | uint64  | undefined   |
| winner        | address | undefined   |
| open          | bool    | undefined   |

### bid

```solidity
function bid(uint256, uint256) external view
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |
| \_1  | uint256 | undefined   |

### bidFor

```solidity
function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount) external nonpayable
```

*Bids on an open auction, completing the auction if enough JEWELs are supplied.*

#### Parameters

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| \_bidder    | address | undefined                |
| \_tokenId   | uint256 | - ID of token to bid on. |
| \_bidAmount | uint256 | The bid amount.          |

### cancelAuction

```solidity
function cancelAuction(uint256 _tokenId) external nonpayable
```

This is a state-modifying function that can be called while the contract is paused.depending on if the auction is escrow or not this might need to verify ownership

*Cancels an auction that hasn't been won yet. Returns the NFT to original owner.*

#### Parameters

| Name      | Type    | Description              |
| --------- | ------- | ------------------------ |
| \_tokenId | uint256 | - ID of token on auction |

### cancelAuctionWhenPaused

```solidity
function cancelAuctionWhenPaused(uint256 _tokenId) external nonpayable
```

*Cancels an auction when the contract is paused. Only the owner may do this, and NFTs are returned to the seller. This should only be used in emergencies.*

#### Parameters

| Name      | Type    | Description                           |
| --------- | ------- | ------------------------------------- |
| \_tokenId | uint256 | - ID of the NFT on auction to cancel. |

### createAuction

```solidity
function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner) external nonpayable
```

*Creates and begins a new auction. This can either escrow or not depending on implementation but should at the very least call \_addAuction and check ownership*

#### Parameters

| Name            | Type    | Description                                         |
| --------------- | ------- | --------------------------------------------------- |
| \_tokenId       | uint256 | - ID of token to auction, sender must be owner.     |
| \_startingPrice | uint128 | - Price of item (in wei) at beginning of auction.   |
| \_endingPrice   | uint128 | - Price of item (in wei) at end of auction.         |
| \_duration      | uint64  | - Length of auction (in seconds).                   |
| \_winner        | address | - The person who can win, if private. 0 for anyone. |

### crystalToken

```solidity
function crystalToken() external view returns (contract IERC20Upgradeable)
```

CONTRACTS ///

#### Returns

| Name | Type                       | Description |
| ---- | -------------------------- | ----------- |
| \_0  | contract IERC20Upgradeable | undefined   |

### feeAddresses

```solidity
function feeAddresses(uint256) external view returns (address)
```

STATE ///

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### feePercents

```solidity
function feePercents(uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getAuction

```solidity
function getAuction(uint256 _tokenId) external view returns (struct Auction)
```

*Returns auction info for an NFT on auction.*

#### Parameters

| Name      | Type    | Description             |
| --------- | ------- | ----------------------- |
| \_tokenId | uint256 | - ID of NFT on auction. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | Auction | undefined   |

### getAuctions

```solidity
function getAuctions(uint256[] _tokenIds) external view returns (struct Auction[])
```

*single endpoint gets an array of auctions*

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| \_tokenIds | uint256\[] | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | Auction\[] | undefined   |

### getCurrentPrice

```solidity
function getCurrentPrice(uint256 _tokenId) external view returns (uint256)
```

*Returns the current price of an auction.*

#### Parameters

| Name      | Type    | Description                              |
| --------- | ------- | ---------------------------------------- |
| \_tokenId | uint256 | - ID of the token price we are checking. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getUserAuctions

```solidity
function getUserAuctions(address _address) external view returns (uint256[])
```

*returns the accounts auctions*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_address | address | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### initialize

```solidity
function initialize(address _heroCoreAddress, address _crystalAddress, uint256 _cut, uint256 _auctionIdOffset) external nonpayable
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| \_heroCoreAddress | address | undefined   |
| \_crystalAddress  | address | undefined   |
| \_cut             | uint256 | undefined   |
| \_auctionIdOffset | uint256 | undefined   |

### isOnAuction

```solidity
function isOnAuction(uint256 _tokenId) external view returns (bool)
```

*Checks if the token is currently on auction.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### onERC721Received

```solidity
function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4)
```

Always returns `IERC721Receiver.onERC721Received.selector`.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | address | undefined   |
| \_2  | uint256 | undefined   |
| \_3  | bytes   | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | bytes4 | undefined   |

### ownerCut

```solidity
function ownerCut() external view returns (uint256)
```

STATE ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setFees

```solidity
function setFees(address[] _feeAddresses, uint256[] _feePercents) external nonpayable
```

*Sets the addresses and percentages that will receive fees.*

#### Parameters

| Name           | Type       | Description                                       |
| -------------- | ---------- | ------------------------------------------------- |
| \_feeAddresses | address\[] | An array of addresses to send fees to.            |
| \_feePercents  | uint256\[] | An array of percentages for the addresses to get. |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

*See {IERC165-supportsInterface}.*

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### totalAuctions

```solidity
function totalAuctions() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### userAuctions

```solidity
function userAuctions(address, uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

## Events

### AuctionCancelled

```solidity
event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| tokenId `indexed` | uint256 | undefined   |

### AuctionCreated

```solidity
event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner)
```

EVENTS ///

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| owner `indexed`   | address | undefined   |
| tokenId `indexed` | uint256 | undefined   |
| startingPrice     | uint256 | undefined   |
| endingPrice       | uint256 | undefined   |
| duration          | uint256 | undefined   |
| winner            | address | undefined   |

### AuctionSuccessful

```solidity
event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| tokenId `indexed` | uint256 | undefined   |
| totalPrice        | uint256 | undefined   |
| winner            | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |


# ERC721AuctionBaseUpgradeable

> AuctionBase for non-fungible tokens.

We omit a fallback function to prevent accidental sends to this contract.

## Methods

### BIDDER\_ROLE

```solidity
function BIDDER_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### DEFAULT\_ADMIN\_ROLE

```solidity
function DEFAULT_ADMIN_ROLE() external view returns (bytes32)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### ERC721

```solidity
function ERC721() external view returns (contract IERC721Upgradeable)
```

CONTRACTS ///

#### Returns

| Name | Type                        | Description |
| ---- | --------------------------- | ----------- |
| \_0  | contract IERC721Upgradeable | undefined   |

### MODERATOR\_ROLE

```solidity
function MODERATOR_ROLE() external view returns (bytes32)
```

ROLES ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### auctionIdOffset

```solidity
function auctionIdOffset() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### auctions

```solidity
function auctions(uint256) external view returns (address seller, uint256 tokenId, uint128 startingPrice, uint128 endingPrice, uint64 duration, uint64 startedAt, address winner, bool open)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| seller        | address | undefined   |
| tokenId       | uint256 | undefined   |
| startingPrice | uint128 | undefined   |
| endingPrice   | uint128 | undefined   |
| duration      | uint64  | undefined   |
| startedAt     | uint64  | undefined   |
| winner        | address | undefined   |
| open          | bool    | undefined   |

### bid

```solidity
function bid(uint256 _tokenId, uint256 _bidAmount) external nonpayable
```

*Bids on an open auction, completing the auction if enough JEWELs are supplied.*

#### Parameters

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| \_tokenId   | uint256 | - ID of token to bid on. |
| \_bidAmount | uint256 | The bid amount.          |

### bidFor

```solidity
function bidFor(address _bidder, uint256 _tokenId, uint256 _bidAmount) external nonpayable
```

*Bids on an open auction, completing the auction if enough JEWELs are supplied.*

#### Parameters

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| \_bidder    | address | undefined                |
| \_tokenId   | uint256 | - ID of token to bid on. |
| \_bidAmount | uint256 | The bid amount.          |

### cancelAuction

```solidity
function cancelAuction(uint256 _tokenId) external nonpayable
```

This is a state-modifying function that can be called while the contract is paused.depending on if the auction is escrow or not this might need to verify ownership

*Cancels an auction that hasn't been won yet. Returns the NFT to original owner.*

#### Parameters

| Name      | Type    | Description              |
| --------- | ------- | ------------------------ |
| \_tokenId | uint256 | - ID of token on auction |

### cancelAuctionWhenPaused

```solidity
function cancelAuctionWhenPaused(uint256 _tokenId) external nonpayable
```

*Cancels an auction when the contract is paused. Only the owner may do this, and NFTs are returned to the seller. This should only be used in emergencies.*

#### Parameters

| Name      | Type    | Description                           |
| --------- | ------- | ------------------------------------- |
| \_tokenId | uint256 | - ID of the NFT on auction to cancel. |

### createAuction

```solidity
function createAuction(uint256 _tokenId, uint128 _startingPrice, uint128 _endingPrice, uint64 _duration, address _winner) external nonpayable
```

*Creates and begins a new auction. This can either escrow or not depending on implementation but should at the very least call \_addAuction and check ownership*

#### Parameters

| Name            | Type    | Description                                         |
| --------------- | ------- | --------------------------------------------------- |
| \_tokenId       | uint256 | - ID of token to auction, sender must be owner.     |
| \_startingPrice | uint128 | - Price of item (in wei) at beginning of auction.   |
| \_endingPrice   | uint128 | - Price of item (in wei) at end of auction.         |
| \_duration      | uint64  | - Length of auction (in seconds).                   |
| \_winner        | address | - The person who can win, if private. 0 for anyone. |

### crystalToken

```solidity
function crystalToken() external view returns (contract IERC20Upgradeable)
```

CONTRACTS ///

#### Returns

| Name | Type                       | Description |
| ---- | -------------------------- | ----------- |
| \_0  | contract IERC20Upgradeable | undefined   |

### feeAddresses

```solidity
function feeAddresses(uint256) external view returns (address)
```

STATE ///

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### feePercents

```solidity
function feePercents(uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getAuction

```solidity
function getAuction(uint256 _tokenId) external view returns (struct Auction)
```

*Returns auction info for an NFT on auction.*

#### Parameters

| Name      | Type    | Description             |
| --------- | ------- | ----------------------- |
| \_tokenId | uint256 | - ID of NFT on auction. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | Auction | undefined   |

### getAuctions

```solidity
function getAuctions(uint256[] _tokenIds) external view returns (struct Auction[])
```

*single endpoint gets an array of auctions*

#### Parameters

| Name       | Type       | Description |
| ---------- | ---------- | ----------- |
| \_tokenIds | uint256\[] | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | Auction\[] | undefined   |

### getCurrentPrice

```solidity
function getCurrentPrice(uint256 _tokenId) external view returns (uint256)
```

*Returns the current price of an auction.*

#### Parameters

| Name      | Type    | Description                              |
| --------- | ------- | ---------------------------------------- |
| \_tokenId | uint256 | - ID of the token price we are checking. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### getRoleAdmin

```solidity
function getRoleAdmin(bytes32 role) external view returns (bytes32)
```

*Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {\_setRoleAdmin}.*

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| role | bytes32 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | bytes32 | undefined   |

### getUserAuctions

```solidity
function getUserAuctions(address _address) external view returns (uint256[])
```

*returns the accounts auctions*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_address | address | undefined   |

#### Returns

| Name | Type       | Description |
| ---- | ---------- | ----------- |
| \_0  | uint256\[] | undefined   |

### grantRole

```solidity
function grantRole(bytes32 role, address account) external nonpayable
```

*Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### hasRole

```solidity
function hasRole(bytes32 role, address account) external view returns (bool)
```

*Returns `true` if `account` has been granted `role`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### isOnAuction

```solidity
function isOnAuction(uint256 _tokenId) external view returns (bool)
```

*Checks if the token is currently on auction.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| \_tokenId | uint256 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### onERC721Received

```solidity
function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4)
```

Always returns `IERC721Receiver.onERC721Received.selector`.

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | address | undefined   |
| \_2  | uint256 | undefined   |
| \_3  | bytes   | undefined   |

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | bytes4 | undefined   |

### ownerCut

```solidity
function ownerCut() external view returns (uint256)
```

STATE ///

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### pause

```solidity
function pause() external nonpayable
```

### paused

```solidity
function paused() external view returns (bool)
```

*Returns true if the contract is paused, and false otherwise.*

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### renounceRole

```solidity
function renounceRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### revokeRole

```solidity
function revokeRole(bytes32 role, address account) external nonpayable
```

*Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have `role`'s admin role.*

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| role    | bytes32 | undefined   |
| account | address | undefined   |

### setFees

```solidity
function setFees(address[] _feeAddresses, uint256[] _feePercents) external nonpayable
```

*Sets the addresses and percentages that will receive fees.*

#### Parameters

| Name           | Type       | Description                                       |
| -------------- | ---------- | ------------------------------------------------- |
| \_feeAddresses | address\[] | An array of addresses to send fees to.            |
| \_feePercents  | uint256\[] | An array of percentages for the addresses to get. |

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external view returns (bool)
```

*See {IERC165-supportsInterface}.*

#### Parameters

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| interfaceId | bytes4 | undefined   |

#### Returns

| Name | Type | Description |
| ---- | ---- | ----------- |
| \_0  | bool | undefined   |

### totalAuctions

```solidity
function totalAuctions() external view returns (uint256)
```

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### unpause

```solidity
function unpause() external nonpayable
```

### userAuctions

```solidity
function userAuctions(address, uint256) external view returns (uint256)
```

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |
| \_1  | uint256 | undefined   |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

## Events

### AuctionCancelled

```solidity
event AuctionCancelled(uint256 auctionId, uint256 indexed tokenId)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| tokenId `indexed` | uint256 | undefined   |

### AuctionCreated

```solidity
event AuctionCreated(uint256 auctionId, address indexed owner, uint256 indexed tokenId, uint256 startingPrice, uint256 endingPrice, uint256 duration, address winner)
```

EVENTS ///

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| owner `indexed`   | address | undefined   |
| tokenId `indexed` | uint256 | undefined   |
| startingPrice     | uint256 | undefined   |
| endingPrice       | uint256 | undefined   |
| duration          | uint256 | undefined   |
| winner            | address | undefined   |

### AuctionSuccessful

```solidity
event AuctionSuccessful(uint256 auctionId, uint256 indexed tokenId, uint256 totalPrice, address winner)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| auctionId         | uint256 | undefined   |
| tokenId `indexed` | uint256 | undefined   |
| totalPrice        | uint256 | undefined   |
| winner            | address | undefined   |

### Paused

```solidity
event Paused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |

### RoleAdminChanged

```solidity
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
```

#### Parameters

| Name                        | Type    | Description |
| --------------------------- | ------- | ----------- |
| role `indexed`              | bytes32 | undefined   |
| previousAdminRole `indexed` | bytes32 | undefined   |
| newAdminRole `indexed`      | bytes32 | undefined   |

### RoleGranted

```solidity
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### RoleRevoked

```solidity
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
```

#### Parameters

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| role `indexed`    | bytes32 | undefined   |
| account `indexed` | address | undefined   |
| sender `indexed`  | address | undefined   |

### Unpaused

```solidity
event Unpaused(address account)
```

#### Parameters

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address | undefined   |




---

[Next Page](/llms-full.txt/1)

