Blockwell

Metronome

ERC20

This contract is an ERC20 token.

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

About link

Metronome aims to optimize for self-governance, reliability, and portability. Founded by a number of veterans in the space (e.g. Jeff Garzik, Matthew Roszak), Metronome is founded on three key design principles: - Self-governance with no undue influence from founders after initial launch and public access — contract governance starts at launch. - Reliability and predictability where issuance and supply are immutable - Portability to enable maximum decentralization, even across different blockchains. The first 'chainhop' took place in summer 2019, between Ethereum and Ethereum Classic Additionally, Metronome reportedly offers advanced payment features as programmable money. - Mass pay: The ability to send MET to multiple addresses in a single transaction to save on transaction fees. - Subscriptions: The ability to authorize a set amount of MET to move between two addresses on a recurring basis.

Stats

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

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 Event

Members
startTime
uint help
payPerWeek
uint help
lastWithdrawTime
uint help

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, uint _initialSupply, 
        uint _decmult) public onlyOwner {
        require(autonomousConverter == 0x0 && _autonomousConverter != 0x0);
        require(minter == 0x0 && _minter != 0x0);
      
        autonomousConverter = _autonomousConverter;
        minter = _minter;
        _totalSupply = _initialSupply.mul(_decmult);
        _balanceOf[_autonomousConverter] = _totalSupply;
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

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, uint _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, uint _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,
     uint _initialSupply, uint _decmult) public onlyOwner {
        initMintable(_autonomousConverter, _minter, _initialSupply, _decmult);
    }

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

transfer keyboard_arrow_up

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

transferFrom keyboard_arrow_up

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

approve keyboard_arrow_up

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(uint[] 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) {
        uint previous = _allowance[msg.sender][_spender];
        uint 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) {
        uint previous = _allowance[msg.sender][_spender];
        uint 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, 
        uint _initialSupply, uint _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

Source Code
    function importMET(bytes8 _originChain, bytes8 _destinationChain, address[] _addresses, bytes _extraData, 
        bytes32[] _burnHashes, uint[] _supplyOnAllChains, uint[] _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

Source Code
    function export(bytes8 _destChain, address _destMetronomeAddr, address _destRecipAddr, uint _amount, uint _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(uint _startTime, uint _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 (uint startTime, uint payPerWeek, uint 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 (uint) {
        uint n = 0;
        for (uint 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 (uint) {
        // owners and recipients need 1-to-1 mapping, must be same length
        require(_owners.length == _recipients.length);

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

        return n;
    }