Blockwell

Metronome

ERC20

This contract is an ERC20 token.

Name Metronome
Symbol MET
Decimals 18
Total Supply 12,229,817 MET

About link

Metronome (MET) is a cryptocurrency and operates on the Ethereum platform. Metronome has a current supply of 13,217,480.46589085 with 11,931,106.46589085 in circulation. The last known price of Metronome is 2.63157285 USD and is down -1.07 over the last 24 hours. It is currently trading on 11 active market(s) with $78,786.25 traded over the last 24 hours. More information can be found at https://www.metronome.io/.

Stats

Public Functions 29
Event Types 7
Code Size 82,825 bytes

Events (7) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Destroy Event

Parameters help
_from
address help
_value
uint help

LogCancelSubscription Event

Parameters help
subscriber
address help
subscribesTo
address help

LogSubscription Event

Parameters help
subscriber
address help
subscribesTo
address help

Mint Event

Parameters help
_to
address help
_value
uint help

OwnershipChanged Event

Parameters help
prevOwner
address help
newOwner
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Sub Struct

Members
startTime
uint help
payPerWeek
uint help
lastWithdrawTime
uint help

name Constant

string help
Metronome

symbol Constant

string help
MET

decimals Constant

uint8 help
18

transferAllowed Variable

bool help

autonomousConverter Variable

address help

minter Variable

address help

tokenPorter Variable

address help

newOwner Variable

address help

owner Variable

address help

roots Variable

mapping(address => bytes32) help

subs Variable

mapping(address => mapping(address => Sub)) help
Internal Variable

_allowance Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

_totalSupply Variable

uint256 help
Internal Variable

_balanceOf Variable

mapping(address => uint256) help
Internal Variable

Functions Expand All Collapse All

changeOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeOwnership(address _newOwner) public onlyOwner returns (bool) {
  require(_newOwner != owner);
  newOwner = _newOwner;
  return true;
}

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() public returns (bool) {
  require(msg.sender == newOwner);

  emit OwnershipChanged(owner, newOwner);
  owner = newOwner;
  return true;
}

initMintable keyboard_arrow_up

Parameters help

Name Type
_autonomousConverter
address help
_minter
address help
_initialSupply
uint help
_decmult
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function initMintable(
  address _autonomousConverter,
  address _minter,
  uint256 _initialSupply,
  uint256 _decmult
) public onlyOwner {
  require(autonomousConverter == 0x0 && _autonomousConverter != 0x0);
  require(minter == 0x0 && _minter != 0x0);

  autonomousConverter = _autonomousConverter;
  minter = _minter;
  _totalSupply = _initialSupply.mul(_decmult);
  _balanceOf[_autonomousConverter] = _totalSupply;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function totalSupply() public constant returns (uint256) {
  return _totalSupply;
}

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function balanceOf(address _owner) public constant returns (uint256) {
  return _balanceOf[_owner];
}

setTokenPorter keyboard_arrow_up

Parameters help

Name Type
_tokenPorter
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setTokenPorter(address _tokenPorter) public onlyOwner returns (bool) {
  require(_tokenPorter != 0x0);

  tokenPorter = ITokenPorter(_tokenPorter);
  return true;
}

mint keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(address _to, uint256 _value) public returns (bool) {
  require(msg.sender == minter || msg.sender == address(tokenPorter));
  _balanceOf[_to] = _balanceOf[_to].add(_value);
  _totalSupply = _totalSupply.add(_value);
  emit Mint(_to, _value);
  emit Transfer(0x0, _to, _value);
  return true;
}

destroy keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function destroy(address _from, uint256 _value) public returns (bool) {
  require(
    msg.sender == autonomousConverter || msg.sender == address(tokenPorter)
  );
  _balanceOf[_from] = _balanceOf[_from].sub(_value);
  _totalSupply = _totalSupply.sub(_value);
  emit Destroy(_from, _value);
  emit Transfer(_from, 0x0, _value);
  return true;
}

initToken keyboard_arrow_up

Parameters help

Name Type
_autonomousConverter
address help
_minter
address help
_initialSupply
uint help
_decmult
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function initToken(
  address _autonomousConverter,
  address _minter,
  uint256 _initialSupply,
  uint256 _decmult
) public onlyOwner {
  initMintable(_autonomousConverter, _minter, _initialSupply, _decmult);
}

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)
  public
  constant
  returns (uint256)
{
  return _allowance[_owner][_spender];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transfer(address _to, uint256 _value)
  public
  transferable
  returns (bool)
{
  return super.transfer(_to, _value);
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public transferable returns (bool) {
  return super.transferFrom(_from, _to, _value);
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address _spender, uint256 _value) public returns (bool) {
  require(_spender != address(this));
  _allowance[msg.sender][_spender] = _value;
  emit Approval(msg.sender, _spender, _value);
  return true;
}

multiTransfer keyboard_arrow_up

Parameters help

Name Type
bits
uint[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function multiTransfer(uint256[] bits) public transferable returns (bool) {
  return super.multiTransfer(bits);
}

approveMore keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveMore(address _spender, uint256 _value) public returns (bool) {
  uint256 previous = _allowance[msg.sender][_spender];
  uint256 newAllowance = previous.add(_value);
  _allowance[msg.sender][_spender] = newAllowance;
  emit Approval(msg.sender, _spender, newAllowance);
  return true;
}

approveLess keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveLess(address _spender, uint256 _value) public returns (bool) {
  uint256 previous = _allowance[msg.sender][_spender];
  uint256 newAllowance = previous.sub(_value);
  _allowance[msg.sender][_spender] = newAllowance;
  emit Approval(msg.sender, _spender, newAllowance);
  return true;
}

initMETToken keyboard_arrow_up

Parameters help

Name Type
_autonomousConverter
address help
_minter
address help
_initialSupply
uint help
_decmult
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function initMETToken(
  address _autonomousConverter,
  address _minter,
  uint256 _initialSupply,
  uint256 _decmult
) public onlyOwner {
  initToken(_autonomousConverter, _minter, _initialSupply, _decmult);
}

enableMETTransfers keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function enableMETTransfers() public returns (bool) {
  require(!transferAllowed && Auctions(minter).isInitialAuctionEnded());
  transferAllowed = true;
  return true;
}

setRoot keyboard_arrow_up

Parameters help

Name Type
data
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setRoot(bytes32 data) public {
  roots[msg.sender] = data;
}

getRoot keyboard_arrow_up

Parameters help

Name Type
addr
address help

Properties

Visibility help public
Mutability help view
Source Code
function getRoot(address addr) public view returns (bytes32) {
  return roots[addr];
}

rootsMatch keyboard_arrow_up

Parameters help

Name Type
a
address help
b
address help

Properties

Visibility help public
Mutability help view
Source Code
function rootsMatch(address a, address b) public view returns (bool) {
  return roots[a] == roots[b];
}

importMET keyboard_arrow_up

Parameters help

Name Type
_originChain
bytes8 help
_destinationChain
bytes8 help
_addresses
address[] help
_extraData
bytes help
_burnHashes
bytes32[] help
_supplyOnAllChains
uint[] help
_importData
uint[] help
_proof
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must not be equal to 0x0
Source Code
function importMET(
  bytes8 _originChain,
  bytes8 _destinationChain,
  address[] _addresses,
  bytes _extraData,
  bytes32[] _burnHashes,
  uint256[] _supplyOnAllChains,
  uint256[] _importData,
  bytes _proof
) public returns (bool) {
  require(address(tokenPorter) != 0x0);
  return
    tokenPorter.importMET(
      _originChain,
      _destinationChain,
      _addresses,
      _extraData,
      _burnHashes,
      _supplyOnAllChains,
      _importData,
      _proof
    );
}

export keyboard_arrow_up

Parameters help

Name Type
_destChain
bytes8 help
_destMetronomeAddr
address help
_destRecipAddr
address help
_amount
uint help
_fee
uint help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must not be equal to 0x0
Source Code
function export(
  bytes8 _destChain,
  address _destMetronomeAddr,
  address _destRecipAddr,
  uint256 _amount,
  uint256 _fee,
  bytes _extraData
) public returns (bool) {
  require(address(tokenPorter) != 0x0);
  return
    tokenPorter.export(
      msg.sender,
      _destChain,
      _destMetronomeAddr,
      _destRecipAddr,
      _amount,
      _fee,
      _extraData
    );
}

subscribe keyboard_arrow_up

Parameters help

Name Type
_startTime
uint help
_payPerWeek
uint help
_recipient
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function subscribe(
  uint256 _startTime,
  uint256 _payPerWeek,
  address _recipient
) public returns (bool) {
  require(_startTime >= block.timestamp);
  require(_payPerWeek != 0);
  require(_recipient != 0);

  subs[msg.sender][_recipient] = Sub(_startTime, _payPerWeek, _startTime);

  emit LogSubscription(msg.sender, _recipient);
  return true;
}

cancelSubscription keyboard_arrow_up

Parameters help

Name Type
_recipient
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function cancelSubscription(address _recipient) public returns (bool) {
  require(subs[msg.sender][_recipient].startTime != 0);
  require(subs[msg.sender][_recipient].payPerWeek != 0);

  subs[msg.sender][_recipient].startTime = 0;
  subs[msg.sender][_recipient].payPerWeek = 0;
  subs[msg.sender][_recipient].lastWithdrawTime = 0;

  emit LogCancelSubscription(msg.sender, _recipient);
  return true;
}

getSubscription keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_recipient
address help

Properties

Visibility help public
Mutability help constant
Source Code
function getSubscription(address _owner, address _recipient)
  public
  constant
  returns (
    uint256 startTime,
    uint256 payPerWeek,
    uint256 lastWithdrawTime
  )
{
  Sub storage sub = subs[_owner][_recipient];
  return (sub.startTime, sub.payPerWeek, sub.lastWithdrawTime);
}

subWithdraw keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

null
Source Code
function subWithdraw(address _owner) public transferable returns (bool) {
  require(subWithdrawFor(_owner, msg.sender));
  return true;
}

multiSubWithdraw keyboard_arrow_up

Parameters help

Name Type
_owners
address[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function multiSubWithdraw(address[] _owners) public returns (uint256) {
  uint256 n = 0;
  for (uint256 i = 0; i < _owners.length; i++) {
    if (subWithdrawFor(_owners[i], msg.sender)) {
      n++;
    }
  }
  return n;
}

multiSubWithdrawFor keyboard_arrow_up

Parameters help

Name Type
_owners
address[] help
_recipients
address[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function multiSubWithdrawFor(address[] _owners, address[] _recipients)
  public
  returns (uint256)
{
  // owners and recipients need 1-to-1 mapping, must be same length
  require(_owners.length == _recipients.length);

  uint256 n = 0;
  for (uint256 i = 0; i < _owners.length; i++) {
    if (subWithdrawFor(_owners[i], _recipients[i])) {
      n++;
    }
  }

  return n;
}

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.

internal METToken.subWithdrawFor keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function subWithdrawFor(address _from, address _to) internal returns (bool) {
  Sub storage sub = subs[_from][_to];

  if (
    sub.startTime > 0 && sub.startTime < block.timestamp && sub.payPerWeek > 0
  ) {
    uint256 weekElapsed = (now.sub(sub.lastWithdrawTime)).div(7 days);
    uint256 amount = weekElapsed.mul(sub.payPerWeek);
    if (weekElapsed > 0 && _balanceOf[_from] >= amount) {
      subs[_from][_to].lastWithdrawTime = block.timestamp;
      _balanceOf[_from] = _balanceOf[_from].sub(amount);
      _balanceOf[_to] = _balanceOf[_to].add(amount);
      emit Transfer(_from, _to, amount);
      return true;
    }
  }
  return false;
}