Blockwell

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

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

Minted Event

Parameters help
who
address help
value
uint help

MintedLocked Event

Parameters help
who
address help
value
uint help

NewOwner Event

Parameters help
old
address help
current
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Account Event

Members
balance
uint help
allowanceOf
mapping(address => uint) help
tokensPerPhase
uint help
nextPhase
uint help

Functions Expand All Collapse All

setOwner keyboard_arrow_up

Parameters help

Name Type
_new
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function setOwner(address _new) only_owner {
		NewOwner(owner, _new);
		owner = _new;
	}

balanceOf keyboard_arrow_up

Parameters help

Name Type
_who
address help

Properties

Visibility help public
Mutability help constant
Source Code
	function balanceOf(address _who) constant returns (uint256) {
		return accounts[_who].balance;
	}

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

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

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
	function allowance(address _owner, address _spender)
		constant
		returns (uint256)
	{
		return accounts[_owner].allowanceOf[_spender];
	}

mint keyboard_arrow_up

Parameters help

Name Type
_who
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
	function mint(address _who, uint _value)
		only_owner
		public
	{
		accounts[_who].balance += _value;
		totalSupply += _value;
		Minted(_who, _value);
	}

mintLocked keyboard_arrow_up

Parameters help

Name Type
_who
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
	function mintLocked(address _who, uint _value)
		only_owner
		public
	{
		accounts[_who].tokensPerPhase += _value / UNLOCK_PHASES;
		totalSupply += _value;
		MintedLocked(_who, _value);
	}

finalise keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
	function finalise()
		only_owner
		public
	{
		locked = false;
		owner = 0;
		phaseStart = now;
	}

currentPhase keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant

Requirements help

Source Code
	function currentPhase()
		public
		constant
		returns (uint)
	{
		require (phaseStart > 0);
		uint p = (now - phaseStart) / PHASE_DURATION;
		return p > UNLOCK_PHASES ? UNLOCK_PHASES : p;
	}

unlockTokens keyboard_arrow_up

Parameters help

Name Type
_who
address help

Properties

Visibility help public
Mutability help transaction
Source Code
	function unlockTokens(address _who)
		public
	{
		uint phase = currentPhase();
		uint tokens = accounts[_who].tokensPerPhase;
		uint nextPhase = accounts[_who].nextPhase;
		if (tokens > 0 && phase > nextPhase) {
			accounts[_who].balance += tokens * (phase - nextPhase);
			accounts[_who].nextPhase = phase;
		}
	}