ETH Price: $3,928.05 (+1.47%)

Contract

0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Nominate Owner95956522020-03-03 2:57:492056 days ago1583204269IN
Synthetix: Token State Synthetix
0 ETH0.000089242
Set Associated C...95706482020-02-28 7:04:152060 days ago1582873455IN
Synthetix: Token State Synthetix
0 ETH0.000295810
Set Associated C...95190522020-02-20 8:29:162068 days ago1582187356IN
Synthetix: Token State Synthetix
0 ETH0.00014795
Set Associated C...91236942019-12-18 3:29:362132 days ago1576639776IN
Synthetix: Token State Synthetix
0 ETH0.000266229
Set Associated C...90927072019-12-12 5:29:372138 days ago1576128577IN
Synthetix: Token State Synthetix
0 ETH0.000236648
Set Associated C...90073622019-11-27 1:57:082153 days ago1574819828IN
Synthetix: Token State Synthetix
0 ETH0.0003104210.5
Set Associated C...89718032019-11-21 2:10:182159 days ago1574302218IN
Synthetix: Token State Synthetix
0 ETH0.0002962810
Set Associated C...88933102019-11-08 1:13:312172 days ago1573175611IN
Synthetix: Token State Synthetix
0 ETH0.0002962810
Set Associated C...86727182019-10-04 1:25:252207 days ago1570152325IN
Synthetix: Token State Synthetix
0 ETH0.000148145
Set Associated C...86235262019-09-26 8:46:152215 days ago1569487575IN
Synthetix: Token State Synthetix
0 ETH0.0004444215
Set Associated C...84424052019-08-29 2:28:412243 days ago1567045721IN
Synthetix: Token State Synthetix
0 ETH0.000133883
Set Associated C...84422252019-08-29 1:49:112243 days ago1567043351IN
Synthetix: Token State Synthetix
0 ETH0.000028342
Set Associated C...83079912019-08-08 5:12:182264 days ago1565241138IN
Synthetix: Token State Synthetix
0 ETH0.000089252
Set Associated C...83078702019-08-08 4:45:482264 days ago1565239548IN
Synthetix: Token State Synthetix
0 ETH0.000085046
Set Associated C...81204332019-07-10 1:07:572293 days ago1562720877IN
Synthetix: Token State Synthetix
0 ETH0.000133693
Set Associated C...81203382019-07-10 0:42:222293 days ago1562719342IN
Synthetix: Token State Synthetix
0 ETH0.000042523
Set Associated C...78533252019-05-29 8:03:492335 days ago1559117029IN
Synthetix: Token State Synthetix
0 ETH0.0010041322.5
Set Associated C...78529742019-05-29 6:48:222335 days ago1559112502IN
Synthetix: Token State Synthetix
0 ETH0.0002834820
Set Associated C...78477502019-05-28 11:27:422336 days ago1559042862IN
Synthetix: Token State Synthetix
0 ETH0.000312397
Set Associated C...78468872019-05-28 8:13:152336 days ago1559031195IN
Synthetix: Token State Synthetix
0 ETH0.0002395416.9
Set Associated C...76818962019-05-02 13:25:082362 days ago1556803508IN
Synthetix: Token State Synthetix
0 ETH0.000133883
Set Associated C...76818382019-05-02 13:12:332362 days ago1556802753IN
Synthetix: Token State Synthetix
0 ETH0.0002834820
Set Associated C...76818092019-05-02 13:05:472362 days ago1556802347IN
Synthetix: Token State Synthetix
0 ETH0.0004147914
Set Associated C...76805932019-05-02 8:39:202362 days ago1556786360IN
Synthetix: Token State Synthetix
0 ETH0.000133883
Set Associated C...76803832019-05-02 7:51:112362 days ago1556783471IN
Synthetix: Token State Synthetix
0 ETH0.000042523
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenState

Compiler Version
v0.4.21+commit.dfe3193c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-03-14
*/

/*
-----------------------------------------------------------------
FILE HEADER
-----------------------------------------------------------------

file:       TokenState.sol
version:    1.0
author:     Dominic Romanowski
            Anton Jurisevic

date:       2018-2-24
checked:    Anton Jurisevic
approved:   Samuel Brooks

repo:       https://github.com/Havven/havven
commit:     34e66009b98aa18976226c139270970d105045e3

-----------------------------------------------------------------
CONTRACT DESCRIPTION
-----------------------------------------------------------------

An Owned contract, to be inherited by other contracts.
Requires its owner to be explicitly set in the constructor.
Provides an onlyOwner access modifier.

To change owner, the current owner must nominate the next owner,
who then has to accept the nomination. The nomination can be
cancelled before it is accepted by the new owner by having the
previous owner change the nomination (setting it to 0).
-----------------------------------------------------------------
*/

pragma solidity ^0.4.20;

contract Owned {
    address public owner;
    address public nominatedOwner;

    function Owned(address _owner)
        public
    {
        owner = _owner;
    }

    function nominateOwner(address _owner)
        external
        onlyOwner
    {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership()
        external
    {
        require(msg.sender == nominatedOwner);
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner
    {
        require(msg.sender == owner);
        _;
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

/*
-----------------------------------------------------------------
CONTRACT DESCRIPTION
-----------------------------------------------------------------

A contract that holds the state of an ERC20 compliant token.

This contract is used side by side with external state token
contracts, such as Havven and EtherNomin.
It provides an easy way to upgrade contract logic while
maintaining all user balances and allowances. This is designed
to to make the changeover as easy as possible, since mappings
are not so cheap or straightforward to migrate.

The first deployed contract would create this state contract,
using it as its store of balances.
When a new contract is deployed, it links to the existing
state contract, whose owner would then change its associated
contract to the new one.

-----------------------------------------------------------------
*/

contract TokenState is Owned {

    // the address of the contract that can modify balances and allowances
    // this can only be changed by the owner of this contract
    address public associatedContract;

    // ERC20 fields.
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    function TokenState(address _owner, address _associatedContract)
        Owned(_owner)
        public
    {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    /* ========== SETTERS ========== */

    // Change the associated contract to a new address
    function setAssociatedContract(address _associatedContract)
        external
        onlyOwner
    {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    function setAllowance(address tokenOwner, address spender, uint value)
        external
        onlyAssociatedContract
    {
        allowance[tokenOwner][spender] = value;
    }

    function setBalanceOf(address account, uint value)
        external
        onlyAssociatedContract
    {
        balanceOf[account] = value;
    }


    /* ========== MODIFIERS ========== */

    modifier onlyAssociatedContract
    {
        require(msg.sender == associatedContract);
        _;
    }

    /* ========== EVENTS ========== */

    event AssociatedContractUpdated(address _associatedContract);
}

/*
MIT License

Copyright (c) 2018 Havven

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

Contract Security Audit

Contract ABI

API
[{"constant":false,"inputs":[{"name":"_associatedContract","type":"address"}],"name":"setAssociatedContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"nominateOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"associatedContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"account","type":"address"},{"name":"value","type":"uint256"}],"name":"setBalanceOf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokenOwner","type":"address"},{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"setAllowance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_owner","type":"address"},{"name":"_associatedContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_associatedContract","type":"address"}],"name":"AssociatedContractUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"}]

6060604052341561000f57600080fd5b60405160408061054e833981016040528080519190602001805160008054600160a060020a03808716600160a060020a031992831617909255600280549284169290911691909117905591507f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e03905081604051600160a060020a03909116815260200160405180910390a150506104a3806100ab6000396000f3006060604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166352f445ca81146100a857806353a47bb7146100c95780635b94db27146100f857806370a082311461011757806379ba5097146101485780638da5cb5b1461015b578063aefc4ccb1461016e578063b46310f614610181578063da46098c146101a3578063dd62ed3e146101cb575b600080fd5b34156100b357600080fd5b6100c7600160a060020a03600435166101f0565b005b34156100d457600080fd5b6100dc610273565b604051600160a060020a03909116815260200160405180910390f35b341561010357600080fd5b6100c7600160a060020a0360043516610282565b341561012257600080fd5b610136600160a060020a0360043516610305565b60405190815260200160405180910390f35b341561015357600080fd5b6100c7610317565b341561016657600080fd5b6100dc6103be565b341561017957600080fd5b6100dc6103cd565b341561018c57600080fd5b6100c7600160a060020a03600435166024356103dc565b34156101ae57600080fd5b6100c7600160a060020a0360043581169060243516604435610413565b34156101d657600080fd5b610136600160a060020a036004358116906024351661045a565b60005433600160a060020a0390811691161461020b57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e0381604051600160a060020a03909116815260200160405180910390a150565b600154600160a060020a031681565b60005433600160a060020a0390811691161461029d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051600160a060020a03909116815260200160405180910390a150565b60036020526000908152604090205481565b60015433600160a060020a0390811691161461033257600080fd5b6000546001547fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b600254600160a060020a031681565b60025433600160a060020a039081169116146103f757600080fd5b600160a060020a03909116600090815260036020526040902055565b60025433600160a060020a0390811691161461042e57600080fd5b600160a060020a0392831660009081526004602090815260408083209490951682529290925291902055565b6004602090815260009283526040808420909152908252902054815600a165627a7a723058209935728c67159e8666aaf1f8bebe605062165879ffdd6fcf02278a42ec68458b0029000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead

Deployed Bytecode

0x6060604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166352f445ca81146100a857806353a47bb7146100c95780635b94db27146100f857806370a082311461011757806379ba5097146101485780638da5cb5b1461015b578063aefc4ccb1461016e578063b46310f614610181578063da46098c146101a3578063dd62ed3e146101cb575b600080fd5b34156100b357600080fd5b6100c7600160a060020a03600435166101f0565b005b34156100d457600080fd5b6100dc610273565b604051600160a060020a03909116815260200160405180910390f35b341561010357600080fd5b6100c7600160a060020a0360043516610282565b341561012257600080fd5b610136600160a060020a0360043516610305565b60405190815260200160405180910390f35b341561015357600080fd5b6100c7610317565b341561016657600080fd5b6100dc6103be565b341561017957600080fd5b6100dc6103cd565b341561018c57600080fd5b6100c7600160a060020a03600435166024356103dc565b34156101ae57600080fd5b6100c7600160a060020a0360043581169060243516604435610413565b34156101d657600080fd5b610136600160a060020a036004358116906024351661045a565b60005433600160a060020a0390811691161461020b57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f73f20cff579e8a4086fa607db83867595f1b6a798e718c0bfa0b94a404128e0381604051600160a060020a03909116815260200160405180910390a150565b600154600160a060020a031681565b60005433600160a060020a0390811691161461029d57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051600160a060020a03909116815260200160405180910390a150565b60036020526000908152604090205481565b60015433600160a060020a0390811691161461033257600080fd5b6000546001547fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b600254600160a060020a031681565b60025433600160a060020a039081169116146103f757600080fd5b600160a060020a03909116600090815260036020526040902055565b60025433600160a060020a0390811691161461042e57600080fd5b600160a060020a0392831660009081526004602090815260408083209490951682529290925291902055565b6004602090815260009283526040808420909152908252902054815600a165627a7a723058209935728c67159e8666aaf1f8bebe605062165879ffdd6fcf02278a42ec68458b0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead

-----Decoded View---------------
Arg [0] : _owner (address): 0xb10C85274d2a58dDeC72C1D826e75256fF93DEad
Arg [1] : _associatedContract (address): 0xb10C85274d2a58dDeC72C1D826e75256fF93DEad

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead
Arg [1] : 000000000000000000000000b10c85274d2a58ddec72c1d826e75256ff93dead


Swarm Source

bzzr://9935728c67159e8666aaf1f8bebe605062165879ffdd6fcf02278a42ec68458b

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

A contract that holds the state of an ERC20 compliant token.

This contract is used side by side with external state token contracts, such as Synthetix and Synth.
It provides an easy way to upgrade contract logic while maintaining all user balances and allowances. This is designed to make the changeover as easy as possible, since mappings are not so cheap or straightforward to migrate.

The first deployed contract would create this state contract, using it as its store of balances.
When a new contract is deployed, it links to the existing state contract, whose owner would then change its associated contract to the new one.

Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.