ETH Price: $3,858.74 (+1.98%)

Transaction Decoder

Block:
23300789 at Sep-06-2025 01:29:35 AM +UTC
Transaction Fee:
0.00012390582738375 ETH $0.48
Gas Used:
573,942 Gas / 0.215885625 Gwei

Emitted Events:

1361 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0xa497E5E828F4b1DB181B756481B6Ff70546Cbc8c, value=10 )
1362 Dai.Transfer( src=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, dst=0xbBA5bf721d39F7427E09F6D74e6B9285f24Adef9, wad=10000000000000 )
1363 Dai.Transfer( src=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, dst=0x99Ff13Afe0E279D50547F22381b61FEFB731F509, wad=10000000000000 )
1364 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x3943bBd112a6C9eaAdF7626bB84beA26A5d7c9B1, value=10 )
1365 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0xE6B0F5Bd96b66c704C17A82D72045ba8CF89d1f6, value=10 )
1366 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0xad2Dc35C0f52d8902341DCA149823d9eC6Bd1577, value=10 )
1367 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0xf93862Ca8a8db6b68328C4F30150e9E46ce7033B, value=10 )
1368 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x2B15A784a7aB0E506979CBba7f2FbbbC591c9A27, value=10 )
1369 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x18dc56261803aAe6Be7D504e2bB523e4a54F9393, value=10 )
1370 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x36DA87BcE9CFB728D53404df4EC3276987106448, value=10 )
1371 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x209feA7d7F52df6E5f8e6b086229A23a2818dC67, value=10 )
1372 TetherToken.Transfer( from=[Receiver] 0x8ccaaf6233a788de6a0c17695c6f3e795c90f3be, to=0x61bF834C97E2f88ADF7C2c94A203dC82942B7B87, value=10 )

Account State Difference:

  Address   Before After State Difference Code
0x18dc5626...4a54F9393
0 Eth
Nonce: 0
0.000010073731975536 Eth
Nonce: 0
0.000010073731975536From: 0 To: 0
0x209feA7d...a2818dC67 0.000004831748533755 Eth0.000014905480509291 Eth0.000010073731975536
0x2B15A784...C591c9A27 0.00244867904387541 Eth0.002458752775850946 Eth0.000010073731975536
0x36DA87Bc...987106448 0.003243682220548531 Eth0.003253755952524067 Eth0.000010073731975536
0x3943bBd1...6A5d7c9B1
0 Eth
Nonce: 0
0.000013879869565398 Eth
Nonce: 0
0.000013879869565398From: 0 To: 0
(Titan Builder)
12.95563668389594628 Eth12.95563674129014628 Eth0.0000000573942
0x49127442...e5EE51936
(Fake_Phishing1322726)
0.20724920656017827 Eth
Nonce: 4249
0.20712530073279452 Eth
Nonce: 4250
0.00012390582738375
0x61bF834C...2942B7B87
0 Eth
Nonce: 0
0.000010073731975536 Eth
Nonce: 0
0.000010073731975536From: 0 To: 0
0x6B175474...495271d0F
0x8cCAAf62...95c90F3Be
(Fake_Phishing1322727)
0.313545988610415693 Eth0.313426242287681931 Eth0.000119746322733762
0x99Ff13Af...FB731F509 0.000038811072485445 Eth0.000046412505179715 Eth0.00000760143269427
0xa497E5E8...0546Cbc8c 0.000003742218885893 Eth0.000013815950861429 Eth0.000010073731975536
0xad2Dc35C...eC6Bd1577
0 Eth
Nonce: 0
0.000010073731975536 Eth
Nonce: 0
0.000010073731975536From: 0 To: 0
0xbBA5bf72...5f24Adef9 0.000023680831128284 Eth0.000031282263822554 Eth0.00000760143269427
0xdAC17F95...13D831ec7
0xE6B0F5Bd...8CF89d1f6
0 Eth
Nonce: 0
0.000010073731975536 Eth
Nonce: 0
0.000010073731975536From: 0 To: 0
0xf93862Ca...46ce7033B 0.001588040089129875 Eth0.001598113821105411 Eth0.000010073731975536

Execution Trace

Fake_Phishing1322727.2ae2e245( )
  • ETH 0.000010073731975536 0xa497e5e828f4b1db181b756481b6ff70546cbc8c.CALL( )
  • ETH 0.00000760143269427 0xbba5bf721d39f7427e09f6d74e6b9285f24adef9.CALL( )
  • ETH 0.00000760143269427 0x99ff13afe0e279d50547f22381b61fefb731f509.CALL( )
  • ETH 0.000013879869565398 0x3943bbd112a6c9eaadf7626bb84bea26a5d7c9b1.CALL( )
  • ETH 0.000010073731975536 0xe6b0f5bd96b66c704c17a82d72045ba8cf89d1f6.CALL( )
  • ETH 0.000010073731975536 0xad2dc35c0f52d8902341dca149823d9ec6bd1577.CALL( )
  • ETH 0.000010073731975536 0xf93862ca8a8db6b68328c4f30150e9e46ce7033b.CALL( )
  • ETH 0.000010073731975536 0x2b15a784a7ab0e506979cbba7f2fbbbc591c9a27.CALL( )
  • ETH 0.000010073731975536 0x18dc56261803aae6be7d504e2bb523e4a54f9393.CALL( )
  • ETH 0.000010073731975536 0x36da87bce9cfb728d53404df4ec3276987106448.CALL( )
  • ETH 0.000010073731975536 0x209fea7d7f52df6e5f8e6b086229a23a2818dc67.CALL( )
  • ETH 0.000010073731975536 0x61bf834c97e2f88adf7c2c94a203dc82942b7b87.CALL( )
  • TetherToken.transfer( _to=0xa497E5E828F4b1DB181B756481B6Ff70546Cbc8c, _value=10 )
  • Dai.transfer( dst=0xbBA5bf721d39F7427E09F6D74e6B9285f24Adef9, wad=10000000000000 ) => ( True )
  • Dai.transfer( dst=0x99Ff13Afe0E279D50547F22381b61FEFB731F509, wad=10000000000000 ) => ( True )
  • TetherToken.transfer( _to=0x3943bBd112a6C9eaAdF7626bB84beA26A5d7c9B1, _value=10 )
  • TetherToken.transfer( _to=0xE6B0F5Bd96b66c704C17A82D72045ba8CF89d1f6, _value=10 )
  • TetherToken.transfer( _to=0xad2Dc35C0f52d8902341DCA149823d9eC6Bd1577, _value=10 )
  • TetherToken.transfer( _to=0xf93862Ca8a8db6b68328C4F30150e9E46ce7033B, _value=10 )
  • TetherToken.transfer( _to=0x2B15A784a7aB0E506979CBba7f2FbbbC591c9A27, _value=10 )
  • TetherToken.transfer( _to=0x18dc56261803aAe6Be7D504e2bB523e4a54F9393, _value=10 )
  • TetherToken.transfer( _to=0x36DA87BcE9CFB728D53404df4EC3276987106448, _value=10 )
  • TetherToken.transfer( _to=0x209feA7d7F52df6E5f8e6b086229A23a2818dC67, _value=10 )
  • TetherToken.transfer( _to=0x61bF834C97E2f88ADF7C2c94A203dC82942B7B87, _value=10 )
    File 1 of 2: TetherToken
    pragma solidity ^0.4.17;
    
    /**
     * @title SafeMath
     * @dev Math operations with safety checks that throw on error
     */
    library SafeMath {
        function mul(uint256 a, uint256 b) internal pure returns (uint256) {
            if (a == 0) {
                return 0;
            }
            uint256 c = a * b;
            assert(c / a == b);
            return c;
        }
    
        function div(uint256 a, uint256 b) internal pure returns (uint256) {
            // assert(b > 0); // Solidity automatically throws when dividing by 0
            uint256 c = a / b;
            // assert(a == b * c + a % b); // There is no case in which this doesn't hold
            return c;
        }
    
        function sub(uint256 a, uint256 b) internal pure returns (uint256) {
            assert(b <= a);
            return a - b;
        }
    
        function add(uint256 a, uint256 b) internal pure returns (uint256) {
            uint256 c = a + b;
            assert(c >= a);
            return c;
        }
    }
    
    /**
     * @title Ownable
     * @dev The Ownable contract has an owner address, and provides basic authorization control
     * functions, this simplifies the implementation of "user permissions".
     */
    contract Ownable {
        address public owner;
    
        /**
          * @dev The Ownable constructor sets the original `owner` of the contract to the sender
          * account.
          */
        function Ownable() public {
            owner = msg.sender;
        }
    
        /**
          * @dev Throws if called by any account other than the owner.
          */
        modifier onlyOwner() {
            require(msg.sender == owner);
            _;
        }
    
        /**
        * @dev Allows the current owner to transfer control of the contract to a newOwner.
        * @param newOwner The address to transfer ownership to.
        */
        function transferOwnership(address newOwner) public onlyOwner {
            if (newOwner != address(0)) {
                owner = newOwner;
            }
        }
    
    }
    
    /**
     * @title ERC20Basic
     * @dev Simpler version of ERC20 interface
     * @dev see https://github.com/ethereum/EIPs/issues/20
     */
    contract ERC20Basic {
        uint public _totalSupply;
        function totalSupply() public constant returns (uint);
        function balanceOf(address who) public constant returns (uint);
        function transfer(address to, uint value) public;
        event Transfer(address indexed from, address indexed to, uint value);
    }
    
    /**
     * @title ERC20 interface
     * @dev see https://github.com/ethereum/EIPs/issues/20
     */
    contract ERC20 is ERC20Basic {
        function allowance(address owner, address spender) public constant returns (uint);
        function transferFrom(address from, address to, uint value) public;
        function approve(address spender, uint value) public;
        event Approval(address indexed owner, address indexed spender, uint value);
    }
    
    /**
     * @title Basic token
     * @dev Basic version of StandardToken, with no allowances.
     */
    contract BasicToken is Ownable, ERC20Basic {
        using SafeMath for uint;
    
        mapping(address => uint) public balances;
    
        // additional variables for use if transaction fees ever became necessary
        uint public basisPointsRate = 0;
        uint public maximumFee = 0;
    
        /**
        * @dev Fix for the ERC20 short address attack.
        */
        modifier onlyPayloadSize(uint size) {
            require(!(msg.data.length < size + 4));
            _;
        }
    
        /**
        * @dev transfer token for a specified address
        * @param _to The address to transfer to.
        * @param _value The amount to be transferred.
        */
        function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
            uint fee = (_value.mul(basisPointsRate)).div(10000);
            if (fee > maximumFee) {
                fee = maximumFee;
            }
            uint sendAmount = _value.sub(fee);
            balances[msg.sender] = balances[msg.sender].sub(_value);
            balances[_to] = balances[_to].add(sendAmount);
            if (fee > 0) {
                balances[owner] = balances[owner].add(fee);
                Transfer(msg.sender, owner, fee);
            }
            Transfer(msg.sender, _to, sendAmount);
        }
    
        /**
        * @dev Gets the balance of the specified address.
        * @param _owner The address to query the the balance of.
        * @return An uint representing the amount owned by the passed address.
        */
        function balanceOf(address _owner) public constant returns (uint balance) {
            return balances[_owner];
        }
    
    }
    
    /**
     * @title Standard ERC20 token
     *
     * @dev Implementation of the basic standard token.
     * @dev https://github.com/ethereum/EIPs/issues/20
     * @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
     */
    contract StandardToken is BasicToken, ERC20 {
    
        mapping (address => mapping (address => uint)) public allowed;
    
        uint public constant MAX_UINT = 2**256 - 1;
    
        /**
        * @dev Transfer tokens from one address to another
        * @param _from address The address which you want to send tokens from
        * @param _to address The address which you want to transfer to
        * @param _value uint the amount of tokens to be transferred
        */
        function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
            var _allowance = allowed[_from][msg.sender];
    
            // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
            // if (_value > _allowance) throw;
    
            uint fee = (_value.mul(basisPointsRate)).div(10000);
            if (fee > maximumFee) {
                fee = maximumFee;
            }
            if (_allowance < MAX_UINT) {
                allowed[_from][msg.sender] = _allowance.sub(_value);
            }
            uint sendAmount = _value.sub(fee);
            balances[_from] = balances[_from].sub(_value);
            balances[_to] = balances[_to].add(sendAmount);
            if (fee > 0) {
                balances[owner] = balances[owner].add(fee);
                Transfer(_from, owner, fee);
            }
            Transfer(_from, _to, sendAmount);
        }
    
        /**
        * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
        * @param _spender The address which will spend the funds.
        * @param _value The amount of tokens to be spent.
        */
        function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
    
            // To change the approve amount you first have to reduce the addresses`
            //  allowance to zero by calling `approve(_spender, 0)` if it is not
            //  already 0 to mitigate the race condition described here:
            //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
            require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
    
            allowed[msg.sender][_spender] = _value;
            Approval(msg.sender, _spender, _value);
        }
    
        /**
        * @dev Function to check the amount of tokens than an owner allowed to a spender.
        * @param _owner address The address which owns the funds.
        * @param _spender address The address which will spend the funds.
        * @return A uint specifying the amount of tokens still available for the spender.
        */
        function allowance(address _owner, address _spender) public constant returns (uint remaining) {
            return allowed[_owner][_spender];
        }
    
    }
    
    
    /**
     * @title Pausable
     * @dev Base contract which allows children to implement an emergency stop mechanism.
     */
    contract Pausable is Ownable {
      event Pause();
      event Unpause();
    
      bool public paused = false;
    
    
      /**
       * @dev Modifier to make a function callable only when the contract is not paused.
       */
      modifier whenNotPaused() {
        require(!paused);
        _;
      }
    
      /**
       * @dev Modifier to make a function callable only when the contract is paused.
       */
      modifier whenPaused() {
        require(paused);
        _;
      }
    
      /**
       * @dev called by the owner to pause, triggers stopped state
       */
      function pause() onlyOwner whenNotPaused public {
        paused = true;
        Pause();
      }
    
      /**
       * @dev called by the owner to unpause, returns to normal state
       */
      function unpause() onlyOwner whenPaused public {
        paused = false;
        Unpause();
      }
    }
    
    contract BlackList is Ownable, BasicToken {
    
        /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
        function getBlackListStatus(address _maker) external constant returns (bool) {
            return isBlackListed[_maker];
        }
    
        function getOwner() external constant returns (address) {
            return owner;
        }
    
        mapping (address => bool) public isBlackListed;
        
        function addBlackList (address _evilUser) public onlyOwner {
            isBlackListed[_evilUser] = true;
            AddedBlackList(_evilUser);
        }
    
        function removeBlackList (address _clearedUser) public onlyOwner {
            isBlackListed[_clearedUser] = false;
            RemovedBlackList(_clearedUser);
        }
    
        function destroyBlackFunds (address _blackListedUser) public onlyOwner {
            require(isBlackListed[_blackListedUser]);
            uint dirtyFunds = balanceOf(_blackListedUser);
            balances[_blackListedUser] = 0;
            _totalSupply -= dirtyFunds;
            DestroyedBlackFunds(_blackListedUser, dirtyFunds);
        }
    
        event DestroyedBlackFunds(address _blackListedUser, uint _balance);
    
        event AddedBlackList(address _user);
    
        event RemovedBlackList(address _user);
    
    }
    
    contract UpgradedStandardToken is StandardToken{
        // those methods are called by the legacy contract
        // and they must ensure msg.sender to be the contract address
        function transferByLegacy(address from, address to, uint value) public;
        function transferFromByLegacy(address sender, address from, address spender, uint value) public;
        function approveByLegacy(address from, address spender, uint value) public;
    }
    
    contract TetherToken is Pausable, StandardToken, BlackList {
    
        string public name;
        string public symbol;
        uint public decimals;
        address public upgradedAddress;
        bool public deprecated;
    
        //  The contract can be initialized with a number of tokens
        //  All the tokens are deposited to the owner address
        //
        // @param _balance Initial supply of the contract
        // @param _name Token Name
        // @param _symbol Token symbol
        // @param _decimals Token decimals
        function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
            _totalSupply = _initialSupply;
            name = _name;
            symbol = _symbol;
            decimals = _decimals;
            balances[owner] = _initialSupply;
            deprecated = false;
        }
    
        // Forward ERC20 methods to upgraded contract if this one is deprecated
        function transfer(address _to, uint _value) public whenNotPaused {
            require(!isBlackListed[msg.sender]);
            if (deprecated) {
                return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
            } else {
                return super.transfer(_to, _value);
            }
        }
    
        // Forward ERC20 methods to upgraded contract if this one is deprecated
        function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
            require(!isBlackListed[_from]);
            if (deprecated) {
                return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
            } else {
                return super.transferFrom(_from, _to, _value);
            }
        }
    
        // Forward ERC20 methods to upgraded contract if this one is deprecated
        function balanceOf(address who) public constant returns (uint) {
            if (deprecated) {
                return UpgradedStandardToken(upgradedAddress).balanceOf(who);
            } else {
                return super.balanceOf(who);
            }
        }
    
        // Forward ERC20 methods to upgraded contract if this one is deprecated
        function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
            if (deprecated) {
                return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
            } else {
                return super.approve(_spender, _value);
            }
        }
    
        // Forward ERC20 methods to upgraded contract if this one is deprecated
        function allowance(address _owner, address _spender) public constant returns (uint remaining) {
            if (deprecated) {
                return StandardToken(upgradedAddress).allowance(_owner, _spender);
            } else {
                return super.allowance(_owner, _spender);
            }
        }
    
        // deprecate current contract in favour of a new one
        function deprecate(address _upgradedAddress) public onlyOwner {
            deprecated = true;
            upgradedAddress = _upgradedAddress;
            Deprecate(_upgradedAddress);
        }
    
        // deprecate current contract if favour of a new one
        function totalSupply() public constant returns (uint) {
            if (deprecated) {
                return StandardToken(upgradedAddress).totalSupply();
            } else {
                return _totalSupply;
            }
        }
    
        // Issue a new amount of tokens
        // these tokens are deposited into the owner address
        //
        // @param _amount Number of tokens to be issued
        function issue(uint amount) public onlyOwner {
            require(_totalSupply + amount > _totalSupply);
            require(balances[owner] + amount > balances[owner]);
    
            balances[owner] += amount;
            _totalSupply += amount;
            Issue(amount);
        }
    
        // Redeem tokens.
        // These tokens are withdrawn from the owner address
        // if the balance must be enough to cover the redeem
        // or the call will fail.
        // @param _amount Number of tokens to be issued
        function redeem(uint amount) public onlyOwner {
            require(_totalSupply >= amount);
            require(balances[owner] >= amount);
    
            _totalSupply -= amount;
            balances[owner] -= amount;
            Redeem(amount);
        }
    
        function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
            // Ensure transparency by hardcoding limit beyond which fees can never be added
            require(newBasisPoints < 20);
            require(newMaxFee < 50);
    
            basisPointsRate = newBasisPoints;
            maximumFee = newMaxFee.mul(10**decimals);
    
            Params(basisPointsRate, maximumFee);
        }
    
        // Called when new token are issued
        event Issue(uint amount);
    
        // Called when tokens are redeemed
        event Redeem(uint amount);
    
        // Called when contract is deprecated
        event Deprecate(address newAddress);
    
        // Called if contract ever adds fees
        event Params(uint feeBasisPoints, uint maxFee);
    }

    File 2 of 2: Dai
    // hevm: flattened sources of /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/dai.sol
    pragma solidity =0.5.12;
    
    ////// /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/lib.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.5.12; */
    
    contract LibNote {
        event LogNote(
            bytes4   indexed  sig,
            address  indexed  usr,
            bytes32  indexed  arg1,
            bytes32  indexed  arg2,
            bytes             data
        ) anonymous;
    
        modifier note {
            _;
            assembly {
                // log an 'anonymous' event with a constant 6 words of calldata
                // and four indexed topics: selector, caller, arg1 and arg2
                let mark := msize                         // end of memory ensures zero
                mstore(0x40, add(mark, 288))              // update free memory pointer
                mstore(mark, 0x20)                        // bytes type data offset
                mstore(add(mark, 0x20), 224)              // bytes size (padded)
                calldatacopy(add(mark, 0x40), 0, 224)     // bytes payload
                log4(mark, 288,                           // calldata
                     shl(224, shr(224, calldataload(0))), // msg.sig
                     caller,                              // msg.sender
                     calldataload(4),                     // arg1
                     calldataload(36)                     // arg2
                    )
            }
        }
    }
    
    ////// /nix/store/8xb41r4qd0cjb63wcrxf1qmfg88p0961-dss-6fd7de0/src/dai.sol
    // Copyright (C) 2017, 2018, 2019 dbrock, rain, mrchico
    
    // 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; */
    
    /* import "./lib.sol"; */
    
    contract Dai is LibNote {
        // --- Auth ---
        mapping (address => uint) public wards;
        function rely(address guy) external note auth { wards[guy] = 1; }
        function deny(address guy) external note auth { wards[guy] = 0; }
        modifier auth {
            require(wards[msg.sender] == 1, "Dai/not-authorized");
            _;
        }
    
        // --- ERC20 Data ---
        string  public constant name     = "Dai Stablecoin";
        string  public constant symbol   = "DAI";
        string  public constant version  = "1";
        uint8   public constant decimals = 18;
        uint256 public totalSupply;
    
        mapping (address => uint)                      public balanceOf;
        mapping (address => mapping (address => uint)) public allowance;
        mapping (address => uint)                      public nonces;
    
        event Approval(address indexed src, address indexed guy, uint wad);
        event Transfer(address indexed src, address indexed dst, uint wad);
    
        // --- Math ---
        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);
        }
    
        // --- EIP712 niceties ---
        bytes32 public DOMAIN_SEPARATOR;
        // bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address holder,address spender,uint256 nonce,uint256 expiry,bool allowed)");
        bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb;
    
        constructor(uint256 chainId_) public {
            wards[msg.sender] = 1;
            DOMAIN_SEPARATOR = keccak256(abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                keccak256(bytes(name)),
                keccak256(bytes(version)),
                chainId_,
                address(this)
            ));
        }
    
        // --- Token ---
        function transfer(address dst, uint wad) external returns (bool) {
            return transferFrom(msg.sender, dst, wad);
        }
        function transferFrom(address src, address dst, uint wad)
            public returns (bool)
        {
            require(balanceOf[src] >= wad, "Dai/insufficient-balance");
            if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
                require(allowance[src][msg.sender] >= wad, "Dai/insufficient-allowance");
                allowance[src][msg.sender] = sub(allowance[src][msg.sender], wad);
            }
            balanceOf[src] = sub(balanceOf[src], wad);
            balanceOf[dst] = add(balanceOf[dst], wad);
            emit Transfer(src, dst, wad);
            return true;
        }
        function mint(address usr, uint wad) external auth {
            balanceOf[usr] = add(balanceOf[usr], wad);
            totalSupply    = add(totalSupply, wad);
            emit Transfer(address(0), usr, wad);
        }
        function burn(address usr, uint wad) external {
            require(balanceOf[usr] >= wad, "Dai/insufficient-balance");
            if (usr != msg.sender && allowance[usr][msg.sender] != uint(-1)) {
                require(allowance[usr][msg.sender] >= wad, "Dai/insufficient-allowance");
                allowance[usr][msg.sender] = sub(allowance[usr][msg.sender], wad);
            }
            balanceOf[usr] = sub(balanceOf[usr], wad);
            totalSupply    = sub(totalSupply, wad);
            emit Transfer(usr, address(0), wad);
        }
        function approve(address usr, uint wad) external returns (bool) {
            allowance[msg.sender][usr] = wad;
            emit Approval(msg.sender, usr, wad);
            return true;
        }
    
        // --- Alias ---
        function push(address usr, uint wad) external {
            transferFrom(msg.sender, usr, wad);
        }
        function pull(address usr, uint wad) external {
            transferFrom(usr, msg.sender, wad);
        }
        function move(address src, address dst, uint wad) external {
            transferFrom(src, dst, wad);
        }
    
        // --- Approve by signature ---
        function permit(address holder, address spender, uint256 nonce, uint256 expiry,
                        bool allowed, uint8 v, bytes32 r, bytes32 s) external
        {
            bytes32 digest =
                keccak256(abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR,
                    keccak256(abi.encode(PERMIT_TYPEHASH,
                                         holder,
                                         spender,
                                         nonce,
                                         expiry,
                                         allowed))
            ));
    
            require(holder != address(0), "Dai/invalid-address-0");
            require(holder == ecrecover(digest, v, r, s), "Dai/invalid-permit");
            require(expiry == 0 || now <= expiry, "Dai/permit-expired");
            require(nonce == nonces[holder]++, "Dai/invalid-nonce");
            uint wad = allowed ? uint(-1) : 0;
            allowance[holder][spender] = wad;
            emit Approval(holder, spender, wad);
        }
    }