Latest 9 txns

TxHash Age From To Value [TxFee]
0x6ae8cf2cff3146d827356f91d2de6cad31338219a7b8b867d65c67f59b912cea215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.000063486
0x85cde1b0c33e8b26c08358bef129d1f06912aa0201b3ffd1b1bf8a66f1d44698215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.00014394
0x34e86a7c83a7fb7e83e1848ecbda0ca1ca5e26f9bbabfcb0f19c8b43fe385237215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.00014394
0xf4e4fad5a58da9b2ea9c64c927c6c74008b78064d817620fc3efc2fc78bc61aa215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.00017394
0x2c2e4cf7548bee384dbdfbe74e4dd9088f1b80395c8443f7a42f440070447a03215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.000048578
0x094e98776fd55cb73fdd3c95b16ce197b06b180ce826884e3d540b1dd72c0d3b215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.000058188
0x6e0bc9d298b392f5f46215e84bfb739fdb170ea8c8fd2a6b6cbe49de9a95cc07215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.000058844
0x9cc176c041751fedd9d4733f4f0837af564a52bed15ca76fefdd30301045c1f0215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN   0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether0.00017394
0xbc8f9dc81340008e20e72552ad6a653b9802fd35cc9f5e3999762795e2d48141215 days 15 hrs ago0x7985405a348baa90c92164b86b383c8f43ad2d96  IN    Contract Creation0 Ether0.003057774
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xf27dbbea1856f18142cdd3b575146199f7f3a7ea0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50x5a261fa748ea3053b32790963b2de588b100ab240 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xf27dbbea1856f18142cdd3b575146199f7f3a7ea0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xf27dbbea1856f18142cdd3b575146199f7f3a7ea0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xb2edad34d3b6318252a35cb80af4df75b398692c0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xf27dbbea1856f18142cdd3b575146199f7f3a7ea0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xf27dbbea1856f18142cdd3b575146199f7f3a7ea0xb9bcc9dc47e772d4c57526b28d8537325b9128c50 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50x4a2b588be548ff50c05fd5fc5041384d80d2a8ed0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
0xbca80333d3dbffaf8b1fe5daeee129aed92386c6499e095c389643d04b9615de10420945 51 secs ago0xb9bcc9dc47e772d4c57526b28d8537325b9128c50xf27dbbea1856f18142cdd3b575146199f7f3a7ea0 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: ExpectedRate
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.18;

// File: contracts/ERC20Interface.sol

// https://github.com/ethereum/EIPs/issues/20
interface ERC20 {
    function totalSupply() public view returns (uint supply);
    function balanceOf(address _owner) public view returns (uint balance);
    function transfer(address _to, uint _value) public returns (bool success);
    function transferFrom(address _from, address _to, uint _value) public returns (bool success);
    function approve(address _spender, uint _value) public returns (bool success);
    function allowance(address _owner, address _spender) public view returns (uint remaining);
    function decimals() public view returns(uint digits);
    event Approval(address indexed _owner, address indexed _spender, uint _value);
}

// File: contracts/ExpectedRateInterface.sol

interface ExpectedRateInterface {
    function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view
        returns (uint expectedRate, uint slippageRate);
}

// File: contracts/FeeBurnerInterface.sol

interface FeeBurnerInterface {
    function handleFees (uint tradeWeiAmount, address reserve, address wallet) public returns(bool);
}

// File: contracts/KyberNetworkInterface.sol

/// @title Kyber Network interface
interface KyberNetworkInterface {
    function maxGasPrice() public view returns(uint);
    function getUserCapInWei(address user) public view returns(uint);
    function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint);
    function enabled() public view returns(bool);
    function info(bytes32 id) public view returns(uint);

    function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view
        returns (uint expectedRate, uint slippageRate);

    function tradeWithHint(address trader, ERC20 src, uint srcAmount, ERC20 dest, address destAddress,
        uint maxDestAmount, uint minConversionRate, address walletId, bytes hint) public payable returns(uint);
}

// File: contracts/KyberReserveInterface.sol

/// @title Kyber Reserve contract
interface KyberReserveInterface {

    function trade(
        ERC20 srcToken,
        uint srcAmount,
        ERC20 destToken,
        address destAddress,
        uint conversionRate,
        bool validate
    )
        public
        payable
        returns(bool);

    function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint);
}

// File: contracts/Utils.sol

/// @title Kyber constants contract
contract Utils {

    ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
    uint  constant internal PRECISION = (10**18);
    uint  constant internal MAX_QTY   = (10**28); // 10B tokens
    uint  constant internal MAX_RATE  = (PRECISION * 10**6); // up to 1M tokens per ETH
    uint  constant internal MAX_DECIMALS = 18;
    uint  constant internal ETH_DECIMALS = 18;
    mapping(address=>uint) internal decimals;

    function setDecimals(ERC20 token) internal {
        if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS;
        else decimals[token] = token.decimals();
    }

    function getDecimals(ERC20 token) internal view returns(uint) {
        if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access
        uint tokenDecimals = decimals[token];
        // technically, there might be token with decimals 0
        // moreover, very possible that old tokens have decimals 0
        // these tokens will just have higher gas fees.
        if(tokenDecimals == 0) return token.decimals();

        return tokenDecimals;
    }

    function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
        require(srcQty <= MAX_QTY);
        require(rate <= MAX_RATE);

        if (dstDecimals >= srcDecimals) {
            require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
            return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION;
        } else {
            require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
            return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals)));
        }
    }

    function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
        require(dstQty <= MAX_QTY);
        require(rate <= MAX_RATE);
        
        //source quantity is rounded up. to avoid dest quantity being too low.
        uint numerator;
        uint denominator;
        if (srcDecimals >= dstDecimals) {
            require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
            numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals)));
            denominator = rate;
        } else {
            require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
            numerator = (PRECISION * dstQty);
            denominator = (rate * (10**(dstDecimals - srcDecimals)));
        }
        return (numerator + denominator - 1) / denominator; //avoid rounding down errors
    }
}

// File: contracts/Utils2.sol

contract Utils2 is Utils {

    /// @dev get the balance of a user.
    /// @param token The token type
    /// @return The balance
    function getBalance(ERC20 token, address user) public view returns(uint) {
        if (token == ETH_TOKEN_ADDRESS)
            return user.balance;
        else
            return token.balanceOf(user);
    }

    function getDecimalsSafe(ERC20 token) internal returns(uint) {

        if (decimals[token] == 0) {
            setDecimals(token);
        }

        return decimals[token];
    }

    function calcDestAmount(ERC20 src, ERC20 dest, uint srcAmount, uint rate) internal view returns(uint) {
        return calcDstQty(srcAmount, getDecimals(src), getDecimals(dest), rate);
    }

    function calcSrcAmount(ERC20 src, ERC20 dest, uint destAmount, uint rate) internal view returns(uint) {
        return calcSrcQty(destAmount, getDecimals(src), getDecimals(dest), rate);
    }

    function calcRateFromQty(uint srcAmount, uint destAmount, uint srcDecimals, uint dstDecimals)
        internal pure returns(uint)
    {
        require(srcAmount <= MAX_QTY);
        require(destAmount <= MAX_QTY);

        if (dstDecimals >= srcDecimals) {
            require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
            return (destAmount * PRECISION / ((10 ** (dstDecimals - srcDecimals)) * srcAmount));
        } else {
            require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
            return (destAmount * PRECISION * (10 ** (srcDecimals - dstDecimals)) / srcAmount);
        }
    }
}

// File: contracts/WhiteListInterface.sol

contract WhiteListInterface {
    function getUserCapInWei(address user) external view returns (uint userCapWei);
}

// File: contracts/PermissionGroups.sol

contract PermissionGroups {

    address public admin;
    address public pendingAdmin;
    mapping(address=>bool) internal operators;
    mapping(address=>bool) internal alerters;
    address[] internal operatorsGroup;
    address[] internal alertersGroup;
    uint constant internal MAX_GROUP_SIZE = 50;

    function PermissionGroups() public {
        admin = msg.sender;
    }

    modifier onlyAdmin() {
        require(msg.sender == admin);
        _;
    }

    modifier onlyOperator() {
        require(operators[msg.sender]);
        _;
    }

    modifier onlyAlerter() {
        require(alerters[msg.sender]);
        _;
    }

    function getOperators () external view returns(address[]) {
        return operatorsGroup;
    }

    function getAlerters () external view returns(address[]) {
        return alertersGroup;
    }

    event TransferAdminPending(address pendingAdmin);

    /**
     * @dev Allows the current admin to set the pendingAdmin address.
     * @param newAdmin The address to transfer ownership to.
     */
    function transferAdmin(address newAdmin) public onlyAdmin {
        require(newAdmin != address(0));
        TransferAdminPending(pendingAdmin);
        pendingAdmin = newAdmin;
    }

    /**
     * @dev Allows the current admin to set the admin in one tx. Useful initial deployment.
     * @param newAdmin The address to transfer ownership to.
     */
    function transferAdminQuickly(address newAdmin) public onlyAdmin {
        require(newAdmin != address(0));
        TransferAdminPending(newAdmin);
        AdminClaimed(newAdmin, admin);
        admin = newAdmin;
    }

    event AdminClaimed( address newAdmin, address previousAdmin);

    /**
     * @dev Allows the pendingAdmin address to finalize the change admin process.
     */
    function claimAdmin() public {
        require(pendingAdmin == msg.sender);
        AdminClaimed(pendingAdmin, admin);
        admin = pendingAdmin;
        pendingAdmin = address(0);
    }

    event AlerterAdded (address newAlerter, bool isAdd);

    function addAlerter(address newAlerter) public onlyAdmin {
        require(!alerters[newAlerter]); // prevent duplicates.
        require(alertersGroup.length < MAX_GROUP_SIZE);

        AlerterAdded(newAlerter, true);
        alerters[newAlerter] = true;
        alertersGroup.push(newAlerter);
    }

    function removeAlerter (address alerter) public onlyAdmin {
        require(alerters[alerter]);
        alerters[alerter] = false;

        for (uint i = 0; i < alertersGroup.length; ++i) {
            if (alertersGroup[i] == alerter) {
                alertersGroup[i] = alertersGroup[alertersGroup.length - 1];
                alertersGroup.length--;
                AlerterAdded(alerter, false);
                break;
            }
        }
    }

    event OperatorAdded(address newOperator, bool isAdd);

    function addOperator(address newOperator) public onlyAdmin {
        require(!operators[newOperator]); // prevent duplicates.
        require(operatorsGroup.length < MAX_GROUP_SIZE);

        OperatorAdded(newOperator, true);
        operators[newOperator] = true;
        operatorsGroup.push(newOperator);
    }

    function removeOperator (address operator) public onlyAdmin {
        require(operators[operator]);
        operators[operator] = false;

        for (uint i = 0; i < operatorsGroup.length; ++i) {
            if (operatorsGroup[i] == operator) {
                operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1];
                operatorsGroup.length -= 1;
                OperatorAdded(operator, false);
                break;
            }
        }
    }
}

// File: contracts/Withdrawable.sol

/**
 * @title Contracts that should be able to recover tokens or ethers
 * @author Ilan Doron
 * @dev This allows to recover any tokens or Ethers received in a contract.
 * This will prevent any accidental loss of tokens.
 */
contract Withdrawable is PermissionGroups {

    event TokenWithdraw(ERC20 token, uint amount, address sendTo);

    /**
     * @dev Withdraw all ERC20 compatible tokens
     * @param token ERC20 The address of the token contract
     */
    function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin {
        require(token.transfer(sendTo, amount));
        TokenWithdraw(token, amount, sendTo);
    }

    event EtherWithdraw(uint amount, address sendTo);

    /**
     * @dev Withdraw Ethers
     */
    function withdrawEther(uint amount, address sendTo) external onlyAdmin {
        sendTo.transfer(amount);
        EtherWithdraw(amount, sendTo);
    }
}

// File: contracts/KyberNetwork.sol

////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @title Kyber Network main contract
contract KyberNetwork is Withdrawable, Utils2, KyberNetworkInterface {

    uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01%
    KyberReserveInterface[] public reserves;
    mapping(address=>bool) public isReserve;
    WhiteListInterface public whiteListContract;
    ExpectedRateInterface public expectedRateContract;
    FeeBurnerInterface    public feeBurnerContract;
    address               public kyberNetworkProxyContract;
    uint                  public maxGasPriceValue = 50 * 1000 * 1000 * 1000; // 50 gwei
    bool                  public isEnabled = false; // network is enabled
    mapping(bytes32=>uint) public infoFields; // this is only a UI field for external app.
    mapping(address=>address[]) public reservesPerTokenSrc; //reserves supporting token to eth
    mapping(address=>address[]) public reservesPerTokenDest;//reserves support eth to token

    function KyberNetwork(address _admin) public {
        require(_admin != address(0));
        admin = _admin;
    }

    event EtherReceival(address indexed sender, uint amount);

    /* solhint-disable no-complex-fallback */
    // To avoid users trying to swap tokens using default payable function. We added this short code
    //  to verify Ethers will be received only from reserves if transferred without a specific function call.
    function() public payable {
        require(isReserve[msg.sender]);
        EtherReceival(msg.sender, msg.value);
    }
    /* solhint-enable no-complex-fallback */

    struct TradeInput {
        address trader;
        ERC20 src;
        uint srcAmount;
        ERC20 dest;
        address destAddress;
        uint maxDestAmount;
        uint minConversionRate;
        address walletId;
        bytes hint;
    }

    function tradeWithHint(
        address trader,
        ERC20 src,
        uint srcAmount,
        ERC20 dest,
        address destAddress,
        uint maxDestAmount,
        uint minConversionRate,
        address walletId,
        bytes hint
    )
        public
        payable
        returns(uint)
    {
        require(hint.length == 0);
        require(msg.sender == kyberNetworkProxyContract);

        TradeInput memory tradeInput;

        tradeInput.trader = trader;
        tradeInput.src = src;
        tradeInput.srcAmount = srcAmount;
        tradeInput.dest = dest;
        tradeInput.destAddress = destAddress;
        tradeInput.maxDestAmount = maxDestAmount;
        tradeInput.minConversionRate = minConversionRate;
        tradeInput.walletId = walletId;
        tradeInput.hint = hint;

        return trade(tradeInput);
    }

    event AddReserveToNetwork(KyberReserveInterface reserve, bool add);

    /// @notice can be called only by admin
    /// @dev add or deletes a reserve to/from the network.
    /// @param reserve The reserve address.
    /// @param add If true, the add reserve. Otherwise delete reserve.
    function addReserve(KyberReserveInterface reserve, bool add) public onlyAdmin {

        if (add) {
            require(!isReserve[reserve]);
            reserves.push(reserve);
            isReserve[reserve] = true;
            AddReserveToNetwork(reserve, true);
        } else {
            isReserve[reserve] = false;
            // will have trouble if more than 50k reserves...
            for (uint i = 0; i < reserves.length; i++) {
                if (reserves[i] == reserve) {
                    reserves[i] = reserves[reserves.length - 1];
                    reserves.length--;
                    AddReserveToNetwork(reserve, false);
                    break;
                }
            }
        }
    }

    event ListReservePairs(address reserve, ERC20 src, ERC20 dest, bool add);

    /// @notice can be called only by admin
    /// @dev allow or prevent a specific reserve to trade a pair of tokens
    /// @param reserve The reserve address.
    /// @param token token address
    /// @param ethToToken will it support ether to token trade
    /// @param tokenToEth will it support token to ether trade
    /// @param add If true then list this pair, otherwise unlist it.
    function listPairForReserve(address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add)
        public onlyAdmin
    {
        require(isReserve[reserve]);

        if (ethToToken) {
            listPairs(reserve, token, false, add);

            ListReservePairs(reserve, ETH_TOKEN_ADDRESS, token, add);
        }

        if (tokenToEth) {
            listPairs(reserve, token, true, add);
            if (add) {
                token.approve(reserve, 2**255); // approve infinity
            } else {
                token.approve(reserve, 0);
            }

            ListReservePairs(reserve, token, ETH_TOKEN_ADDRESS, add);
        }

        setDecimals(token);
    }

    function setWhiteList(WhiteListInterface whiteList) public onlyAdmin {
        require(whiteList != address(0));
        whiteListContract = whiteList;
    }

    function setExpectedRate(ExpectedRateInterface expectedRate) public onlyAdmin {
        require(expectedRate != address(0));
        expectedRateContract = expectedRate;
    }

    function setFeeBurner(FeeBurnerInterface feeBurner) public onlyAdmin {
        require(feeBurner != address(0));
        feeBurnerContract = feeBurner;
    }

    function setParams(
        uint                  _maxGasPrice,
        uint                  _negligibleRateDiff
    )
        public
        onlyAdmin
    {
        require(_negligibleRateDiff <= 100 * 100); // at most 100%

        maxGasPriceValue = _maxGasPrice;
        negligibleRateDiff = _negligibleRateDiff;
    }

    function setEnable(bool _enable) public onlyAdmin {
        if (_enable) {
            require(whiteListContract != address(0));
            require(feeBurnerContract != address(0));
            require(expectedRateContract != address(0));
            require(kyberNetworkProxyContract != address(0));
        }
        isEnabled = _enable;
    }

    function setInfo(bytes32 field, uint value) public onlyOperator {
        infoFields[field] = value;
    }

    event KyberProxySet(address proxy, address sender);

    function setKyberProxy(address networkProxy) public onlyAdmin {
        require(networkProxy != address(0));
        kyberNetworkProxyContract = networkProxy;
        KyberProxySet(kyberNetworkProxyContract, msg.sender);
    }

    /// @dev returns number of reserves
    /// @return number of reserves
    function getNumReserves() public view returns(uint) {
        return reserves.length;
    }

    /// @notice should be called off chain with as much gas as needed
    /// @dev get an array of all reserves
    /// @return An array of all reserves
    function getReserves() public view returns(KyberReserveInterface[]) {
        return reserves;
    }

    function maxGasPrice() public view returns(uint) {
        return maxGasPriceValue;
    }

    function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty)
        public view
        returns(uint expectedRate, uint slippageRate)
    {
        require(expectedRateContract != address(0));
        return expectedRateContract.getExpectedRate(src, dest, srcQty);
    }

    function getUserCapInWei(address user) public view returns(uint) {
        return whiteListContract.getUserCapInWei(user);
    }

    function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint) {
        //future feature
        user;
        token;
        require(false);
    }

    struct BestRateResult {
        uint rate;
        address reserve1;
        address reserve2;
        uint weiAmount;
        uint rateSrcToEth;
        uint rateEthToDest;
        uint destAmount;
    }

    /// @notice use token address ETH_TOKEN_ADDRESS for ether
    /// @dev best conversion rate for a pair of tokens, if number of reserves have small differences. randomize
    /// @param src Src token
    /// @param dest Destination token
    /// @return obsolete - used to return best reserve index. not relevant anymore for this API.
    function findBestRate(ERC20 src, ERC20 dest, uint srcAmount) public view returns(uint obsolete, uint rate) {
        BestRateResult memory result = findBestRateTokenToToken(src, dest, srcAmount);
        return(0, result.rate);
    }

    function enabled() public view returns(bool) {
        return isEnabled;
    }

    function info(bytes32 field) public view returns(uint) {
        return infoFields[field];
    }

    /* solhint-disable code-complexity */
    // Not sure how solhing defines complexity. Anyway, from our point of view, below code follows the required
    //  algorithm to choose a reserve, it has been tested, reviewed and found to be clear enough.
    //@dev this function always src or dest are ether. can't do token to token
    function searchBestRate(ERC20 src, ERC20 dest, uint srcAmount) public view returns(address, uint) {
        uint bestRate = 0;
        uint bestReserve = 0;
        uint numRelevantReserves = 0;

        //return 1 for ether to ether
        if (src == dest) return (reserves[bestReserve], PRECISION);

        address[] memory reserveArr;

        if (src == ETH_TOKEN_ADDRESS) {
            reserveArr = reservesPerTokenDest[dest];
        } else {
            reserveArr = reservesPerTokenSrc[src];
        }

        if (reserveArr.length == 0) return (reserves[bestReserve], bestRate);

        uint[] memory rates = new uint[](reserveArr.length);
        uint[] memory reserveCandidates = new uint[](reserveArr.length);

        for (uint i = 0; i < reserveArr.length; i++) {
            //list all reserves that have this token.
            rates[i] = (KyberReserveInterface(reserveArr[i])).getConversionRate(src, dest, srcAmount, block.number);

            if (rates[i] > bestRate) {
                //best rate is highest rate
                bestRate = rates[i];
            }
        }

        if (bestRate > 0) {
            uint random = 0;
            uint smallestRelevantRate = (bestRate * 10000) / (10000 + negligibleRateDiff);

            for (i = 0; i < reserveArr.length; i++) {
                if (rates[i] >= smallestRelevantRate) {
                    reserveCandidates[numRelevantReserves++] = i;
                }
            }

            if (numRelevantReserves > 1) {
                //when encountering small rate diff from bestRate. draw from relevant reserves
                random = uint(block.blockhash(block.number-1)) % numRelevantReserves;
            }

            bestReserve = reserveCandidates[random];
            bestRate = rates[bestReserve];
        }

        return (reserveArr[bestReserve], bestRate);
    }
    /* solhint-enable code-complexity */

    function findBestRateTokenToToken(ERC20 src, ERC20 dest, uint srcAmount) internal view
        returns(BestRateResult result)
    {
        (result.reserve1, result.rateSrcToEth) = searchBestRate(src, ETH_TOKEN_ADDRESS, srcAmount);
        result.weiAmount = calcDestAmount(src, ETH_TOKEN_ADDRESS, srcAmount, result.rateSrcToEth);

        (result.reserve2, result.rateEthToDest) = searchBestRate(ETH_TOKEN_ADDRESS, dest, result.weiAmount);
        result.destAmount = calcDestAmount(ETH_TOKEN_ADDRESS, dest, result.weiAmount, result.rateEthToDest);

        result.rate = calcRateFromQty(srcAmount, result.destAmount, getDecimals(src), getDecimals(dest));
    }

    function listPairs(address reserve, ERC20 token, bool isTokenToEth, bool add) internal {
        uint i;
        address[] storage reserveArr = reservesPerTokenDest[token];

        if (isTokenToEth) {
            reserveArr = reservesPerTokenSrc[token];
        }

        for (i = 0; i < reserveArr.length; i++) {
            if (reserve == reserveArr[i]) {
                if (add) {
                    break; //already added
                } else {
                    //remove
                    reserveArr[i] = reserveArr[reserveArr.length - 1];
                    reserveArr.length--;
                }
            }
        }

        if (add && i == reserveArr.length) {
            //if reserve wasn't found add it
            reserveArr.push(reserve);
        }
    }

    event KyberTrade(address srcAddress, ERC20 srcToken, uint srcAmount, address destAddress, ERC20 destToken,
        uint destAmount);
    /* solhint-disable function-max-lines */
    // Most of the lins here are functions calls spread over multiple lines. We find this function readable enough
    //  and keep its size as is.
    /// @notice use token address ETH_TOKEN_ADDRESS for ether
    /// @dev trade api for kyber network.
    /// @param tradeInput structure of trade inputs
    function trade(TradeInput tradeInput) internal returns(uint) {
        require(isEnabled);
        require(tx.gasprice <= maxGasPriceValue);
        require(validateTradeInput(tradeInput.src, tradeInput.srcAmount, tradeInput.dest, tradeInput.destAddress));

        BestRateResult memory rateResult =
        findBestRateTokenToToken(tradeInput.src, tradeInput.dest, tradeInput.srcAmount);

        require(rateResult.rate > 0);
        require(rateResult.rate < MAX_RATE);
        require(rateResult.rate >= tradeInput.minConversionRate);

        uint actualDestAmount;
        uint weiAmount;
        uint actualSrcAmount;

        (actualSrcAmount, weiAmount, actualDestAmount) = calcActualAmounts(tradeInput.src,
            tradeInput.dest,
            tradeInput.srcAmount,
            tradeInput.maxDestAmount,
            rateResult);

        if (actualSrcAmount < tradeInput.srcAmount) {
            //if there is "change" send back to trader
            if (tradeInput.src == ETH_TOKEN_ADDRESS) {
                tradeInput.trader.transfer(tradeInput.srcAmount - actualSrcAmount);
            } else {
                tradeInput.src.transfer(tradeInput.trader, (tradeInput.srcAmount - actualSrcAmount));
            }
        }

        // verify trade size is smaller than user cap
        require(weiAmount <= getUserCapInWei(tradeInput.trader));

        //do the trade
        //src to ETH
        require(doReserveTrade(
                tradeInput.src,
                actualSrcAmount,
                ETH_TOKEN_ADDRESS,
                this,
                weiAmount,
                KyberReserveInterface(rateResult.reserve1),
                rateResult.rateSrcToEth,
                true));

        //Eth to dest
        require(doReserveTrade(
                ETH_TOKEN_ADDRESS,
                weiAmount,
                tradeInput.dest,
                tradeInput.destAddress,
                actualDestAmount,
                KyberReserveInterface(rateResult.reserve2),
                rateResult.rateEthToDest,
                true));

        //when src is ether, reserve1 is doing a "fake" trade. (ether to ether) - don't burn.
        //when dest is ether, reserve2 is doing a "fake" trade. (ether to ether) - don't burn.
        if (tradeInput.src != ETH_TOKEN_ADDRESS)
            require(feeBurnerContract.handleFees(weiAmount, rateResult.reserve1, tradeInput.walletId));
        if (tradeInput.dest != ETH_TOKEN_ADDRESS)
            require(feeBurnerContract.handleFees(weiAmount, rateResult.reserve2, tradeInput.walletId));

        KyberTrade(tradeInput.trader, tradeInput.src, actualSrcAmount, tradeInput.destAddress, tradeInput.dest,
            actualDestAmount);

        return actualDestAmount;
    }
    /* solhint-enable function-max-lines */

    function calcActualAmounts (ERC20 src, ERC20 dest, uint srcAmount, uint maxDestAmount, BestRateResult rateResult)
        internal view returns(uint actualSrcAmount, uint weiAmount, uint actualDestAmount)
    {
        if (rateResult.destAmount > maxDestAmount) {
            actualDestAmount = maxDestAmount;
            weiAmount = calcSrcAmount(ETH_TOKEN_ADDRESS, dest, actualDestAmount, rateResult.rateEthToDest);
            actualSrcAmount = calcSrcAmount(src, ETH_TOKEN_ADDRESS, weiAmount, rateResult.rateSrcToEth);
            require(actualSrcAmount <= srcAmount);
        } else {
            actualDestAmount = rateResult.destAmount;
            actualSrcAmount = srcAmount;
            weiAmount = rateResult.weiAmount;
        }
    }

    /// @notice use token address ETH_TOKEN_ADDRESS for ether
    /// @dev do one trade with a reserve
    /// @param src Src token
    /// @param amount amount of src tokens
    /// @param dest   Destination token
    /// @param destAddress Address to send tokens to
    /// @param reserve Reserve to use
    /// @param validate If true, additional validations are applicable
    /// @return true if trade is successful
    function doReserveTrade(
        ERC20 src,
        uint amount,
        ERC20 dest,
        address destAddress,
        uint expectedDestAmount,
        KyberReserveInterface reserve,
        uint conversionRate,
        bool validate
    )
        internal
        returns(bool)
    {
        uint callValue = 0;

        if (src == dest) {
            //this is for a "fake" trade when both src and dest are ethers.
            if (destAddress != (address(this)))
                destAddress.transfer(amount);
            return true;
        }

        if (src == ETH_TOKEN_ADDRESS) {
            callValue = amount;
        }

        // reserve sends tokens/eth to network. network sends it to destination
        require(reserve.trade.value(callValue)(src, amount, dest, this, conversionRate, validate));

        if (destAddress != address(this)) {
            //for token to token dest address is network. and Ether / token already here...
            if (dest == ETH_TOKEN_ADDRESS) {
                destAddress.transfer(expectedDestAmount);
            } else {
                require(dest.transfer(destAddress, expectedDestAmount));
            }
        }

        return true;
    }

    /// @notice use token address ETH_TOKEN_ADDRESS for ether
    /// @dev checks that user sent ether/tokens to contract before trade
    /// @param src Src token
    /// @param srcAmount amount of src tokens
    /// @return true if tradeInput is valid
    function validateTradeInput(ERC20 src, uint srcAmount, ERC20 dest, address destAddress)
        internal
        view
        returns(bool)
    {
        require(srcAmount <= MAX_QTY);
        require(srcAmount != 0);
        require(destAddress != address(0));
        require(src != dest);

        if (src == ETH_TOKEN_ADDRESS) {
            require(msg.value == srcAmount);
        } else {
            require(msg.value == 0);
            //funds should have been moved to this contract already.
            require(src.balanceOf(this) >= srcAmount);
        }

        return true;
    }
}

// File: contracts/ExpectedRate.sol

contract ExpectedRate is Withdrawable, ExpectedRateInterface, Utils2 {

    KyberNetwork public kyberNetwork;
    uint public quantityFactor = 2;
    uint public worstCaseRateFactorInBps = 50;

    function ExpectedRate(KyberNetwork _kyberNetwork, address _admin) public {
        require(_admin != address(0));
        require(_kyberNetwork != address(0));
        kyberNetwork = _kyberNetwork;
        admin = _admin;
    }

    event QuantityFactorSet (uint newFactor, uint oldFactor, address sender);

    function setQuantityFactor(uint newFactor) public onlyOperator {
        require(newFactor <= 100);

        QuantityFactorSet(newFactor, quantityFactor, msg.sender);
        quantityFactor = newFactor;
    }

    event MinSlippageFactorSet (uint newMin, uint oldMin, address sender);

    function setWorstCaseRateFactor(uint bps) public onlyOperator {
        require(bps <= 100 * 100);

        MinSlippageFactorSet(bps, worstCaseRateFactorInBps, msg.sender);
        worstCaseRateFactorInBps = bps;
    }

    //@dev when srcQty too small or 0 the expected rate will be calculated without quantity,
    // will enable rate reference before committing to any quantity
    //@dev when srcQty too small (no actual dest qty) slippage rate will be 0.
    function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty)
        public view
        returns (uint expectedRate, uint slippageRate)
    {
        require(quantityFactor != 0);
        require(srcQty <= MAX_QTY);
        require(srcQty * quantityFactor <= MAX_QTY);

        if (srcQty == 0) srcQty = 1;

        uint bestReserve;
        uint worstCaseSlippageRate;

        (bestReserve, expectedRate) = kyberNetwork.findBestRate(src, dest, srcQty);
        (bestReserve, slippageRate) = kyberNetwork.findBestRate(src, dest, (srcQty * quantityFactor));

        if (expectedRate == 0) {
            expectedRate = expectedRateSmallQty(src, dest, srcQty);
        }

        require(expectedRate <= MAX_RATE);

        worstCaseSlippageRate = ((10000 - worstCaseRateFactorInBps) * expectedRate) / 10000;
        if (slippageRate >= worstCaseSlippageRate) {
            slippageRate = worstCaseSlippageRate;
        }

        return (expectedRate, slippageRate);
    }

    //@dev for small src quantities dest qty might be 0, then returned rate is zero.
    //@dev for backward compatibility we would like to return non zero rate (correct one) for small src qty
    function expectedRateSmallQty(ERC20 src, ERC20 dest, uint srcQty) internal view returns(uint) {
        address reserve;
        uint rateSrcToEth;
        uint rateEthToDest;
        (reserve, rateSrcToEth) = kyberNetwork.searchBestRate(src, ETH_TOKEN_ADDRESS, srcQty);

        uint ethQty = calcDestAmount(src, ETH_TOKEN_ADDRESS, srcQty, rateSrcToEth);

        (reserve, rateEthToDest) = kyberNetwork.searchBestRate(ETH_TOKEN_ADDRESS, dest, ethQty);
        return rateSrcToEth * rateEthToDest / PRECISION;
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"alerter","type":"address"}],"name":"removeAlerter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getOperators","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"amount","type":"uint256"},{"name":"sendTo","type":"address"}],"name":"withdrawToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newAlerter","type":"address"}],"name":"addAlerter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newFactor","type":"uint256"}],"name":"setQuantityFactor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claimAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAlerters","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcQty","type":"uint256"}],"name":"getExpectedRate","outputs":[{"name":"expectedRate","type":"uint256"},{"name":"slippageRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOperator","type":"address"}],"name":"addOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"worstCaseRateFactorInBps","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"quantityFactor","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"operator","type":"address"}],"name":"removeOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kyberNetwork","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"sendTo","type":"address"}],"name":"withdrawEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"},{"name":"user","type":"address"}],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"bps","type":"uint256"}],"name":"setWorstCaseRateFactor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_kyberNetwork","type":"address"},{"name":"_admin","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newFactor","type":"uint256"},{"indexed":false,"name":"oldFactor","type":"uint256"},{"indexed":false,"name":"sender","type":"address"}],"name":"QuantityFactorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newMin","type":"uint256"},{"indexed":false,"name":"oldMin","type":"uint256"},{"indexed":false,"name":"sender","type":"address"}],"name":"MinSlippageFactorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"sendTo","type":"address"}],"name":"TokenWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"sendTo","type":"address"}],"name":"EtherWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAdmin","type":"address"},{"indexed":false,"name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAlerter","type":"address"},{"indexed":false,"name":"isAdd","type":"bool"}],"name":"AlerterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOperator","type":"address"},{"indexed":false,"name":"isAdd","type":"bool"}],"name":"OperatorAdded","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405260026008556032600955341561001957600080fd5b6040516040806114e4833981016040528080519190602001805160008054600160a060020a03191633600160a060020a039081169190911790915590925082161515905061006657600080fd5b600160a060020a038216151561007b57600080fd5b60078054600160a060020a03938416600160a060020a0319918216179091556000805492909316911617905561142e806100b66000396000f3006060604052600436106100f85763ffffffff60e060020a60003504166301a12fd381146100fd578063267822471461011e57806327a099d81461014d5780633ccdbb28146101b3578063408ee7fe146101dc57806375829def146101fb5780637658c5741461021a57806377f50f97146102305780637acc8678146102435780637c423f5414610262578063809a9e55146102755780639870d7fe146102b55780639bc72d5f146102d4578063a7de9c63146102f9578063ac8a584a1461030c578063b78b842d1461032b578063ce56c4541461033e578063d4fac45d14610360578063dcb46e3814610385578063f851a4401461039b575b600080fd5b341561010857600080fd5b61011c600160a060020a03600435166103ae565b005b341561012957600080fd5b61013161051e565b604051600160a060020a03909116815260200160405180910390f35b341561015857600080fd5b61016061052d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561019f578082015183820152602001610187565b505050509050019250505060405180910390f35b34156101be57600080fd5b61011c600160a060020a036004358116906024359060443516610596565b34156101e757600080fd5b61011c600160a060020a036004351661068d565b341561020657600080fd5b61011c600160a060020a0360043516610789565b341561022557600080fd5b61011c600435610824565b341561023b57600080fd5b61011c6108b0565b341561024e57600080fd5b61011c600160a060020a036004351661094a565b341561026d57600080fd5b610160610a2c565b341561028057600080fd5b61029d600160a060020a0360043581169060243516604435610a92565b60405191825260208201526040908101905180910390f35b34156102c057600080fd5b61011c600160a060020a0360043516610c66565b34156102df57600080fd5b6102e7610d36565b60405190815260200160405180910390f35b341561030457600080fd5b6102e7610d3c565b341561031757600080fd5b61011c600160a060020a0360043516610d42565b341561033657600080fd5b610131610eae565b341561034957600080fd5b61011c600435600160a060020a0360243516610ebd565b341561036b57600080fd5b6102e7600160a060020a0360043581169060243516610f50565b341561039057600080fd5b61011c600435611002565b34156103a657600080fd5b61013161108f565b6000805433600160a060020a039081169116146103ca57600080fd5b600160a060020a03821660009081526003602052604090205460ff1615156103f157600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b60055481101561051a5781600160a060020a031660058281548110151561043657fe5b600091825260209091200154600160a060020a031614156105125760058054600019810190811061046357fe5b60009182526020909120015460058054600160a060020a03909216918390811061048957fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906104c59060001983016113a9565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a161051a565b600101610413565b5050565b600154600160a060020a031681565b6105356113d2565b600480548060200260200160405190810160405280929190818152602001828054801561058b57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161056d575b505050505090505b90565b60005433600160a060020a039081169116146105b157600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561060e57600080fd5b6102c65a03f1151561061f57600080fd5b50505060405180519050151561063457600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a039081169116146106a857600080fd5b600160a060020a03811660009081526003602052604090205460ff16156106ce57600080fd5b600554603290106106de57600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff19166001908117909155600580549091810161075d83826113a9565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146107a457600080fd5b600160a060020a03811615156107b957600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b600160a060020a03331660009081526002602052604090205460ff16151561084b57600080fd5b606481111561085957600080fd5b7fd0f6fc40d497232b5aab1b7a34ea00ea45886e52d2fed39ad62af798a870fae381600854336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a1600855565b60015433600160a060020a039081169116146108cb57600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a0390811691161461096557600080fd5b600160a060020a038116151561097a57600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610a346113d2565b600580548060200260200160405190810160405280929190818152602001828054801561058b57602002820191906000526020600020908154600160a060020a0316815260019091019060200180831161056d575050505050905090565b600080600080600854600014151515610aaa57600080fd5b6b204fce5e3e25026110000000851115610ac357600080fd5b6008546b204fce5e3e250261100000009086021115610ae157600080fd5b841515610aed57600194505b600754600160a060020a031663b8388aca88888860006040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b1515610b5857600080fd5b6102c65a03f11515610b6957600080fd5b5050506040518051906020018051600754600854919750929450600160a060020a039092169163b8388aca915089908990890260006040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b1515610bf357600080fd5b6102c65a03f11515610c0457600080fd5b5050506040518051906020018051945090925050831515610c2d57610c2a87878761109e565b93505b69d3c21bcecceda1000000841115610c4457600080fd5b50600954612710908103840204808310610c5c578092505b5050935093915050565b60005433600160a060020a03908116911614610c8157600080fd5b600160a060020a03811660009081526002602052604090205460ff1615610ca757600080fd5b60045460329010610cb757600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff19166001908117909155600480549091810161075d83826113a9565b60095481565b60085481565b6000805433600160a060020a03908116911614610d5e57600080fd5b600160a060020a03821660009081526002602052604090205460ff161515610d8557600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b60045481101561051a5781600160a060020a0316600482815481101515610dca57fe5b600091825260209091200154600160a060020a03161415610ea657600480546000198101908110610df757fe5b60009182526020909120015460048054600160a060020a039092169183908110610e1d57fe5b60009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055600480546000190190610e5990826113a9565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a161051a565b600101610da7565b600754600160a060020a031681565b60005433600160a060020a03908116911614610ed857600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f193505050501515610f0957600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b6000600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610f885750600160a060020a03811631610ffc565b82600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610fdf57600080fd5b6102c65a03f11515610ff057600080fd5b50505060405180519150505b92915050565b600160a060020a03331660009081526002602052604090205460ff16151561102957600080fd5b61271081111561103857600080fd5b7f4357e20f1241d972328c5b3239d9ef4ac96f0f4fce8e10fd3bf9053690dad0ac81600954336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a1600955565b600054600160a060020a031681565b6007546000908190819081908190600160a060020a031663ab127a0c8973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee89856040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b151561112757600080fd5b6102c65a03f1151561113857600080fd5b505050604051805190602001805191955090935061116e90508873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee888661122b565b600754909150600160a060020a031663ab127a0c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee898460006040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b15156111f057600080fd5b6102c65a03f1151561120157600080fd5b5050506040518051906020018051670de0b6b3a76400009502949094049998505050505050505050565b60006112498361123a87611254565b61124387611254565b85611318565b90505b949350505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156112855760129150611312565b50600160a060020a03821660009081526006602052604090205480151561130e5782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112ec57600080fd5b6102c65a03f115156112fd57600080fd5b505050604051805190509150611312565b8091505b50919050565b60006b204fce5e3e2502611000000085111561133357600080fd5b69d3c21bcecceda100000082111561134a57600080fd5b83831061137d576012848403111561136157600080fd5b670de0b6b3a7640000858302858503600a0a025b04905061124c565b6012838503111561138d57600080fd5b828403600a0a670de0b6b3a76400000282860281151561137557fe5b8154818355818115116113cd576000838152602090206113cd9181019083016113e4565b505050565b60206040519081016040526000815290565b61059391905b808211156113fe57600081556001016113ea565b50905600a165627a7a72305820cb98173f95edbc94b93ac84d5fa53e94717e84023c8259891dbd0430ce7a353f0029000000000000000000000000f27dbbea1856f18142cdd3b575146199f7f3a7ea0000000000000000000000007985405a348baa90c92164b86b383c8f43ad2d96

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

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f27dbbea1856f18142cdd3b575146199f7f3a7ea
Arg [1] : 0000000000000000000000007985405a348baa90c92164b86b383c8f43ad2d96


   Swarm Source:
bzzr://cb98173f95edbc94b93ac84d5fa53e94717e84023c8259891dbd0430ce7a353f

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward