ETH Price: $2,534.88 (+1.57%)

Transaction Decoder

Block:
9887635 at Apr-17-2020 03:47:18 AM +UTC
Transaction Fee:
0.00022162 ETH $0.56
Gas Used:
31,660 Gas / 7 Gwei

Emitted Events:

43 DSToken.Burn( guy=[Receiver] GemPit, wad=8338699344953438052 )

Account State Difference:

  Address   Before After State Difference Code
0x9f8F72aA...cC3A579A2
(Ethermine)
553.311879729160137608 Eth553.312101349160137608 Eth0.00022162
0xf75fcD98...150C9482A
0.219731187062970826 Eth
Nonce: 25524
0.219509567062970826 Eth
Nonce: 25525
0.00022162

Execution Trace

GemPit.burn( gem=0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2 )
  • DSToken.balanceOf( src=0x69076e44a9C70a67D5b79d95795Aba299083c275 ) => ( 8338699344953438052 )
  • DSToken.burn( wad=8338699344953438052 )
    • MkrAuthority.canCall( src=0x69076e44a9C70a67D5b79d95795Aba299083c275, 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2, sig=System.Byte[] ) => ( True )
      File 1 of 3: GemPit
      pragma solidity ^0.4.13;
      
      ////// 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-stop/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-stop/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-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/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);
      }
      
      ////// 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;
          }
      }
      
      ////// 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_;
          }
      }
      
      contract GemPit {
          function burn(DSToken gem) public {
              gem.burn(gem.balanceOf(this));
          }
      }

      File 2 of 3: DSToken
      // MKR Token
      
      // hevm: flattened sources of src/mkr-499.sol
      pragma solidity ^0.4.15;
      
      ////// 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-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 {
      }
      
      ////// 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
      // 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.8; */
      
      // Token standard API
      // https://github.com/ethereum/EIPs/issues/20
      
      contract ERC20 {
          function totalSupply() public view returns (uint supply);
          function balanceOf( address who ) public view returns (uint value);
          function allowance( address owner, address spender ) public view returns (uint _allowance);
      
          function transfer( address to, uint value) public returns (bool ok);
          function transferFrom( address from, address to, uint value) public returns (bool ok);
          function approve( address spender, uint value ) public returns (bool ok);
      
          event Transfer( address indexed from, address indexed to, uint value);
          event Approval( address indexed owner, address indexed spender, uint value);
      }
      
      ////// 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_;
          }
      }

      File 3 of 3: MkrAuthority
      /// MkrAuthority -- custom authority for MKR token access control
      
      // Copyright (C) 2019 Maker Ecosystem Growth Holdings, INC.
      //
      // This program is free software: you can redistribute it and/or modify
      // it under the terms of the GNU Affero 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 Affero General Public License for more details.
      //
      // You should have received a copy of the GNU Affero General Public License
      // along with this program.  If not, see <https://www.gnu.org/licenses/>.
      
      pragma solidity ^0.5.12;
      
      contract MkrAuthority {
        address public root;
        modifier sudo { require(msg.sender == root); _; }
        event LogSetRoot(address indexed newRoot);
        function setRoot(address usr) public sudo {
          root = usr;
          emit LogSetRoot(usr);
        }
      
        mapping (address => uint) public wards;
        event LogRely(address indexed usr);
        function rely(address usr) public sudo { wards[usr] = 1; emit LogRely(usr); }
        event LogDeny(address indexed usr);
        function deny(address usr) public sudo { wards[usr] = 0; emit LogDeny(usr); }
      
        constructor() public {
          root = msg.sender;
        }
      
        // bytes4(keccak256(abi.encodePacked('burn(uint256)')))
        bytes4 constant burn = bytes4(0x42966c68);
        // bytes4(keccak256(abi.encodePacked('burn(address,uint256)')))
        bytes4 constant burnFrom = bytes4(0x9dc29fac);
        // bytes4(keccak256(abi.encodePacked('mint(address,uint256)')))
        bytes4 constant mint = bytes4(0x40c10f19);
      
        function canCall(address src, address, bytes4 sig)
            public view returns (bool)
        {
          if (sig == burn || sig == burnFrom || src == root) {
            return true;
          } else if (sig == mint) {
            return (wards[src] == 1);
          } else {
            return false;
          }
        }
      }