Solidity API
ERC20Handler
This contract is intended to be used with the Bridge contract.
constructor
constructor(address bridgeAddress) public
Name | Type | Description |
---|---|---|
bridgeAddress | address | Contract address of previously deployed Bridge. |
deposit
function deposit(bytes32 resourceID, address depositer, bytes data) external payable returns (bytes)
A deposit is initiatied by making a deposit in the Bridge contract.
Data passed into the function should be constructed as follows: amount uint256 bytes 0 - 32
Depending if the corresponding {tokenAddress} for the parsed {resourceID} is marked true in {_burnList}, deposited tokens will be burned, if not, they will be locked.
Name | Type | Description |
---|---|---|
resourceID | bytes32 | ResourceID used to find address of token to be used for deposit. |
depositer | address | Address of account making the deposit in the Bridge contract. |
data | bytes | Consists of {amount} padded to 32 bytes. |
Name | Type | Description |
---|---|---|
[0] | bytes | an empty data. |
executeProposal
function executeProposal(bytes32 resourceID, bytes data) external
Proposal execution should be initiated when a proposal is finalized in the Bridge contract. by a relayer on the deposit's destination chain.
Data passed into the function should be constructed as follows: amount uint256 bytes 0 - 32 destinationRecipientAddress length uint256 bytes 32 - 64 destinationRecipientAddress bytes bytes 64 - END
Name | Type | Description |
---|---|---|
resourceID | bytes32 | |
data | bytes | Consists of {resourceID}, {amount}, {lenDestinationRecipientAddress}, and {destinationRecipientAddress} all padded to 32 bytes. |
withdraw
function withdraw(bytes data) external
Used to manually release ERC20 tokens from ERC20Safe.
Data passed into the function should be constructed as follows: tokenAddress address bytes 0 - 32 recipient address bytes 32 - 64 amount uint bytes 64 - 96
Name | Type | Description |
---|---|---|
data | bytes | Consists of {tokenAddress}, {recipient}, and {amount} all padded to 32 bytes. |