Skip to content

Commit

Permalink
Add doc comments for changes methods
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Apr 21, 2020
1 parent 5d3899f commit 1a73faa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ contract BasicAMBErc677ToErc677 is
return mediatorContractOnOtherSide();
}

/**
* @dev Constructs and passes a message to the AMB bridge contract.
* Message represents a call of handleBridgedTokens(receiver, value, nonce) on the other side mediator contract.
* @param _from adddress of sender, if bridge operation failes, tokens will be returned to this address
* @param _receiver adddress of receiver on the other side, will eventually receive bridged tokens
* @param _value bridged amount of tokens
*/
function passMessage(address _from, address _receiver, uint256 _value) internal {
bytes4 methodSelector = this.handleBridgedTokens.selector;
bytes memory data = abi.encodeWithSelector(methodSelector, _receiver, _value, nonce());
Expand Down Expand Up @@ -231,6 +238,12 @@ contract BasicAMBErc677ToErc677 is
}
}

/**
* @dev Fixes locked tokens, that were out of execution limits during the call to handleBridgedTokens
* @param txHash reference transaction hash for bridge operation that was out of execution limits
* @param unlockOnForeign true if fixed tokens should be unlocked to the other side of the bridge
* @param valueToUnlock unlocked amount of tokens, should be less than maxPerTx() and saved txAboveLimitsValue
*/
function fixAssetsAboveLimits(bytes32 txHash, bool unlockOnForeign, uint256 valueToUnlock)
external
onlyIfUpgradeabilityOwner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ contract ForeignAMBErc677ToErc677 is BasicAMBErc677ToErc677 {
erc677token().transfer(_recipient, value);
}

/**
* @dev Executes action on deposit of bridged tokens
* @param _from address of tokens sender
* @param _value requsted amount of bridged tokens
* @param _data alternative receiver, if specified
*/
function bridgeSpecificActionsOnTokenTransfer(
ERC677, /* _token */
address _from,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ contract HomeAMBErc677ToErc677 is BasicAMBErc677ToErc677 {
IBurnableMintableERC677Token(erc677token()).mint(_recipient, value);
}

/**
* @dev Executes action on withdrawal of bridged tokens
* @param _token address of token contract
* @param _from address of tokens sender
* @param _value requsted amount of bridged tokens
* @param _data alternative receiver, if specified
*/
function bridgeSpecificActionsOnTokenTransfer(ERC677 _token, address _from, uint256 _value, bytes _data) internal {
if (!lock()) {
IBurnableMintableERC677Token(_token).burn(_value);
Expand Down

0 comments on commit 1a73faa

Please sign in to comment.