ERC677BridgeToken
Index
Reference
Events
ContractFallbackCallFailed
event ContractFallbackCallFailed(address from, address to, uint256 value)
Emits if custom call after transfer fails.
- Parameters:
from
- From address.to
- To address.value
- Transferred value.
Mint
event Mint(address to, uint256 amount)
Mint event.
- Parameters:
to
- To address.amount
- Minted value.
Transfer
event Transfer(address from, address to, uint256 value, bytes data)
Modified Transfer event with custom data.
- Parameters:
from
- From address.to
- To address.value
- Transferred value.data
- Custom data to call after transfer.
Modifiers
onlyBridge
modifier onlyBridge()
Reverts if called by any account other than the bridge.
validRecipient
modifier validRecipient(address _recipient)
Checks that the recipient address is valid.
- Parameters:
_recipient
- Recipient address.
Functions
_callAfterTransfer
function _callAfterTransfer(address _from, address _to, uint256 _value) internal
Used by the `transfer` and `transferFrom` functions. In case the recipient is a contract, tries to call its `onTokenTransfer` function. Reverts if `onTokenTransfer` fails and the recipient is a bridge/distribution contract. Emits an event if `onTokenTransfer` fails and the recipient is not a bridge/distribution contract. Needed for reverting transfer to a bridge when the bridge doesn't accept tokens due to daily limitations, and to revert transfer to a distribution contract (Distribution or MultipleDistribution) if the contract doesn't accept tokens due to its limitations defined in `onTokenTransfer` function.
- Parameters:
_from
- The address of the sender._to
- The address of the recipient._value
- The transferred value.
_superTransfer
function _superTransfer(address _to, uint256 _value) internal
Calls transfer method and reverts if it fails.
- Parameters:
_to
- The address of the recipient._value
- The value to transfer.
_superTransferFrom
function _superTransferFrom(address _from, address _to, uint256 _value) internal
Calls transferFrom method and reverts if it fails.
- Parameters:
_from
- The address of the sender._to
- The address of the recipient._value
- The value to transfer.
claimTokens
function claimTokens(address _token, address _to) public
If someone sent eth/tokens to the contract mistakenly then the owner can send them back.
- Modifiers:
- onlyOwner validRecipient
- Parameters:
_token
- The token address to transfer._to
- The address of the recipient.
fallback
function (string _name, string _symbol, address _distributionAddress, address _privateOfferingDistributionAddress, address _advisorsRewardDistributionAddress) public
Creates a token and mints the whole supply for the Distribution contract.
- Modifiers:
- Parameters:
_name
- Token name._symbol
- Token symbol._distributionAddress
- The address of the deployed Distribution contract._privateOfferingDistributionAddress
- The address of the PrivateOffering contract._advisorsRewardDistributionAddress
- The address of the AdvisorsReward contract.
isBridge
abstract function isBridge(address _address) public view returns (bool)
Checks if given address is included into bridge contracts list. Implemented by a child contract.
- Parameters:
_address
- Bridge contract address.- Returns:
- bool true, if given address is a known bridge contract.
mint
function mint(address _account, uint256 _amount) external returns (bool)
Creates `amount` tokens and assigns them to `account`, increasing the total supply. Emits a `Transfer` event with `from` set to the zero address. Can only be called by a bridge contract which address is set with `addBridge`.
- Modifiers:
- onlyBridge
- Parameters:
_account
- The address to mint tokens for. Cannot be zero address._amount
- The amount of tokens to mint.- Returns:
- bool
renounceOwnership
function renounceOwnership() public
The removed implementation of the ownership renouncing.
- Modifiers:
- onlyOwner
transfer
function transfer(address _to, uint256 _value) public returns (bool)
Extends transfer method with event when the callback failed.
- Parameters:
_to
- The address of the recipient._value
- The value to transfer.- Returns:
- Success status.
transferAndCall
function transferAndCall(address _to, uint256 _value, bytes _data) external returns (bool)
Extends transfer method with callback.
- Modifiers:
- validRecipient
- Parameters:
_to
- The address of the recipient._value
- The value to transfer._data
- Custom data.- Returns:
- Success status.
transferDistribution
function transferDistribution(address _to, uint256 _value) public returns (bool)
This is a copy of `transfer` function which can only be called by distribution contracts. Made to get rid of `onTokenTransfer` calling to save gas when distributing tokens.
- Parameters:
_to
- The address of the recipient._value
- The value to transfer.- Returns:
- Success status.
transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool)
Extends transferFrom method with event when the callback failed.
- Parameters:
_from
- The address of the sender._to
- The address of the recipient._value
- The value to transfer.- Returns:
- Success status.