Contract 0x8E2a84D6adE1E7ffFEe039A35EF5F19F13057152 7

Maker 
 
 
Txn Hash
Method
Block
From
To
Value
0x2da1cfb607b2b84e6ea253ee6c4af80547c767787dc985cb8afc09ec6a5117b6Vote144833012022-03-29 20:35:32243 days 21 hrs ago0xed02383d3b21052a02eda1b456f0f154738e7a2d IN  Maker: Contract 80 Ether0.00327941 47.37526319
0xc7cc646ffdca56324baed978890ac36d848b6bde65179e458487a25313662818Etch144832952022-03-29 20:33:18243 days 21 hrs ago0xed02383d3b21052a02eda1b456f0f154738e7a2d IN  Maker: Contract 80 Ether0.00116163 33.53737054
0x159047545b63aeaa24f433de8ea5fe6ff89850b2c85ad5de41e3c45aafc630beLock91199072019-12-17 9:15:481077 days 9 hrs ago0x40502eaa3fcfd60ef97162a8b2246995e42dbeac IN  Maker: Contract 80 Ether0.000778249
0x1200b054083865dbe6193c4b3969661d91910a353a1b21dbb24c7f35df5e0ce1Free89380722019-11-15 11:01:281109 days 7 hrs ago0x260a230e4465077e0b14ee4442a482d5b0c914bf IN  Maker: Contract 80 Ether0.000330538
0xca4484535ba03d9da326a104023dbd8d18505c787cbd879ab0d841a64b7218c9Free81543572019-07-15 7:50:321232 days 10 hrs ago0x84b038a13577ac747f5461e08dbea8e13690c966 IN  Maker: Contract 80 Ether0.000330028
0x8f6626ff0500d95d6d53a50d9d4221cfad0da2631e527803775c708431ac9e5fLift78993442019-06-05 12:54:321272 days 5 hrs ago0x3dc389e0a69d6364a66ab64ebd51234da9569284 IN  Maker: Contract 80 Ether0.0006800225
0x7ff44157a75bc84b486c3638f9810647b832d9c85538f5ade9cb763feb552c6bFree78256652019-05-25 0:51:471283 days 17 hrs ago0x12ffe81357edff821da6462f7d4c7eb689e5b21a IN  Maker: Contract 80 Ether0.0003396713
0x49db8b8940461314baa006feade72736c19cd9ac8f2f7ca1261a33eae381868eFree78256492019-05-25 0:48:431283 days 17 hrs ago0xafb5b9515ce5a781ebf41fadd5a2a1c04c73d55e IN  Maker: Contract 80 Ether0.000026810.65
0x73c7496d931957d7df6a92cd5e308da1a3a4914f6244ea41668a81a354551771Free78255462019-05-25 0:25:471283 days 18 hrs ago0x12ffe81357edff821da6462f7d4c7eb689e5b21a IN  Maker: Contract 80 Ether0.0002874111
0x759120a599fdb99527feb16fef2149056316da8756c4d08c71e4dd0dcc566663Free78255462019-05-25 0:25:471283 days 18 hrs ago0x12ffe81357edff821da6462f7d4c7eb689e5b21a IN  Maker: Contract 80 Ether0.000209038
0x1857a70ba0e4f1c96bfb60567e3a110ccd9ba09b46ce3ad7328796f93654284aFree78255462019-05-25 0:25:471283 days 18 hrs ago0x12ffe81357edff821da6462f7d4c7eb689e5b21a IN  Maker: Contract 80 Ether0.000209038
0x6f27813828cedfe07f93799da8794b31ea587c88e609e320e448560d8b96491eFree78255462019-05-25 0:25:471283 days 18 hrs ago0x12ffe81357edff821da6462f7d4c7eb689e5b21a IN  Maker: Contract 80 Ether0.000450028
0x5c6c1d95fa4fd8d83961bc584d62c534e8dac98cc6135b9d83fcfb4054d5029fFree78170302019-05-23 16:27:211285 days 2 hrs ago0xfcc21467aad0b321ac22bf6b249191365e695294 IN  Maker: Contract 80 Ether0.000285018
0x5676477772cbd2d48bf1b2ef60112facdb1499ddc6d2d1213c9394f4d7a2ee12Free78135522019-05-23 3:18:311285 days 15 hrs ago0xa68a425b8db548eb0b278c4b1b864809f2f5cd09 IN  Maker: Contract 80 Ether0.000330028
0x00d34e04bfd8cd1ef1696077793de1b0ccfefba703fba897f6ba2187243ec9fdFree77752252019-05-17 3:06:201291 days 15 hrs ago0x36034cba5413c0678b8256acd0a87af4e9d0873a IN  Maker: Contract 80 Ether0.0008250620
0x1154c1fb9ae51a0b99171feeafa28afc4c7bd62b63ffbd20d9bb6f409365113eFree77512412019-05-13 9:36:081295 days 8 hrs ago0x185a7fc4ace368d233e620b2a45935661292bdf2 IN  Maker: Contract 80 Ether0.000275398
0x1bddda7a2b552286268514fbf3ad05b674effb1fc560b9f560ba2fa885b18b30Free77242892019-05-09 4:28:311299 days 14 hrs ago0x08e417a21e35d166cf02aa215789164fcabf71b9 IN  Maker: Contract 80 Ether0.000450028
0xb5757a2ba82d2c95598d8cd9d37f79fd2024201c460e176d886ebb9c53490c01Free77227632019-05-08 22:43:551299 days 19 hrs ago0x22acb809d08ae7c79f0b84513efce0577acfe514 IN  Maker: Contract 80 Ether0.000123753
0x2bb489083cbaa2e847206d3f831ecf39aa72e401d78cc6255184c3f26b361a90Free77227042019-05-08 22:27:591299 days 20 hrs ago0x22acb809d08ae7c79f0b84513efce0577acfe514 IN  Maker: Contract 80 Ether0.000346418
0x78ca2a3e1e8677f95bac05c500ed566b7ce0cc5721d07c3c6d616311a3d565cbFree77155672019-05-07 19:35:471300 days 22 hrs ago0x1d8aa18cd769971439fef1a7b0abce8b83f114fa IN  Maker: Contract 80 Ether0.000377398
0x5530da585dc5a32216c1a0002bb9c477fc8db658e6773fc9ad2bc8783441ac47Free77155592019-05-07 19:34:141300 days 22 hrs ago0x4f28ce380aa718310700f673d96e8eeb8b679856 IN  Maker: Contract 80 Ether0.000206265
0x4213b0209181d52b02e8e87f781759bcd590568e2e10e2bcf76f2f1d3d9c3ce9Free77155172019-05-07 19:24:131300 days 23 hrs ago0x1d8aa18cd769971439fef1a7b0abce8b83f114fa IN  Maker: Contract 80 Ether0.000347958
0xbef13e967e3afb5a3373ab9d0d711cf404ac5224759123bbec2531d65f16b740Free77155112019-05-07 19:21:381300 days 23 hrs ago0x1d8aa18cd769971439fef1a7b0abce8b83f114fa IN  Maker: Contract 80 Ether0.000347958
0xf04e97be18d7be13bdcc814ffe564e84952a538bbdcebe11b0576370c57167feFree77149982019-05-07 17:19:451301 days 1 hr ago0xef3ac842c0844ba5772ea98f1d48811b86edb2b1 IN  Maker: Contract 80 Ether0.000330538
0x48141441bf76e1424228a6f5571c75e5bb757dc645b636ec7cf70176263e1800Free77149652019-05-07 17:10:471301 days 1 hr ago0x0caf24c0747f24e2167765f5bdd0d35acad3abab IN  Maker: Contract 80 Ether0.00050678
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DSChief

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2017-12-17
*/

// hevm: flattened sources of src/chief.sol
pragma solidity ^0.4.17;

////// lib/ds-roles/lib/ds-auth/src/auth.sol
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

contract DSAuthority {
    function canCall(
        address src, address dst, bytes4 sig
    ) public view returns (bool);
}

contract DSAuthEvents {
    event LogSetAuthority (address indexed authority);
    event LogSetOwner     (address indexed owner);
}

contract DSAuth is DSAuthEvents {
    DSAuthority  public  authority;
    address      public  owner;

    function DSAuth() public {
        owner = msg.sender;
        LogSetOwner(msg.sender);
    }

    function setOwner(address owner_)
        public
        auth
    {
        owner = owner_;
        LogSetOwner(owner);
    }

    function setAuthority(DSAuthority authority_)
        public
        auth
    {
        authority = authority_;
        LogSetAuthority(authority);
    }

    modifier auth {
        require(isAuthorized(msg.sender, msg.sig));
        _;
    }

    function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
        if (src == address(this)) {
            return true;
        } else if (src == owner) {
            return true;
        } else if (authority == DSAuthority(0)) {
            return false;
        } else {
            return authority.canCall(src, this, sig);
        }
    }
}

////// lib/ds-roles/src/roles.sol
// roles.sol - roled based authentication

// Copyright (C) 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

/* import 'ds-auth/auth.sol'; */

contract DSRoles is DSAuth, DSAuthority
{
    mapping(address=>bool) _root_users;
    mapping(address=>bytes32) _user_roles;
    mapping(address=>mapping(bytes4=>bytes32)) _capability_roles;
    mapping(address=>mapping(bytes4=>bool)) _public_capabilities;

    function getUserRoles(address who)
        public
        view
        returns (bytes32)
    {
        return _user_roles[who];
    }

    function getCapabilityRoles(address code, bytes4 sig)
        public
        view
        returns (bytes32)
    {
        return _capability_roles[code][sig];
    }

    function isUserRoot(address who)
        public
        view
        returns (bool)
    {
        return _root_users[who];
    }

    function isCapabilityPublic(address code, bytes4 sig)
        public
        view
        returns (bool)
    {
        return _public_capabilities[code][sig];
    }

    function hasUserRole(address who, uint8 role)
        public
        view
        returns (bool)
    {
        bytes32 roles = getUserRoles(who);
        bytes32 shifted = bytes32(uint256(uint256(2) ** uint256(role)));
        return bytes32(0) != roles & shifted;
    }

    function canCall(address caller, address code, bytes4 sig)
        public
        view
        returns (bool)
    {
        if( isUserRoot(caller) || isCapabilityPublic(code, sig) ) {
            return true;
        } else {
            var has_roles = getUserRoles(caller);
            var needs_one_of = getCapabilityRoles(code, sig);
            return bytes32(0) != has_roles & needs_one_of;
        }
    }

    function BITNOT(bytes32 input) internal pure returns (bytes32 output) {
        return (input ^ bytes32(uint(-1)));
    }

    function setRootUser(address who, bool enabled)
        public
        auth
    {
        _root_users[who] = enabled;
    }

    function setUserRole(address who, uint8 role, bool enabled)
        public
        auth
    {
        var last_roles = _user_roles[who];
        bytes32 shifted = bytes32(uint256(uint256(2) ** uint256(role)));
        if( enabled ) {
            _user_roles[who] = last_roles | shifted;
        } else {
            _user_roles[who] = last_roles & BITNOT(shifted);
        }
    }

    function setPublicCapability(address code, bytes4 sig, bool enabled)
        public
        auth
    {
        _public_capabilities[code][sig] = enabled;
    }

    function setRoleCapability(uint8 role, address code, bytes4 sig, bool enabled)
        public
        auth
    {
        var last_roles = _capability_roles[code][sig];
        bytes32 shifted = bytes32(uint256(uint256(2) ** uint256(role)));
        if( enabled ) {
            _capability_roles[code][sig] = last_roles | shifted;
        } else {
            _capability_roles[code][sig] = last_roles & BITNOT(shifted);
        }

    }

}

////// lib/ds-thing/lib/ds-math/src/math.sol
/// math.sol -- mixin for inline numerical wizardry

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

contract DSMath {
    function add(uint x, uint y) internal pure returns (uint z) {
        require((z = x + y) >= x);
    }
    function sub(uint x, uint y) internal pure returns (uint z) {
        require((z = x - y) <= x);
    }
    function mul(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x);
    }

    function min(uint x, uint y) internal pure returns (uint z) {
        return x <= y ? x : y;
    }
    function max(uint x, uint y) internal pure returns (uint z) {
        return x >= y ? x : y;
    }
    function imin(int x, int y) internal pure returns (int z) {
        return x <= y ? x : y;
    }
    function imax(int x, int y) internal pure returns (int z) {
        return x >= y ? x : y;
    }

    uint constant WAD = 10 ** 18;
    uint constant RAY = 10 ** 27;

    function wmul(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, y), WAD / 2) / WAD;
    }
    function rmul(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, y), RAY / 2) / RAY;
    }
    function wdiv(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, WAD), y / 2) / y;
    }
    function rdiv(uint x, uint y) internal pure returns (uint z) {
        z = add(mul(x, RAY), y / 2) / y;
    }

    // This famous algorithm is called "exponentiation by squaring"
    // and calculates x^n with x as fixed-point and n as regular unsigned.
    //
    // It's O(log n), instead of O(n) for naive repeated multiplication.
    //
    // These facts are why it works:
    //
    //  If n is even, then x^n = (x^2)^(n/2).
    //  If n is odd,  then x^n = x * x^(n-1),
    //   and applying the equation for even x gives
    //    x^n = x * (x^2)^((n-1) / 2).
    //
    //  Also, EVM division is flooring and
    //    floor[(n-1) / 2] = floor[n / 2].
    //
    function rpow(uint x, uint n) internal pure returns (uint z) {
        z = n % 2 != 0 ? x : RAY;

        for (n /= 2; n != 0; n /= 2) {
            x = rmul(x, x);

            if (n % 2 != 0) {
                z = rmul(z, x);
            }
        }
    }
}

////// lib/ds-thing/lib/ds-note/src/note.sol
/// note.sol -- the `note' modifier, for logging calls as events

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

contract DSNote {
    event LogNote(
        bytes4   indexed  sig,
        address  indexed  guy,
        bytes32  indexed  foo,
        bytes32  indexed  bar,
        uint              wad,
        bytes             fax
    ) anonymous;

    modifier note {
        bytes32 foo;
        bytes32 bar;

        assembly {
            foo := calldataload(4)
            bar := calldataload(36)
        }

        LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);

        _;
    }
}

////// lib/ds-thing/src/thing.sol
// thing.sol - `auth` with handy mixins. your things should be DSThings

// Copyright (C) 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

/* import 'ds-auth/auth.sol'; */
/* import 'ds-note/note.sol'; */
/* import 'ds-math/math.sol'; */

contract DSThing is DSAuth, DSNote, DSMath {

    function S(string s) internal pure returns (bytes4) {
        return bytes4(keccak256(s));
    }

}

////// lib/ds-token/lib/ds-stop/src/stop.sol
/// stop.sol -- mixin for enable/disable functionality

// Copyright (C) 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

/* import "ds-auth/auth.sol"; */
/* import "ds-note/note.sol"; */

contract DSStop is DSNote, DSAuth {

    bool public stopped;

    modifier stoppable {
        require(!stopped);
        _;
    }
    function stop() public auth note {
        stopped = true;
    }
    function start() public auth note {
        stopped = false;
    }

}

////// lib/ds-token/lib/erc20/src/erc20.sol
/// erc20.sol -- API for the ERC20 token standard

// See <https://github.com/ethereum/EIPs/issues/20>.

// This file likely does not meet the threshold of originality
// required for copyright to apply.  As a result, this is free and
// unencumbered software belonging to the public domain.

/* pragma solidity ^0.4.8; */

contract ERC20Events {
    event Approval(address indexed src, address indexed guy, uint wad);
    event Transfer(address indexed src, address indexed dst, uint wad);
}

contract ERC20 is ERC20Events {
    function totalSupply() public view returns (uint);
    function balanceOf(address guy) public view returns (uint);
    function allowance(address src, address guy) public view returns (uint);

    function approve(address guy, uint wad) public returns (bool);
    function transfer(address dst, uint wad) public returns (bool);
    function transferFrom(
        address src, address dst, uint wad
    ) public returns (bool);
}

////// lib/ds-token/src/base.sol
/// base.sol -- basic ERC20 implementation

// Copyright (C) 2015, 2016, 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

/* import "erc20/erc20.sol"; */
/* import "ds-math/math.sol"; */

contract DSTokenBase is ERC20, DSMath {
    uint256                                            _supply;
    mapping (address => uint256)                       _balances;
    mapping (address => mapping (address => uint256))  _approvals;

    function DSTokenBase(uint supply) public {
        _balances[msg.sender] = supply;
        _supply = supply;
    }

    function totalSupply() public view returns (uint) {
        return _supply;
    }
    function balanceOf(address src) public view returns (uint) {
        return _balances[src];
    }
    function allowance(address src, address guy) public view returns (uint) {
        return _approvals[src][guy];
    }

    function transfer(address dst, uint wad) public returns (bool) {
        return transferFrom(msg.sender, dst, wad);
    }

    function transferFrom(address src, address dst, uint wad)
        public
        returns (bool)
    {
        if (src != msg.sender) {
            _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
        }

        _balances[src] = sub(_balances[src], wad);
        _balances[dst] = add(_balances[dst], wad);

        Transfer(src, dst, wad);

        return true;
    }

    function approve(address guy, uint wad) public returns (bool) {
        _approvals[msg.sender][guy] = wad;

        Approval(msg.sender, guy, wad);

        return true;
    }
}

////// lib/ds-token/src/token.sol
/// token.sol -- ERC20 implementation with minting and burning

// Copyright (C) 2015, 2016, 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.13; */

/* import "ds-stop/stop.sol"; */

/* import "./base.sol"; */

contract DSToken is DSTokenBase(0), DSStop {

    bytes32  public  symbol;
    uint256  public  decimals = 18; // standard token precision. override to customize

    function DSToken(bytes32 symbol_) public {
        symbol = symbol_;
    }

    event Mint(address indexed guy, uint wad);
    event Burn(address indexed guy, uint wad);

    function approve(address guy) public stoppable returns (bool) {
        return super.approve(guy, uint(-1));
    }

    function approve(address guy, uint wad) public stoppable returns (bool) {
        return super.approve(guy, wad);
    }

    function transferFrom(address src, address dst, uint wad)
        public
        stoppable
        returns (bool)
    {
        if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) {
            _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
        }

        _balances[src] = sub(_balances[src], wad);
        _balances[dst] = add(_balances[dst], wad);

        Transfer(src, dst, wad);

        return true;
    }

    function push(address dst, uint wad) public {
        transferFrom(msg.sender, dst, wad);
    }
    function pull(address src, uint wad) public {
        transferFrom(src, msg.sender, wad);
    }
    function move(address src, address dst, uint wad) public {
        transferFrom(src, dst, wad);
    }

    function mint(uint wad) public {
        mint(msg.sender, wad);
    }
    function burn(uint wad) public {
        burn(msg.sender, wad);
    }
    function mint(address guy, uint wad) public auth stoppable {
        _balances[guy] = add(_balances[guy], wad);
        _supply = add(_supply, wad);
        Mint(guy, wad);
    }
    function burn(address guy, uint wad) public auth stoppable {
        if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) {
            _approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad);
        }

        _balances[guy] = sub(_balances[guy], wad);
        _supply = sub(_supply, wad);
        Burn(guy, wad);
    }

    // Optional token name
    bytes32   public  name = "";

    function setName(bytes32 name_) public auth {
        name = name_;
    }
}

////// src/chief.sol
// chief.sol - select an authority by consensus

// Copyright (C) 2017  DappHub, LLC

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/* pragma solidity ^0.4.17; */

/* import 'ds-token/token.sol'; */
/* import 'ds-roles/roles.sol'; */
/* import 'ds-thing/thing.sol'; */

// The right way to use this contract is probably to mix it with some kind
// of `DSAuthority`, like with `ds-roles`.
//   SEE DSChief
contract DSChiefApprovals is DSThing {
    mapping(bytes32=>address[]) public slates;
    mapping(address=>bytes32) public votes;
    mapping(address=>uint256) public approvals;
    mapping(address=>uint256) public deposits;
    DSToken public GOV; // voting token that gets locked up
    DSToken public IOU; // non-voting representation of a token, for e.g. secondary voting mechanisms
    address public hat; // the chieftain's hat

    uint256 public MAX_YAYS;

    event Etch(bytes32 indexed slate);

    // IOU constructed outside this contract reduces deployment costs significantly
    // lock/free/vote are quite sensitive to token invariants. Caution is advised.
    function DSChiefApprovals(DSToken GOV_, DSToken IOU_, uint MAX_YAYS_) public
    {
        GOV = GOV_;
        IOU = IOU_;
        MAX_YAYS = MAX_YAYS_;
    }

    function lock(uint wad)
        public
        note
    {
        GOV.pull(msg.sender, wad);
        IOU.mint(msg.sender, wad);
        deposits[msg.sender] = add(deposits[msg.sender], wad);
        addWeight(wad, votes[msg.sender]);
    }

    function free(uint wad)
        public
        note
    {
        deposits[msg.sender] = sub(deposits[msg.sender], wad);
        subWeight(wad, votes[msg.sender]);
        IOU.burn(msg.sender, wad);
        GOV.push(msg.sender, wad);
    }

    function etch(address[] yays)
        public
        note
        returns (bytes32 slate)
    {
        require( yays.length <= MAX_YAYS );
        requireByteOrderedSet(yays);

        bytes32 hash = keccak256(yays);
        slates[hash] = yays;
        Etch(hash);
        return hash;
    }

    function vote(address[] yays) public returns (bytes32)
        // note  both sub-calls note
    {
        var slate = etch(yays);
        vote(slate);
        return slate;
    }

    function vote(bytes32 slate)
        public
        note
    {
        uint weight = deposits[msg.sender];
        subWeight(weight, votes[msg.sender]);
        votes[msg.sender] = slate;
        addWeight(weight, votes[msg.sender]);
    }

    // like `drop`/`swap` except simply "elect this address if it is higher than current hat"
    function lift(address whom)
        public
        note
    {
        require(approvals[whom] > approvals[hat]);
        hat = whom;
    }

    function addWeight(uint weight, bytes32 slate)
        internal
    {
        var yays = slates[slate];
        for( uint i = 0; i < yays.length; i++) {
            approvals[yays[i]] = add(approvals[yays[i]], weight);
        }
    }

    function subWeight(uint weight, bytes32 slate)
        internal
    {
        var yays = slates[slate];
        for( uint i = 0; i < yays.length; i++) {
            approvals[yays[i]] = sub(approvals[yays[i]], weight);
        }
    }

    // Throws unless the array of addresses is a ordered set.
    function requireByteOrderedSet(address[] yays)
        internal
        pure
    {
        if( yays.length == 0 || yays.length == 1 ) {
            return;
        }
        for( uint i = 0; i < yays.length - 1; i++ ) {
            // strict inequality ensures both ordering and uniqueness
            require(uint(bytes32(yays[i])) < uint256(bytes32(yays[i+1])));
        }
    }
}


// `hat` address is unique root user (has every role) and the
// unique owner of role 0 (typically 'sys' or 'internal')
contract DSChief is DSRoles, DSChiefApprovals {

    function DSChief(DSToken GOV, DSToken IOU, uint MAX_YAYS)
             DSChiefApprovals (GOV, IOU, MAX_YAYS)
        public
    {
        authority = this;
        owner = 0;
    }

    function setOwner(address owner_) public {
        owner_;
        revert();
    }

    function setAuthority(DSAuthority authority_) public {
        authority_;
        revert();
    }

    function isUserRoot(address who)
        public
        constant
        returns (bool)
    {
        return (who == hat);
    }
    function setRootUser(address who, bool enabled) public {
        who; enabled;
        revert();
    }
}

contract DSChiefFab {
    function newChief(DSToken gov, uint MAX_YAYS) public returns (DSChief chief) {
        DSToken iou = new DSToken('IOU');
        chief = new DSChief(gov, iou, MAX_YAYS);
        iou.setOwner(chief);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"IOU","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"getUserRoles","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"GOV","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"code","type":"address"},{"name":"sig","type":"bytes4"}],"name":"getCapabilityRoles","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"code","type":"address"},{"name":"sig","type":"bytes4"}],"name":"isCapabilityPublic","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_YAYS","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"whom","type":"address"}],"name":"lift","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"yays","type":"address[]"}],"name":"etch","outputs":[{"name":"slate","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"approvals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"who","type":"address"},{"name":"role","type":"uint8"},{"name":"enabled","type":"bool"}],"name":"setUserRole","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"role","type":"uint8"},{"name":"code","type":"address"},{"name":"sig","type":"bytes4"},{"name":"enabled","type":"bool"}],"name":"setRoleCapability","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":"who","type":"address"},{"name":"role","type":"uint8"}],"name":"hasUserRole","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"slate","type":"bytes32"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"caller","type":"address"},{"name":"code","type":"address"},{"name":"sig","type":"bytes4"}],"name":"canCall","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"uint256"}],"name":"slates","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"code","type":"address"},{"name":"sig","type":"bytes4"},{"name":"enabled","type":"bool"}],"name":"setPublicCapability","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"who","type":"address"},{"name":"enabled","type":"bool"}],"name":"setRootUser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"votes","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"free","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"lock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"yays","type":"address[]"}],"name":"vote","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"isUserRoot","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"deposits","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"GOV","type":"address"},{"name":"IOU","type":"address"},{"name":"MAX_YAYS","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"slate","type":"bytes32"}],"name":"Etch","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]

6060604052341561000f57600080fd5b6040516060806112fb83398101604052808051919060200180519190602001805160018054600160a060020a03191633600160a060020a0316908117909155909250849150839083907fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a2600a8054600160a060020a0319908116600160a060020a0395861617909155600b8054821693851693909317909255600d556000805482163090931692909217825560018054909116905561121993508392506100e29150396000f3006060604052600436106101505763ffffffff60e060020a600035041663046c472f811461015557806306a36aee1461018457806313af4035146101b5578063180cb47f146101d657806327538e90146101e95780632f47571f14610215578063362344b8146102555780633c278bd5146102685780635123e1fa146102875780635d0341ba146102d657806367aff484146102f55780637a9e5e4b146101b55780637d40583d1461031f5780638da5cb5b14610356578063a078f73714610369578063a69beaba1461038e578063b7009613146103a4578063bf7e214f146103d6578063c2ffc7bb146103e9578063c6b0263e14610402578063d381ba7c14610433578063d8bff5a514610457578063d8ccd0f314610476578063dd4670641461048c578063ed081329146104a2578063fbf80773146104f1578063fc7e286d14610510578063fe95a5ce1461052f575b600080fd5b341561016057600080fd5b610168610542565b604051600160a060020a03909116815260200160405180910390f35b341561018f57600080fd5b6101a3600160a060020a0360043516610551565b60405190815260200160405180910390f35b34156101c057600080fd5b6101d4600160a060020a0360043516610150565b005b34156101e157600080fd5b61016861056c565b34156101f457600080fd5b6101a3600160a060020a0360043516600160e060020a03196024351661057b565b341561022057600080fd5b610241600160a060020a0360043516600160e060020a0319602435166105b0565b604051901515815260200160405180910390f35b341561026057600080fd5b6101a36105e7565b341561027357600080fd5b6101d4600160a060020a03600435166105ed565b341561029257600080fd5b6101a360046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506106a495505050505050565b34156102e157600080fd5b6101a3600160a060020a03600435166107ad565b341561030057600080fd5b6101d4600160a060020a036004351660ff6024351660443515156107bf565b341561032a57600080fd5b6101d460ff60043516600160a060020a0360243516600160e060020a031960443516606435151561085b565b341561036157600080fd5b610168610937565b341561037457600080fd5b610241600160a060020a036004351660ff60243516610946565b341561039957600080fd5b6101d460043561096a565b34156103af57600080fd5b610241600160a060020a0360043581169060243516600160e060020a031960443516610a1d565b34156103e157600080fd5b610168610a71565b34156103f457600080fd5b610168600435602435610a80565b341561040d57600080fd5b6101d4600160a060020a0360043516600160e060020a0319602435166044351515610ab7565b341561043e57600080fd5b6101d4600160a060020a03600435166024351515610150565b341561046257600080fd5b6101a3600160a060020a0360043516610b19565b341561048157600080fd5b6101d4600435610b2b565b341561049757600080fd5b6101d4600435610ca6565b34156104ad57600080fd5b6101a36004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650610e2995505050505050565b34156104fc57600080fd5b610241600160a060020a0360043516610e40565b341561051b57600080fd5b6101a3600160a060020a0360043516610e54565b341561053a57600080fd5b610168610e66565b600b54600160a060020a031681565b600160a060020a031660009081526003602052604090205490565b600a54600160a060020a031681565b600160a060020a0382166000908152600460209081526040808320600160e060020a0319851684529091529020545b92915050565b600160a060020a0382166000908152600560209081526040808320600160e060020a03198516845290915290205460ff1692915050565b600d5481565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600c54600160a060020a039081166000908152600860205260408082205492861682529020541161067357600080fd5b5050600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600d548551111561070a57600080fd5b61071385610e75565b8460405180828051906020019060200280838360005b83811015610741578082015183820152602001610729565b505050509050019150506040519081900390206000818152600660205260409020909350858051610776929160200190611145565b50827f4f0892983790f53eea39a7a496f6cb40e8811b313871337b6a761efc6c67bb1f60405160405180910390a250909392505050565b60086020526000908152604090205481565b6000806107d833600035600160e060020a031916610ef7565b15156107e357600080fd5b5050600160a060020a03831660009081526003602052604090205460ff831660020a821561082d57600160a060020a03851660009081526003602052604090208282179055610854565b61083681610fee565b600160a060020a038616600090815260036020526040902090831690555b5050505050565b60008061087433600035600160e060020a031916610ef7565b151561087f57600080fd5b5050600160a060020a0383166000908152600460209081526040808320600160e060020a03198616845290915290205460ff851660020a82156108f357600160a060020a0385166000908152600460209081526040808320600160e060020a0319881684529091529020828217905561092f565b6108fc81610fee565b600160a060020a0386166000908152600460209081526040808320600160e060020a031989168452909152902090831690555b505050505050565b600154600160a060020a031681565b600080600061095485610551565b60ff9490941660020a9093161515949350505050565b60006004356024358082600160a060020a033316600160e060020a031986351634873660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a0333166000908152600960209081526040808320546007909252909120549093506109f2908490610ff5565b600160a060020a0333166000908152600760205260409020849055610a17838561108d565b50505050565b6000806000610a2b86610e40565b80610a3b5750610a3b85856105b0565b15610a495760019250610a68565b610a5286610551565b9150610a5e858561057b565b8281161515935090505b50509392505050565b600054600160a060020a031681565b600660205281600052604060002081815481101515610a9b57fe5b600091825260209091200154600160a060020a03169150829050565b610acd33600035600160e060020a031916610ef7565b1515610ad857600080fd5b600160a060020a039092166000908152600560209081526040808320600160e060020a0319909416835292905220805491151560ff19909216919091179055565b60076020526000908152604090205481565b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600160a060020a033316600090815260096020526040902054610ba49084611125565b600160a060020a033316600090815260096020908152604080832093909355600790522054610bd4908490610ff5565b600b54600160a060020a0316639dc29fac338560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610c2a57600080fd5b6102c65a03f11515610c3b57600080fd5b5050600a54600160a060020a0316905063b753a98c338560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610c9557600080fd5b6102c65a03f1151561092f57600080fd5b600435602435808233600160a060020a031660008035600160e060020a0319169034903660405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a4600a54600160a060020a031663f2d5d56b338560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610d5257600080fd5b6102c65a03f11515610d6357600080fd5b5050600b54600160a060020a031690506340c10f19338560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610dbd57600080fd5b6102c65a03f11515610dce57600080fd5b505050600160a060020a033316600090815260096020526040902054610df49084611135565b600160a060020a033316600090815260096020908152604080832093909355600790522054610e2490849061108d565b505050565b600080610e35836106a4565b90506105aa8161096a565b600c54600160a060020a0390811691161490565b60096020526000908152604090205481565b600c54600160a060020a031681565b600081511580610e86575081516001145b15610e9057610ef3565b5060005b6001825103811015610ef357818160010181518110610eaf57fe5b90602001906020020151600160a060020a0316828281518110610ece57fe5b90602001906020020151600160a060020a031610610eeb57600080fd5b600101610e94565b5050565b600030600160a060020a031683600160a060020a03161415610f1b575060016105aa565b600154600160a060020a0384811691161415610f39575060016105aa565b600054600160a060020a03161515610f53575060006105aa565b60008054600160a060020a03169063b7009613908590309086906040516020015260405160e060020a63ffffffff8616028152600160a060020a039384166004820152919092166024820152600160e060020a03199091166044820152606401602060405180830381600087803b1515610fcc57600080fd5b6102c65a03f11515610fdd57600080fd5b5050506040518051905090506105aa565b6000191890565b6000818152600660205260408120905b8154811015610a175761104e60086000848481548110151561102357fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205485611125565b60086000848481548110151561106057fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902055600101611005565b6000818152600660205260408120905b8154811015610a17576110e66008600084848154811015156110bb57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205485611135565b6008600084848154811015156110f857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205560010161109d565b808203828111156105aa57600080fd5b808201828110156105aa57600080fd5b8280548282559060005260206000209081019282156111a9579160200282015b828111156111a9578251825473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617825560209290920191600190910190611165565b506111b59291506111b9565b5090565b6111ea91905b808211156111b557805473ffffffffffffffffffffffffffffffffffffffff191681556001016111bf565b905600a165627a7a72305820c51e76da33edd9577fc684da56e5585a52c0b6edb0a0627885dd8fbeade927fa00290000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000009aed7a25f2d928225e6fb2388055c7363ad6727b0000000000000000000000000000000000000000000000000000000000000005

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

0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000009aed7a25f2d928225e6fb2388055c7363ad6727b0000000000000000000000000000000000000000000000000000000000000005

-----Decoded View---------------
Arg [0] : GOV (address): 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2
Arg [1] : IOU (address): 0x9AeD7A25F2d928225e6fb2388055c7363aD6727b
Arg [2] : MAX_YAYS (uint256): 5

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a2
Arg [1] : 0000000000000000000000009aed7a25f2d928225e6fb2388055c7363ad6727b
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000005


Swarm Source

bzzr://c51e76da33edd9577fc684da56e5585a52c0b6edb0a0627885dd8fbeade927fa
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.