Solidity API
HandlerHelpers
This contract is intended to be used with the Bridge contract.
_bridgeAddress
address _bridgeAddress
_resourceIDToTokenContractAddress
mapping(bytes32 => address) _resourceIDToTokenContractAddress
_tokenContractAddressToResourceID
mapping(address => bytes32) _tokenContractAddressToResourceID
_contractWhitelist
mapping(address => bool) _contractWhitelist
_burnList
mapping(address => bool) _burnList
onlyBridge
modifier onlyBridge()
constructor
constructor(address bridgeAddress) public
Name | Type | Description |
---|---|---|
bridgeAddress | address | Contract address of previously deployed Bridge. |
_onlyBridge
function _onlyBridge() private view
setResource
function setResource(bytes32 resourceID, address contractAddress) external
First verifies {_resourceIDToContractAddress}[{resourceID}] and {_contractAddressToResourceID}[{contractAddress}] are not already set, then sets {_resourceIDToContractAddress} with {contractAddress}, {_contractAddressToResourceID} with {resourceID}, and {_contractWhitelist} to true for {contractAddress}.
Name | Type | Description |
---|---|---|
resourceID | bytes32 | ResourceID to be used when making deposits. |
contractAddress | address | Address of contract to be called when a deposit is made and a deposited is executed. |
setBurnable
function setBurnable(address contractAddress) external
First verifies {contractAddress} is whitelisted, then sets {_burnList}[{contractAddress}] to true.
Name | Type | Description |
---|---|---|
contractAddress | address | Address of contract to be used when making or executing deposits. |
withdraw
function withdraw(bytes data) external virtual
Withdraw funds from ERC safes.
Name | Type | Description |
---|---|---|
data | bytes | ABI-encoded withdrawal params relevant to the handler. |
_setResource
function _setResource(bytes32 resourceID, address contractAddress) internal
_setBurnable
function _setBurnable(address contractAddress) internal