The BancorX contract allows cross chain token transfers.
There are two processes that take place in the contract -
Initiate a cross chain transfer to a target blockchain (locks tokens from the caller account on Ethereum)
Report a cross chain transfer initiated on a source blockchain (releases tokens to an account on Ethereum)
Reporting cross chain transfers works similar to standard multisig contracts, meaning that multiple
callers are required to report a transfer before tokens are released to the target account.
initializes a new BancorX instance
_maxLockLimit
: maximum amount of tokens that can be locked in one transaction
_maxReleaseLimit
: maximum amount of tokens that can be released in one transaction
_minLimit
: minimum amount of tokens that can be transferred in one transaction
_limitIncPerBlock
: how much the limit increases per block
_minRequiredReports
: minimum number of reporters to report transaction before tokens can be released
_registry
: address of contract registry
_token
: erc20 token
setter
_maxLockLimit
: new maxLockLimit
setter
_maxReleaseLimit
: new maxReleaseLimit
setter
_minLimit
: new minLimit
setter
_limitIncPerBlock
: new limitIncPerBlock
setter
_minRequiredReports
: new minRequiredReports
allows the owner to set/remove reporters
_reporter
: reporter whos status is to be set
_active
: true if the reporter is approved, false otherwise
allows the owner enable/disable the xTransfer method
_enable
: true to enable, false to disable
allows the owner enable/disable the reportTransaction method
_enable
: true to enable, false to disable
upgrades the contract to the latest version
can only be called by the owner
note that the owner needs to call acceptOwnership on the new contract after the upgrade
_reporters
: new list of reporters
claims tokens from msg.sender to be converted to tokens on another blockchain
_toBlockchain
: blockchain on which tokens will be issued
_to
: address to send the tokens to
_amount
: the amount of tokens to transfer
claims tokens from msg.sender to be converted to tokens on another blockchain
_toBlockchain
: blockchain on which tokens will be issued
_to
: address to send the tokens to
_amount
: the amount of tokens to transfer
_id
: pre-determined unique (if non zero) id which refers to this transaction
allows reporter to report transaction which occured on another blockchain
_fromBlockchain
: blockchain in which tokens were destroyed
_txId
: transactionId of transaction thats being reported
_to
: address to receive tokens
_amount
: amount of tokens destroyed on another blockchain
_xTransferId
: unique (if non zero) pre-determined id (unlike _txId which is determined after the transactions been mined)
gets x transfer amount by xTransferId (not txId)
_xTransferId
: unique (if non zero) pre-determined id (unlike _txId which is determined after the transactions been broadcasted)
_for
: address corresponding to xTransferId
amount that was sent in xTransfer corresponding to _xTransferId
method for calculating current lock limit
the current maximum limit of tokens that can be locked
method for calculating current release limit
the current maximum limit of tokens that can be released
triggered when tokens are locked in smart contract
_from
: wallet address that the tokens are locked from
_amount
: amount locked
triggered when tokens are released by the smart contract
_to
: wallet address that the tokens are released to
_amount
: amount released
triggered when xTransfer is successfully called
_from
: wallet address that initiated the xtransfer
_toBlockchain
: target blockchain
_to
: target wallet
_amount
: transfer amount
_id
: xtransfer id
triggered when report is successfully submitted
_reporter
: reporter wallet
_fromBlockchain
: source blockchain
_txId
: tx id on the source blockchain
_to
: target wallet
_amount
: transfer amount
_xTransferId
: xtransfer id
triggered when final report is successfully submitted
_to
: target wallet
_id
: xtransfer id