Contract Address Details
contract

0xbA13a6414C677d9e7BD3c0BDE5BA4055BF2e72f7

Contract Name
DXswapFeeReceiver
Creator
0xdf456b–40fb02 at 0x135d54–8a9643
Balance
0 xDai ( )
Tokens
Fetching tokens...
Transactions
2,438 Transactions
Transfers
50,447 Transfers
Gas Used
1,683,426,678
Last Balance Update
25341181
Contract name:
DXswapFeeReceiver




Optimization enabled
true
Compiler version
v0.5.16+commit.9c3226ce




Optimization runs
10000
EVM Version
default




Verified at
2021-06-03T17:31:44.146479Z

Constructor Arguments

000000000000000000000000fbd0b2726070a9d6aff6d7216c9e9340eae68b2a000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d700000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef900000000000000000000000038fb649ad3d6ba1113be5f57b927053e97fc5bf70000000000000000000000004ba7362f9189572cbb1216819a45aba0d0b2d1cb00000000000000000000000082374c59709aac2f7864191a3c492932379536f4000000000000000000000000000000000000000000000000000000012a05f200

Arg [0] (address) : 0xfbd0b2726070a9d6aff6d7216c9e9340eae68b2a
Arg [1] (address) : 0xa818b4f111ccac7aa31d0bcc0806d64f2e0737d7
Arg [2] (address) : 0x71850b7e9ee3f13ab46d67167341e4bdc905eef9
Arg [3] (address) : 0x38fb649ad3d6ba1113be5f57b927053e97fc5bf7
Arg [4] (address) : 0x4ba7362f9189572cbb1216819a45aba0d0b2d1cb
Arg [5] (address) : 0x82374c59709aac2f7864191a3c492932379536f4
Arg [6] (uint256) : 5000000000

              

Contract source code

// File: contracts/interfaces/IDXswapFactory.sol

pragma solidity >=0.5.0;

interface IDXswapFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function INIT_CODE_PAIR_HASH() external pure returns (bytes32);
    function feeTo() external view returns (address);
    function protocolFeeDenominator() external view returns (uint8);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
    function setProtocolFee(uint8 _protocolFee) external;
    function setSwapFee(address pair, uint32 swapFee) external;
}

// File: contracts/interfaces/IDXswapPair.sol

pragma solidity >=0.5.0;

interface IDXswapPair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);
    function swapFee() external view returns (uint32);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
    function setSwapFee(uint32) external;
}

// File: contracts/interfaces/IERC20.sol

pragma solidity >=0.5.0;

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
}

// File: contracts/interfaces/IRewardManager.sol

pragma solidity >=0.5.0;

contract IRewardManager {
    function rebalance() external;
}

// File: contracts/libraries/TransferHelper.sol

pragma solidity =0.5.16;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    function safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }

    function safeTransfer(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function safeTransferETH(address to, uint value) internal {
        (bool success,) = to.call.value(value)(new bytes(0));
        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
    }
}

// File: contracts/libraries/SafeMath.sol

pragma solidity =0.5.16;

// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)

library SafeMath {
    function add(uint x, uint y) internal pure returns (uint z) {
        require((z = x + y) >= x, 'ds-math-add-overflow');
    }

    function sub(uint x, uint y) internal pure returns (uint z) {
        require((z = x - y) <= x, 'ds-math-sub-underflow');
    }

    function mul(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
    }
}

// File: contracts/DXswapFeeReceiver.sol

pragma solidity =0.5.16;


contract DXswapFeeReceiver {
    using SafeMath for uint;

    uint256 public constant ONE_HUNDRED_PERCENT = 10**10;
    address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;

    address public owner;
    IDXswapFactory public factory;
    IERC20 public honeyToken;
    IERC20 public hsfToken;
    address public honeyReceiver;
    IRewardManager public hsfReceiver;
    uint256 public splitHoneyProportion;

    constructor(
        address _owner, address _factory, IERC20 _honeyToken, IERC20 _hsfToken, address _honeyReceiver,
        IRewardManager _hsfReceiver, uint256 _splitHoneyProportion
    ) public {
        require(_splitHoneyProportion <= ONE_HUNDRED_PERCENT / 2, 'DXswapFeeReceiver: HONEY_PROPORTION_TOO_HIGH');
        owner = _owner;
        factory = IDXswapFactory(_factory);
        honeyToken = _honeyToken;
        hsfToken = _hsfToken;
        honeyReceiver = _honeyReceiver;
        hsfReceiver = _hsfReceiver;
        splitHoneyProportion = _splitHoneyProportion;
    }

    function() external payable {}

    function transferOwnership(address newOwner) external {
        require(msg.sender == owner, 'DXswapFeeReceiver: FORBIDDEN');
        owner = newOwner;
    }

    function changeReceivers(address _honeyReceiver, IRewardManager _hsfReceiver) external {
        require(msg.sender == owner, 'DXswapFeeReceiver: FORBIDDEN');
        honeyReceiver = _honeyReceiver;
        hsfReceiver = _hsfReceiver;
    }

    function changeSplitHoneyProportion(uint256 _splitHoneyProportion) external {
        require(msg.sender == owner, 'DXswapFeeReceiver: FORBIDDEN');
        require(_splitHoneyProportion <= ONE_HUNDRED_PERCENT / 2, 'DXswapFeeReceiver: HONEY_PROPORTION_TOO_HIGH');
        splitHoneyProportion = _splitHoneyProportion;
    }

    // Returns sorted token addresses, used to handle return values from pairs sorted in this order
    function _sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'DXswapFeeReceiver: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'DXswapFeeReceiver: ZERO_ADDRESS');
    }

    // Helper function to know if an address is a contract, extcodesize returns the size of the code of a smart
    //  contract in a specific address
    function _isContract(address addr) internal returns (bool) {
        uint size;
        assembly { size := extcodesize(addr) }
        return size > 0;
    }

    // Calculates the CREATE2 address for a pair without making any external calls
    // Taken from DXswapLibrary, removed the factory parameter
    function _pairFor(address tokenA, address tokenB) internal view returns (address pair) {
        (address token0, address token1) = _sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'3f88503e8580ab941773b59034fb4b2a63e86dbc031b3633a925533ad3ed2b93' // xdai init code hash
//                hex'd306a548755b9295ee49cc729e13ca4a45e00199bbd890fa146da43a50571776' // init code hash original
            ))));
    }

    // Done with code from DXswapRouter and DXswapLibrary, removed the deadline argument
    function _swapTokens(uint amountIn, address fromToken, address toToken)
        internal returns (uint256 amountOut)
    {
        IDXswapPair pairToUse = IDXswapPair(_pairFor(fromToken, toToken));

        (uint reserve0, uint reserve1,) = pairToUse.getReserves();
        (uint reserveIn, uint reserveOut) = fromToken < toToken ? (reserve0, reserve1) : (reserve1, reserve0);

        require(reserveIn > 0 && reserveOut > 0, 'DXswapFeeReceiver: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(uint(10000).sub(30));
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(10000).add(amountInWithFee);
        amountOut = numerator / denominator;

        TransferHelper.safeTransfer(
            fromToken, address(pairToUse), amountIn
        );

        (uint amount0Out, uint amount1Out) = fromToken < toToken ? (uint(0), amountOut) : (amountOut, uint(0));

        pairToUse.swap(
            amount0Out, amount1Out, address(this), new bytes(0)
        );
    }

    function _swapForHoney(address token, uint amount) internal {
        require(_isContract(_pairFor(token, address(honeyToken))), 'DXswapFeeReceiver: NO_HONEY_PAIR');
        _swapTokens(amount, token, address(honeyToken));
    }

    // Take what was charged as protocol fee from the DXswap pair liquidity
    function takeProtocolFee(IDXswapPair[] calldata pairs) external {
        for (uint i = 0; i < pairs.length; i++) {
            address token0 = pairs[i].token0();
            address token1 = pairs[i].token1();
            pairs[i].transfer(address(pairs[i]), pairs[i].balanceOf(address(this)));
            (uint amount0, uint amount1) = pairs[i].burn(address(this));

            if (amount0 > 0 && token0 != address(honeyToken))
                _swapForHoney(token0, amount0);
            if (amount1 > 0 && token1 != address(honeyToken))
                _swapForHoney(token1, amount1);

            uint256 honeyBalance = honeyToken.balanceOf(address(this));
            uint256 honeyEarned = (honeyBalance.mul(splitHoneyProportion)) / ONE_HUNDRED_PERCENT;
            TransferHelper.safeTransfer(address(honeyToken), honeyReceiver, honeyEarned);

            uint256 honeyToConvertToHsf = honeyBalance.sub(honeyEarned);
            uint256 hsfEarned = _swapTokens(honeyToConvertToHsf, address(honeyToken), address(hsfToken));
            uint256 halfHsfEarned = hsfEarned / 2;
            TransferHelper.safeTransfer(address(hsfToken), BURN_ADDRESS, halfHsfEarned);
            TransferHelper.safeTransfer(address(hsfToken), address(hsfReceiver), halfHsfEarned);
            hsfReceiver.rebalance();
        }
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[{"type":"address","name":"_owner","internalType":"address"},{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_honeyToken","internalType":"contract IERC20"},{"type":"address","name":"_hsfToken","internalType":"contract IERC20"},{"type":"address","name":"_honeyReceiver","internalType":"address"},{"type":"address","name":"_hsfReceiver","internalType":"contract IRewardManager"},{"type":"uint256","name":"_splitHoneyProportion","internalType":"uint256"}]},{"type":"fallback","stateMutability":"payable","payable":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"address"}],"name":"BURN_ADDRESS","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ONE_HUNDRED_PERCENT","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"changeReceivers","inputs":[{"type":"address","name":"_honeyReceiver","internalType":"address"},{"type":"address","name":"_hsfReceiver","internalType":"contract IRewardManager"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"changeSplitHoneyProportion","inputs":[{"type":"uint256","name":"_splitHoneyProportion","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"contract IDXswapFactory"}],"name":"factory","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"address"}],"name":"honeyReceiver","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"honeyToken","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"contract IRewardManager"}],"name":"hsfReceiver","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"hsfToken","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"splitHoneyProportion","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"takeProtocolFee","inputs":[{"type":"address[]","name":"pairs","internalType":"contract IDXswapPair[]"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}],"constant":false}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b50604051611490380380611490833981810160405260e081101561003357600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151949593949293919290919064012a05f2008111156100a45760405162461bcd60e51b815260040180806020018281038252602c815260200180611464602c913960400191505060405180910390fd5b600080546001600160a01b039889166001600160a01b03199182161790915560018054978916978216979097179096556002805495881695871695909517909455600380549387169386169390931790925560048054918616918516919091179055600580549190941692169190911790915560065561133b806101296000396000f3fe6080604052600436106100d25760003560e01c8063afb38b981161007f578063dd0081c711610059578063dd0081c714610262578063f1ce62b714610277578063f2fde38b1461028c578063fccc2813146102bf576100d2565b8063afb38b98146101fd578063c1f4381d14610212578063c45a01551461024d576100d2565b80638da5cb5b116100b05780638da5cb5b146101a957806391566a2b146101be578063ace494aa146101d3576100d2565b8063210a258c146100d457806329831f5d146100fb5780635cb9c4ec1461012c575b005b3480156100e057600080fd5b506100e96102d4565b60408051918252519081900360200190f35b34801561010757600080fd5b506101106102da565b604080516001600160a01b039092168252519081900360200190f35b34801561013857600080fd5b506100d26004803603602081101561014f57600080fd5b81019060208101813564010000000081111561016a57600080fd5b82018360208201111561017c57600080fd5b8035906020019184602083028401116401000000008311171561019e57600080fd5b5090925090506102e9565b3480156101b557600080fd5b5061011061084c565b3480156101ca57600080fd5b5061011061085b565b3480156101df57600080fd5b506100d2600480360360208110156101f657600080fd5b503561086a565b34801561020957600080fd5b50610110610912565b34801561021e57600080fd5b506100d26004803603604081101561023557600080fd5b506001600160a01b0381358116916020013516610921565b34801561025957600080fd5b506101106109c6565b34801561026e57600080fd5b506100e96109d5565b34801561028357600080fd5b506101106109de565b34801561029857600080fd5b506100d2600480360360208110156102af57600080fd5b50356001600160a01b03166109ed565b3480156102cb57600080fd5b50610110610a86565b60065481565b6002546001600160a01b031681565b60005b8181101561084757600083838381811061030257fe5b905060200201356001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561034a57600080fd5b505afa15801561035e573d6000803e3d6000fd5b505050506040513d602081101561037457600080fd5b50519050600084848481811061038657fe5b905060200201356001600160a01b03166001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ce57600080fd5b505afa1580156103e2573d6000803e3d6000fd5b505050506040513d60208110156103f857600080fd5b5051905084848481811061040857fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb86868681811061043257fe5b905060200201356001600160a01b031687878781811061044e57fe5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051602092830294909401356001600160a01b0316936370a08231935060248083019392829003018186803b1580156104b357600080fd5b505afa1580156104c7573d6000803e3d6000fd5b505050506040513d60208110156104dd57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561054657600080fd5b505af115801561055a573d6000803e3d6000fd5b505050506040513d602081101561057057600080fd5b50600090508086868681811061058257fe5b604080517f89afcb44000000000000000000000000000000000000000000000000000000008152306004820152815160209390930294909401356001600160a01b0316936389afcb449350602480820193918290030181600087803b1580156105ea57600080fd5b505af11580156105fe573d6000803e3d6000fd5b505050506040513d604081101561061457600080fd5b5080516020909101519092509050811580159061063f57506002546001600160a01b03858116911614155b1561064e5761064e8483610a8c565b60008111801561066c57506002546001600160a01b03848116911614155b1561067b5761067b8382610a8c565b600254604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156106df57600080fd5b505afa1580156106f3573d6000803e3d6000fd5b505050506040513d602081101561070957600080fd5b50516006549091506000906402540be4009061072c90849063ffffffff610b1616565b8161073357fe5b600254600454929091049250610756916001600160a01b03918216911683610b88565b6000610768838363ffffffff610d3e16565b60025460035491925060009161078c9184916001600160a01b039182169116610d96565b60035490915060028204906107ad906001600160a01b031661dead83610b88565b6003546005546107ca916001600160a01b03908116911683610b88565b600560009054906101000a90046001600160a01b03166001600160a01b0316637d7c2a1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561081a57600080fd5b505af115801561082e573d6000803e3d6000fd5b50506001909b019a506102ec9950505050505050505050565b505050565b6000546001600160a01b031681565b6005546001600160a01b031681565b6000546001600160a01b031633146108c9576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b64012a05f20081111561090d5760405162461bcd60e51b815260040180806020018281038252602c8152602001806112b5602c913960400191505060405180910390fd5b600655565b6004546001600160a01b031681565b6000546001600160a01b03163314610980576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b600480546001600160a01b039384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560058054929093169116179055565b6001546001600160a01b031681565b6402540be40081565b6003546001600160a01b031681565b6000546001600160a01b03163314610a4c576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61dead81565b600254610aac90610aa79084906001600160a01b0316611065565b61114f565b610afd576040805162461bcd60e51b815260206004820181905260248201527f44587377617046656552656365697665723a204e4f5f484f4e45595f50414952604482015290519081900360640190fd5b60025461084790829084906001600160a01b0316610d96565b6000811580610b3157505080820282828281610b2e57fe5b04145b610b82576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b92915050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310610c5157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c14565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610cb3576040519150601f19603f3d011682016040523d82523d6000602084013e610cb8565b606091505b5091509150818015610ce6575080511580610ce65750808060200190516020811015610ce357600080fd5b50515b610d37576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b80820382811115610b82576040805162461bcd60e51b815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b600080610da38484611065565b9050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610de157600080fd5b505afa158015610df5573d6000803e3d6000fd5b505050506040513d6060811015610e0b57600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506000806001600160a01b0380881690891610610e48578284610e4b565b83835b91509150600082118015610e5f5750600081115b610e9a5760405162461bcd60e51b815260040180806020018281038252602981526020018061128c6029913960400191505060405180910390fd5b6000610ebf610eb2612710601e63ffffffff610d3e16565b8b9063ffffffff610b1616565b90506000610ed3828463ffffffff610b1616565b90506000610ef983610eed8761271063ffffffff610b1616565b9063ffffffff61115516565b9050808281610f0457fe5b049850610f128b898e610b88565b6000808b6001600160a01b03168d6001600160a01b031610610f36578a6000610f3a565b60008b5b91509150896001600160a01b031663022c0d9f83833060006040519080825280601f01601f191660200182016040528015610f7c576020820181803883390190505b506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fed578181015183820152602001610fd5565b50505050905090810190601f16801561101a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561103c57600080fd5b505af1158015611050573d6000803e3d6000fd5b50505050505050505050505050509392505050565b600080600061107485856111ad565b600154604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606095861b811660208084019190915294861b81166034830152825160288184030181526048830184528051908601207fff0000000000000000000000000000000000000000000000000000000000000060688401529390951b9094166069850152607d8401919091527f3f88503e8580ab941773b59034fb4b2a63e86dbc031b3633a925533ad3ed2b93609d808501919091528151808503909101815260bd9093019052815191012095945050505050565b3b151590565b80820182811015610b82576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b600080826001600160a01b0316846001600160a01b031614156112015760405162461bcd60e51b81526004018080602001828103825260268152602001806112e16026913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610611221578284611224565b83835b90925090506001600160a01b038216611284576040805162461bcd60e51b815260206004820152601f60248201527f44587377617046656552656365697665723a205a45524f5f4144445245535300604482015290519081900360640190fd5b925092905056fe44587377617046656552656365697665723a20494e53554646494349454e545f4c495155494449545944587377617046656552656365697665723a20484f4e45595f50524f504f5254494f4e5f544f4f5f4849474844587377617046656552656365697665723a204944454e544943414c5f414444524553534553a265627a7a72315820598ce1a58ff8283d0fe8c146bb6789ae15fc1cd0aa4867c82b668a372671567464736f6c6343000510003244587377617046656552656365697665723a20484f4e45595f50524f504f5254494f4e5f544f4f5f48494748000000000000000000000000fbd0b2726070a9d6aff6d7216c9e9340eae68b2a000000000000000000000000a818b4f111ccac7aa31d0bcc0806d64f2e0737d700000000000000000000000071850b7e9ee3f13ab46d67167341e4bdc905eef900000000000000000000000038fb649ad3d6ba1113be5f57b927053e97fc5bf70000000000000000000000004ba7362f9189572cbb1216819a45aba0d0b2d1cb00000000000000000000000082374c59709aac2f7864191a3c492932379536f4000000000000000000000000000000000000000000000000000000012a05f200

Deployed ByteCode

0x6080604052600436106100d25760003560e01c8063afb38b981161007f578063dd0081c711610059578063dd0081c714610262578063f1ce62b714610277578063f2fde38b1461028c578063fccc2813146102bf576100d2565b8063afb38b98146101fd578063c1f4381d14610212578063c45a01551461024d576100d2565b80638da5cb5b116100b05780638da5cb5b146101a957806391566a2b146101be578063ace494aa146101d3576100d2565b8063210a258c146100d457806329831f5d146100fb5780635cb9c4ec1461012c575b005b3480156100e057600080fd5b506100e96102d4565b60408051918252519081900360200190f35b34801561010757600080fd5b506101106102da565b604080516001600160a01b039092168252519081900360200190f35b34801561013857600080fd5b506100d26004803603602081101561014f57600080fd5b81019060208101813564010000000081111561016a57600080fd5b82018360208201111561017c57600080fd5b8035906020019184602083028401116401000000008311171561019e57600080fd5b5090925090506102e9565b3480156101b557600080fd5b5061011061084c565b3480156101ca57600080fd5b5061011061085b565b3480156101df57600080fd5b506100d2600480360360208110156101f657600080fd5b503561086a565b34801561020957600080fd5b50610110610912565b34801561021e57600080fd5b506100d26004803603604081101561023557600080fd5b506001600160a01b0381358116916020013516610921565b34801561025957600080fd5b506101106109c6565b34801561026e57600080fd5b506100e96109d5565b34801561028357600080fd5b506101106109de565b34801561029857600080fd5b506100d2600480360360208110156102af57600080fd5b50356001600160a01b03166109ed565b3480156102cb57600080fd5b50610110610a86565b60065481565b6002546001600160a01b031681565b60005b8181101561084757600083838381811061030257fe5b905060200201356001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561034a57600080fd5b505afa15801561035e573d6000803e3d6000fd5b505050506040513d602081101561037457600080fd5b50519050600084848481811061038657fe5b905060200201356001600160a01b03166001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ce57600080fd5b505afa1580156103e2573d6000803e3d6000fd5b505050506040513d60208110156103f857600080fd5b5051905084848481811061040857fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb86868681811061043257fe5b905060200201356001600160a01b031687878781811061044e57fe5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051602092830294909401356001600160a01b0316936370a08231935060248083019392829003018186803b1580156104b357600080fd5b505afa1580156104c7573d6000803e3d6000fd5b505050506040513d60208110156104dd57600080fd5b5051604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561054657600080fd5b505af115801561055a573d6000803e3d6000fd5b505050506040513d602081101561057057600080fd5b50600090508086868681811061058257fe5b604080517f89afcb44000000000000000000000000000000000000000000000000000000008152306004820152815160209390930294909401356001600160a01b0316936389afcb449350602480820193918290030181600087803b1580156105ea57600080fd5b505af11580156105fe573d6000803e3d6000fd5b505050506040513d604081101561061457600080fd5b5080516020909101519092509050811580159061063f57506002546001600160a01b03858116911614155b1561064e5761064e8483610a8c565b60008111801561066c57506002546001600160a01b03848116911614155b1561067b5761067b8382610a8c565b600254604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156106df57600080fd5b505afa1580156106f3573d6000803e3d6000fd5b505050506040513d602081101561070957600080fd5b50516006549091506000906402540be4009061072c90849063ffffffff610b1616565b8161073357fe5b600254600454929091049250610756916001600160a01b03918216911683610b88565b6000610768838363ffffffff610d3e16565b60025460035491925060009161078c9184916001600160a01b039182169116610d96565b60035490915060028204906107ad906001600160a01b031661dead83610b88565b6003546005546107ca916001600160a01b03908116911683610b88565b600560009054906101000a90046001600160a01b03166001600160a01b0316637d7c2a1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561081a57600080fd5b505af115801561082e573d6000803e3d6000fd5b50506001909b019a506102ec9950505050505050505050565b505050565b6000546001600160a01b031681565b6005546001600160a01b031681565b6000546001600160a01b031633146108c9576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b64012a05f20081111561090d5760405162461bcd60e51b815260040180806020018281038252602c8152602001806112b5602c913960400191505060405180910390fd5b600655565b6004546001600160a01b031681565b6000546001600160a01b03163314610980576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b600480546001600160a01b039384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560058054929093169116179055565b6001546001600160a01b031681565b6402540be40081565b6003546001600160a01b031681565b6000546001600160a01b03163314610a4c576040805162461bcd60e51b815260206004820152601c60248201527f44587377617046656552656365697665723a20464f5242494444454e00000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61dead81565b600254610aac90610aa79084906001600160a01b0316611065565b61114f565b610afd576040805162461bcd60e51b815260206004820181905260248201527f44587377617046656552656365697665723a204e4f5f484f4e45595f50414952604482015290519081900360640190fd5b60025461084790829084906001600160a01b0316610d96565b6000811580610b3157505080820282828281610b2e57fe5b04145b610b82576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b92915050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310610c5157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c14565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610cb3576040519150601f19603f3d011682016040523d82523d6000602084013e610cb8565b606091505b5091509150818015610ce6575080511580610ce65750808060200190516020811015610ce357600080fd5b50515b610d37576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b80820382811115610b82576040805162461bcd60e51b815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b600080610da38484611065565b9050600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610de157600080fd5b505afa158015610df5573d6000803e3d6000fd5b505050506040513d6060811015610e0b57600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506000806001600160a01b0380881690891610610e48578284610e4b565b83835b91509150600082118015610e5f5750600081115b610e9a5760405162461bcd60e51b815260040180806020018281038252602981526020018061128c6029913960400191505060405180910390fd5b6000610ebf610eb2612710601e63ffffffff610d3e16565b8b9063ffffffff610b1616565b90506000610ed3828463ffffffff610b1616565b90506000610ef983610eed8761271063ffffffff610b1616565b9063ffffffff61115516565b9050808281610f0457fe5b049850610f128b898e610b88565b6000808b6001600160a01b03168d6001600160a01b031610610f36578a6000610f3a565b60008b5b91509150896001600160a01b031663022c0d9f83833060006040519080825280601f01601f191660200182016040528015610f7c576020820181803883390190505b506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610fed578181015183820152602001610fd5565b50505050905090810190601f16801561101a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561103c57600080fd5b505af1158015611050573d6000803e3d6000fd5b50505050505050505050505050509392505050565b600080600061107485856111ad565b600154604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606095861b811660208084019190915294861b81166034830152825160288184030181526048830184528051908601207fff0000000000000000000000000000000000000000000000000000000000000060688401529390951b9094166069850152607d8401919091527f3f88503e8580ab941773b59034fb4b2a63e86dbc031b3633a925533ad3ed2b93609d808501919091528151808503909101815260bd9093019052815191012095945050505050565b3b151590565b80820182811015610b82576040805162461bcd60e51b815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b600080826001600160a01b0316846001600160a01b031614156112015760405162461bcd60e51b81526004018080602001828103825260268152602001806112e16026913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610611221578284611224565b83835b90925090506001600160a01b038216611284576040805162461bcd60e51b815260206004820152601f60248201527f44587377617046656552656365697665723a205a45524f5f4144445245535300604482015290519081900360640190fd5b925092905056fe44587377617046656552656365697665723a20494e53554646494349454e545f4c495155494449545944587377617046656552656365697665723a20484f4e45595f50524f504f5254494f4e5f544f4f5f4849474844587377617046656552656365697665723a204944454e544943414c5f414444524553534553a265627a7a72315820598ce1a58ff8283d0fe8c146bb6789ae15fc1cd0aa4867c82b668a372671567464736f6c63430005100032