SynapseBridge
Last updated
Last updated
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Relays to nodes to transfers an ERC20 token cross-chain
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.
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.
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
.
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
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
Returns true if the contract is paused, and false otherwise.
Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain
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)
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)
Relays to nodes that (typically) a wrapped synAsset ERC20 token has been burned and the underlying needs to be redeeemed on the native chain
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.
Function to be called by the node group to withdraw the underlying assets from the contract
Function to be called by the node group to withdraw the underlying assets from the contract
withdraw specified ERC20 token fees to a given address
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
bytes32
undefined
_0
address payable
undefined
kappas
bytes32[]
undefined
_0
uint256
undefined
_0
uint256
undefined
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*
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*
tokenAddress
address
undefined
_0
uint256
undefined
role
bytes32
undefined
_0
bytes32
undefined
role
bytes32
undefined
index
uint256
undefined
_0
address
undefined
role
bytes32
undefined
_0
uint256
undefined
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
_0
bool
undefined
kappa
bytes32
undefined
_0
bool
undefined
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*
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*
_0
bool
undefined
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*
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*
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*
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*
role
bytes32
undefined
account
address
undefined
role
bytes32
undefined
account
address
undefined
amount
uint256
undefined
_wethAddress
address payable
undefined
_0
uint256
undefined
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*
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*
token
contract IERC20
ERC20 token in which fees acccumulated to transfer
to
address
Address to send the fees to
account
address
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
to indexed
address
undefined
chainId
uint256
undefined
token
contract IERC20
undefined
amount
uint256
undefined
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
to indexed
address
undefined
token
contract IERC20Mintable
undefined
amount
uint256
undefined
fee
uint256
undefined
kappa indexed
bytes32
undefined
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
to indexed
address
undefined
chainId
uint256
undefined
token
contract IERC20
undefined
amount
uint256
undefined
to indexed
address
undefined
chainId
uint256
undefined
token
contract IERC20
undefined
amount
uint256
undefined
swapTokenIndex
uint8
undefined
swapMinAmount
uint256
undefined
swapDeadline
uint256
undefined
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
to indexed
bytes32
undefined
chainId
uint256
undefined
token
contract IERC20
undefined
amount
uint256
undefined
to indexed
address
undefined
token
contract IERC20
undefined
amount
uint256
undefined
fee
uint256
undefined
kappa indexed
bytes32
undefined
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
account
address
undefined