Amber Token
ERC20
This contract is an ERC20 token.
Name
Amber Token
Symbol
AMB
Decimals
18
Total Supply
361,477,438 AMB
About
Stats
Public Functions
11
Event Types
5
Code Size
18,851 bytes
Events (5) keyboard_arrow_up
Functions
setOwner keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
when_owns checks for the following:
when_liquid checks for the following:
Source Code
function transfer(address _to, uint256 _value)
when_owns(msg.sender, _value)
when_liquid
returns (bool)
{
Transfer(msg.sender, _to, _value);
accounts[msg.sender].balance -= _value;
accounts[_to].balance += _value;
return true;
}
transferFrom keyboard_arrow_up
Modifiers help
when_owns checks for the following:
when_has_allowance checks for the following:
when_liquid checks for the following:
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
)
when_owns(_from, _value)
when_has_allowance(_from, msg.sender, _value)
when_liquid
returns (bool)
{
Transfer(_from, _to, _value);
accounts[_from].allowanceOf[msg.sender] -= _value;
accounts[_from].balance -= _value;
accounts[_to].balance += _value;
return true;
}
approve keyboard_arrow_up
Requirements help
One or more of the following:
-
undefined.allowanceOf for _spender
must be equal to
0
- OR
_value
must be equal to
0
Source Code
function approve(address _spender, uint256 _value) when_liquid returns (bool) {
// Mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(_value == 0 || accounts[msg.sender].allowanceOf[_spender] == 0);
Approval(msg.sender, _spender, _value);
accounts[msg.sender].allowanceOf[_spender] = _value;
return true;
}
allowance keyboard_arrow_up
mint keyboard_arrow_up
Modifiers help
only_owner checks for the following:
Source Code
function mint(address _who, uint256 _value) public only_owner {
accounts[_who].balance += _value;
totalSupply += _value;
Minted(_who, _value);
}
mintLocked keyboard_arrow_up
Modifiers help
only_owner checks for the following:
Source Code
function mintLocked(address _who, uint256 _value) public only_owner {
accounts[_who].tokensPerPhase += _value / UNLOCK_PHASES;
totalSupply += _value;
MintedLocked(_who, _value);
}
finalise keyboard_arrow_up
currentPhase keyboard_arrow_up
unlockTokens keyboard_arrow_up
Source Code
function unlockTokens(address _who) public {
uint256 phase = currentPhase();
uint256 tokens = accounts[_who].tokensPerPhase;
uint256 nextPhase = accounts[_who].nextPhase;
if (tokens > 0 && phase > nextPhase) {
accounts[_who].balance += tokens * (phase - nextPhase);
accounts[_who].nextPhase = phase;
}
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.