Skip to main content

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
NameTypeDescription
bridgeAddressaddressContract 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}.

NameTypeDescription
resourceIDbytes32ResourceID to be used when making deposits.
contractAddressaddressAddress 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.

NameTypeDescription
contractAddressaddressAddress of contract to be used when making or executing deposits.

withdraw

function withdraw(bytes data) external virtual

Withdraw funds from ERC safes.

NameTypeDescription
databytesABI-encoded withdrawal params relevant to the handler.

_setResource

function _setResource(bytes32 resourceID, address contractAddress) internal

_setBurnable

function _setBurnable(address contractAddress) internal