BridgeConfigV3
Last updated
Last updated
BridgeConfig contract
This token is used for configuring different tokens on the bridge and mapping them across chains.*
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
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
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
Returns a list of all existing token IDs converted to strings
gets the max gas price for a chain
Returns the admin role that controls role
. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.
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.
Returns the number of accounts that have role
. Can be used together with {getRoleMember} to enumerate all bearers of a role.
Returns the full token config struct
Returns token config struct, given an address and chainID
Returns the full token config struct
Returns the token ID (string) of the cross-chain token inputted
Returns which token is the underlying token to withdraw
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.
Returns true
if account
has been granted role
.
Returns true if the token has an underlying token -- meaning the token is deposited into the bridge
Public function returning if token ID exists given a string
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
.
Revokes role
from account
. If account
had been granted role
, emits a {RoleRevoked} event. Requirements: - the caller must have role
's admin role.
sets the max gas price for a chain
Main write function of this contract - Handles creating the struct and passing it to the internal logic function
Main write function of this contract - Handles creating the struct and passing it to the internal logic function
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
_0
bytes32
undefined
_0
bytes32
undefined
_0
uint256
undefined
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
_0
uint256
Fee calculated in token decimals
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
_0
uint256
Fee calculated in token decimals
result
string[]
undefined
chainID
uint256
undefined
_0
uint256
undefined
tokenAddress
address
undefined
chainID
uint256
undefined
_0
BridgeConfigV3.Pool
undefined
role
bytes32
undefined
_0
bytes32
undefined
role
bytes32
undefined
index
uint256
undefined
_0
address
undefined
role
bytes32
undefined
_0
uint256
undefined
tokenID
string
String input of the token ID for the token
chainID
uint256
Chain ID of which token address + config to get
token
BridgeConfigV3.Token
undefined
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
token
BridgeConfigV3.Token
undefined
tokenAddress
address
undefined
chainID
uint256
undefined
token
BridgeConfigV3.Token
undefined
tokenID
string
String input of the token ID for the token
chainID
uint256
Chain ID of which token address + config to get
token
BridgeConfigV3.Token
undefined
tokenAddress
address
address of token to get ID for
chainID
uint256
chainID of which to get token ID for
_0
string
undefined
tokenAddress
string
undefined
chainID
uint256
undefined
_0
string
undefined
tokenID
string
string token ID
token
BridgeConfigV3.Token
undefined
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
_0
bool
undefined
tokenID
string
String to check if it is a withdraw/underlying token
_0
bool
undefined
tokenID
string
undefined
_0
bool
undefined
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
chainID
uint256
undefined
maxPrice
uint256
undefined
tokenAddress
address
undefined
chainID
uint256
undefined
poolAddress
address
undefined
metaswap
bool
undefined
_0
BridgeConfigV3.Pool
undefined
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
_0
bool
undefined
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
_0
bool
undefined
role indexed
bytes32
undefined
previousAdminRole indexed
bytes32
undefined
newAdminRole indexed
bytes32
undefined
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined
role indexed
bytes32
undefined
account indexed
address
undefined
sender indexed
address
undefined