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

Events (5) keyboard_arrow_up

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 Struct

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

name Constant

string help
Amber Token

decimals Constant

uint8 help
18

symbol Constant

string help
AMB

PHASE_DURATION Constant

uint help
180 days

UNLOCK_PHASES Constant

uint help
4

locked Variable

bool help

phaseStart Variable

uint help

totalSupply Variable

uint help

owner Variable

address help

accounts Variable

mapping(address => Account) help
Internal Variable

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;
}

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;
}

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;
}

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;
}

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;
}

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, uint256 _value) public only_owner {
  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, uint256 _value) public only_owner {
  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() public only_owner {
  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 (uint256) {
  require(phaseStart > 0);
  uint256 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 {
  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 Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.