ETH Price: $2,975.90 (+4.00%)
Gas: 1 Gwei

Contract

0xed0DA07AAB7257Df53Efc4DfC076745744138Ed9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Value
Execute114709972020-12-17 13:44:581296 days ago1608212698IN
Argent: Token Exchanger
0 ETH0.0406938976
Execute114433582020-12-13 7:44:561300 days ago1607845496IN
Argent: Token Exchanger
0 ETH0.0116821519.944
Execute114299802020-12-11 6:18:501302 days ago1607667530IN
Argent: Token Exchanger
0 ETH0.0168371827.397
Execute113891342020-12-04 23:37:161309 days ago1607125036IN
Argent: Token Exchanger
0 ETH0.017582539.125
Execute113828032020-12-04 0:02:151310 days ago1607040135IN
Argent: Token Exchanger
0 ETH0.0134704524.05
Execute113784072020-12-03 7:52:301310 days ago1606981950IN
Argent: Token Exchanger
0 ETH0.014532828.5
Execute113784072020-12-03 7:52:301310 days ago1606981950IN
Argent: Token Exchanger
0 ETH0.0096308822.097
Execute113783822020-12-03 7:46:321310 days ago1606981592IN
Argent: Token Exchanger
0 ETH0.018096733.587
Execute113783752020-12-03 7:44:331310 days ago1606981473IN
Argent: Token Exchanger
0 ETH0.0137882824.582
Execute113657902020-12-01 9:26:411312 days ago1606814801IN
Argent: Token Exchanger
0 ETH0.1005976569
Execute113629332020-11-30 22:46:121313 days ago1606776372IN
Argent: Token Exchanger
0 ETH0.0866437474.125
Execute113624022020-11-30 20:48:311313 days ago1606769311IN
Argent: Token Exchanger
0 ETH0.03725632
Execute113623962020-11-30 20:47:161313 days ago1606769236IN
Argent: Token Exchanger
0 ETH0.0312091635.9
Execute113623832020-11-30 20:44:391313 days ago1606769079IN
Argent: Token Exchanger
0 ETH0.0176057223.64
Execute113623772020-11-30 20:43:391313 days ago1606769019IN
Argent: Token Exchanger
0 ETH0.0427727835.1
Execute113617132020-11-30 18:21:391313 days ago1606760499IN
Argent: Token Exchanger
0 ETH0.0851754973.463
Execute113607642020-11-30 14:46:121313 days ago1606747572IN
Argent: Token Exchanger
0 ETH0.18123436144
Execute113574022020-11-30 2:40:111314 days ago1606704011IN
Argent: Token Exchanger
0 ETH0.0631292747.688
Execute113573242020-11-30 2:22:481314 days ago1606702968IN
Argent: Token Exchanger
0 ETH0.0461838645.675
Execute113569632020-11-30 0:59:571314 days ago1606697997IN
Argent: Token Exchanger
0 ETH0.0699051550
Execute113566042020-11-29 23:39:511314 days ago1606693191IN
Argent: Token Exchanger
0 ETH0.0077099812.528
Execute113548982020-11-29 17:11:121314 days ago1606669872IN
Argent: Token Exchanger
0 ETH0.0201091515.125
Execute113501512020-11-28 23:48:391315 days ago1606607319IN
Argent: Token Exchanger
0 ETH0.008262213.201
Execute113486362020-11-28 18:18:141315 days ago1606587494IN
Argent: Token Exchanger
0 ETH0.007087215
Execute113479742020-11-28 15:55:461315 days ago1606578946IN
Argent: Token Exchanger
0 ETH0.011609721
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenExchanger

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-02-05
*/

pragma solidity ^0.4.24;

/**
 * @title Module
 * @dev Interface for a module. 
 * A module MUST implement the addModule() method to ensure that a wallet with at least one module
 * can never end up in a "frozen" state.
 * @author Julien Niset - <[email protected]>
 */
interface Module {

    /**
     * @dev Inits a module for a wallet by e.g. setting some wallet specific parameters in storage.
     * @param _wallet The wallet.
     */
    function init(BaseWallet _wallet) external;

    /**
     * @dev Adds a module to a wallet.
     * @param _wallet The target wallet.
     * @param _module The modules to authorise.
     */
    function addModule(BaseWallet _wallet, Module _module) external;

    /**
    * @dev Utility method to recover any ERC20 token that was sent to the
    * module by mistake. 
    * @param _token The token to recover.
    */
    function recoverToken(address _token) external;
}

/**
 * @title BaseModule
 * @dev Basic module that contains some methods common to all modules.
 * @author Julien Niset - <[email protected]>
 */
contract BaseModule is Module {

    // The adddress of the module registry.
    ModuleRegistry internal registry;

    event ModuleCreated(bytes32 name);
    event ModuleInitialised(address wallet);

    constructor(ModuleRegistry _registry, bytes32 _name) public {
        registry = _registry;
        emit ModuleCreated(_name);
    }

    /**
     * @dev Throws if the sender is not the target wallet of the call.
     */
    modifier onlyWallet(BaseWallet _wallet) {
        require(msg.sender == address(_wallet), "BM: caller must be wallet");
        _;
    }

    /**
     * @dev Throws if the sender is not the owner of the target wallet or the module itself.
     */
    modifier onlyOwner(BaseWallet _wallet) {
        require(msg.sender == address(this) || isOwner(_wallet, msg.sender), "BM: must be an owner for the wallet");
        _;
    }

    /**
     * @dev Throws if the sender is not the owner of the target wallet.
     */
    modifier strictOnlyOwner(BaseWallet _wallet) {
        require(isOwner(_wallet, msg.sender), "BM: msg.sender must be an owner for the wallet");
        _;
    }

    /**
     * @dev Inits the module for a wallet by logging an event.
     * The method can only be called by the wallet itself.
     * @param _wallet The wallet.
     */
    function init(BaseWallet _wallet) external onlyWallet(_wallet) {
        emit ModuleInitialised(_wallet);
    }

    /**
     * @dev Adds a module to a wallet. First checks that the module is registered.
     * @param _wallet The target wallet.
     * @param _module The modules to authorise.
     */
    function addModule(BaseWallet _wallet, Module _module) external strictOnlyOwner(_wallet) {
        require(registry.isRegisteredModule(_module), "BM: module is not registered");
        _wallet.authoriseModule(_module, true);
    }

    /**
    * @dev Utility method enbaling anyone to recover ERC20 token sent to the
    * module by mistake and transfer them to the Module Registry. 
    * @param _token The token to recover.
    */
    function recoverToken(address _token) external {
        uint total = ERC20(_token).balanceOf(address(this));
        ERC20(_token).transfer(address(registry), total);
    }

    /**
     * @dev Helper method to check if an address is the owner of a target wallet.
     * @param _wallet The target wallet.
     * @param _addr The address.
     */
    function isOwner(BaseWallet _wallet, address _addr) internal view returns (bool) {
        return _wallet.owner() == _addr;
    }
}

/**
 * @title RelayerModule
 * @dev Base module containing logic to execute transactions signed by eth-less accounts and sent by a relayer. 
 * @author Julien Niset - <[email protected]>
 */
contract RelayerModule is Module {

    uint256 constant internal BLOCKBOUND = 10000;

    mapping (address => RelayerConfig) public relayer; 

    struct RelayerConfig {
        uint256 nonce;
        mapping (bytes32 => bool) executedTx;
    }

    event TransactionExecuted(address indexed wallet, bool indexed success, bytes32 signedHash);

    /**
     * @dev Throws if the call did not go through the execute() method.
     */
    modifier onlyExecute {
        require(msg.sender == address(this), "RM: must be called via execute()");
        _;
    }

    /* ***************** Abstract method ************************* */

    /**
    * @dev Gets the number of valid signatures that must be provided to execute a
    * specific relayed transaction.
    * @param _wallet The target wallet.
    * @param _data The data of the relayed transaction.
    * @return The number of required signatures.
    */
    function getRequiredSignatures(BaseWallet _wallet, bytes _data) internal view returns (uint256);

    /**
    * @dev Validates the signatures provided with a relayed transaction.
    * The method MUST throw if one or more signatures are not valid.
    * @param _wallet The target wallet.
    * @param _data The data of the relayed transaction.
    * @param _signHash The signed hash representing the relayed transaction.
    * @param _signatures The signatures as a concatenated byte array.
    */
    function validateSignatures(BaseWallet _wallet, bytes _data, bytes32 _signHash, bytes _signatures) internal view returns (bool);

    /* ************************************************************ */

    /**
    * @dev Executes a relayed transaction.
    * @param _wallet The target wallet.
    * @param _data The data for the relayed transaction
    * @param _nonce The nonce used to prevent replay attacks.
    * @param _signatures The signatures as a concatenated byte array.
    * @param _gasPrice The gas price to use for the gas refund.
    * @param _gasLimit The gas limit to use for the gas refund.
    */
    function execute(
        BaseWallet _wallet,
        bytes _data, 
        uint256 _nonce, 
        bytes _signatures, 
        uint256 _gasPrice,
        uint256 _gasLimit
    )
        external
        returns (bool success)
    {
        uint startGas = gasleft();
        bytes32 signHash = getSignHash(address(this), _wallet, 0, _data, _nonce, _gasPrice, _gasLimit);
        require(checkAndUpdateUniqueness(_wallet, _nonce, signHash), "RM: Duplicate request");
        require(verifyData(address(_wallet), _data), "RM: the wallet authorized is different then the target of the relayed data");
        uint256 requiredSignatures = getRequiredSignatures(_wallet, _data);
        if((requiredSignatures * 65) == _signatures.length) {
            if(verifyRefund(_wallet, _gasLimit, _gasPrice, requiredSignatures)) {
                if(requiredSignatures == 0 || validateSignatures(_wallet, _data, signHash, _signatures)) {
                    // solium-disable-next-line security/no-call-value
                    success = address(this).call(_data);
                    refund(_wallet, startGas - gasleft(), _gasPrice, _gasLimit, requiredSignatures, msg.sender);
                }
            }
        }
        emit TransactionExecuted(_wallet, success, signHash); 
    }

    /**
    * @dev Gets the current nonce for a wallet.
    * @param _wallet The target wallet.
    */
    function getNonce(BaseWallet _wallet) external view returns (uint256 nonce) {
        return relayer[_wallet].nonce;
    }

    /**
    * @dev Generates the signed hash of a relayed transaction according to ERC 1077.
    * @param _from The starting address for the relayed transaction (should be the module)
    * @param _to The destination address for the relayed transaction (should be the wallet)
    * @param _value The value for the relayed transaction
    * @param _data The data for the relayed transaction
    * @param _nonce The nonce used to prevent replay attacks.
    * @param _gasPrice The gas price to use for the gas refund.
    * @param _gasLimit The gas limit to use for the gas refund.
    */
    function getSignHash(
        address _from,
        address _to, 
        uint256 _value, 
        bytes _data, 
        uint256 _nonce,
        uint256 _gasPrice,
        uint256 _gasLimit
    ) 
        internal 
        pure
        returns (bytes32) 
    {
        return keccak256(
            abi.encodePacked(
                "\x19Ethereum Signed Message:\n32",
                keccak256(abi.encodePacked(byte(0x19), byte(0), _from, _to, _value, _data, _nonce, _gasPrice, _gasLimit))
        ));
    }

    /**
    * @dev Checks if the relayed transaction is unique.
    * @param _wallet The target wallet.
    * @param _nonce The nonce
    * @param _signHash The signed hash of the transaction
    */
    function checkAndUpdateUniqueness(BaseWallet _wallet, uint256 _nonce, bytes32 _signHash) internal returns (bool) {
        if(relayer[_wallet].executedTx[_signHash] == true) {
            return false;
        }
        relayer[_wallet].executedTx[_signHash] = true;
        return true;
    }

    /**
    * @dev Checks that a nonce has the correct format and is valid. 
    * It must be constructed as nonce = {block number}{timestamp} where each component is 16 bytes.
    * @param _wallet The target wallet.
    * @param _nonce The nonce
    */
    function checkAndUpdateNonce(BaseWallet _wallet, uint256 _nonce) internal returns (bool) {
        if(_nonce <= relayer[_wallet].nonce) {
            return false;
        }   
        uint256 nonceBlock = (_nonce & 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000) >> 128;
        if(nonceBlock > block.number + BLOCKBOUND) {
            return false;
        }
        relayer[_wallet].nonce = _nonce;
        return true;    
    }

    /**
    * @dev Recovers the signer at a given position from a list of concatenated signatures.
    * @param _signedHash The signed hash
    * @param _signatures The concatenated signatures.
    * @param _index The index of the signature to recover.
    */
    function recoverSigner(bytes32 _signedHash, bytes _signatures, uint _index) internal pure returns (address) {
        uint8 v;
        bytes32 r;
        bytes32 s;
        // we jump 32 (0x20) as the first slot of bytes contains the length
        // we jump 65 (0x41) per signature
        // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            r := mload(add(_signatures, add(0x20,mul(0x41,_index))))
            s := mload(add(_signatures, add(0x40,mul(0x41,_index))))
            v := and(mload(add(_signatures, add(0x41,mul(0x41,_index)))), 0xff)
        }
        require(v == 27 || v == 28); 
        return ecrecover(_signedHash, v, r, s);
    }

    /**
    * @dev Refunds the gas used to the Relayer. 
    * For security reasons the default behavior is to not refund calls with 0 or 1 signatures. 
    * @param _wallet The target wallet.
    * @param _gasUsed The gas used.
    * @param _gasPrice The gas price for the refund.
    * @param _gasLimit The gas limit for the refund.
    * @param _signatures The number of signatures used in the call.
    * @param _relayer The address of the Relayer.
    */
    function refund(BaseWallet _wallet, uint _gasUsed, uint _gasPrice, uint _gasLimit, uint _signatures, address _relayer) internal {
        uint256 amount = 29292 + _gasUsed; // 21000 (transaction) + 7620 (execution of refund) + 672 to log the event + _gasUsed
        // only refund if gas price not null, more than 1 signatures, gas less than gasLimit
        if(_gasPrice > 0 && _signatures > 1 && amount <= _gasLimit) {
            if(_gasPrice > tx.gasprice) {
                amount = amount * tx.gasprice;
            }
            else {
                amount = amount * _gasPrice;
            }
            _wallet.invoke(_relayer, amount, "");
        }
    }

    /**
    * @dev Returns false if the refund is expected to fail.
    * @param _wallet The target wallet.
    * @param _gasUsed The expected gas used.
    * @param _gasPrice The expected gas price for the refund.
    */
    function verifyRefund(BaseWallet _wallet, uint _gasUsed, uint _gasPrice, uint _signatures) internal view returns (bool) {
        if(_gasPrice > 0 
            && _signatures > 1 
            && (address(_wallet).balance < _gasUsed * _gasPrice || _wallet.authorised(this) == false)) {
            return false;
        }
        return true;
    }

    /**
    * @dev Checks that the wallet address provided as the first parameter of the relayed data is the same
    * as the wallet passed as the input of the execute() method. 
    @return false if the addresses are different.
    */
    function verifyData(address _wallet, bytes _data) private pure returns (bool) {
        require(_data.length >= 36, "RM: Invalid dataWallet");
        address dataWallet;
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            //_data = {length:32}{sig:4}{_wallet:32}{...}
            dataWallet := mload(add(_data, 0x24))
        }
        return dataWallet == _wallet;
    }

    /**
    * @dev Parses the data to extract the method signature. 
    */
    function functionPrefix(bytes _data) internal pure returns (bytes4 prefix) {
        require(_data.length >= 4, "RM: Invalid functionPrefix");
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            prefix := mload(add(_data, 0x20))
        }
    }
}

/**
 * @title OnlyOwnerModule
 * @dev Module that extends BaseModule and RelayerModule for modules where the execute() method
 * must be called with one signature frm the owner.
 * @author Julien Niset - <[email protected]>
 */
contract OnlyOwnerModule is BaseModule, RelayerModule {

    // *************** Implementation of RelayerModule methods ********************* //

    // Overrides to use the incremental nonce and save some gas
    function checkAndUpdateUniqueness(BaseWallet _wallet, uint256 _nonce, bytes32 _signHash) internal returns (bool) {
        return checkAndUpdateNonce(_wallet, _nonce);
    }

    function validateSignatures(BaseWallet _wallet, bytes _data, bytes32 _signHash, bytes _signatures) internal view returns (bool) {
        address signer = recoverSigner(_signHash, _signatures, 0);
        return isOwner(_wallet, signer); // "OOM: signer must be owner"
    }

    function getRequiredSignatures(BaseWallet _wallet, bytes _data) internal view returns (uint256) {
        return 1;
    }
}

/**
 * ERC20 contract interface.
 */
contract ERC20 {
    function totalSupply() public view returns (uint);
    function decimals() public view returns (uint);
    function balanceOf(address tokenOwner) public view returns (uint balance);
    function allowance(address tokenOwner, address spender) public view returns (uint remaining);
    function transfer(address to, uint tokens) public returns (bool success);
    function approve(address spender, uint tokens) public returns (bool success);
    function transferFrom(address from, address to, uint tokens) public returns (bool success);
}

/**
 * @title Owned
 * @dev Basic contract to define an owner.
 * @author Julien Niset - <[email protected]>
 */
contract Owned {

    // The owner
    address public owner;

    event OwnerChanged(address indexed _newOwner);

    /**
     * @dev Throws if the sender is not the owner.
     */
    modifier onlyOwner {
        require(msg.sender == owner, "Must be owner");
        _;
    }

    constructor() public {
        owner = msg.sender;
    }

    /**
     * @dev Lets the owner transfer ownership of the contract to a new owner.
     * @param _newOwner The new owner.
     */
    function changeOwner(address _newOwner) external onlyOwner {
        require(_newOwner != address(0), "Address must not be null");
        owner = _newOwner;
        emit OwnerChanged(_newOwner);
    }
}

/**
 * @title ModuleRegistry
 * @dev Registry of authorised modules. 
 * Modules must be registered before they can be authorised on a wallet.
 * @author Julien Niset - <[email protected]>
 */
contract ModuleRegistry is Owned {

    mapping (address => Info) internal modules;
    mapping (address => Info) internal upgraders;

    event ModuleRegistered(address indexed module, bytes32 name);
    event ModuleDeRegistered(address module);
    event UpgraderRegistered(address indexed upgrader, bytes32 name);
    event UpgraderDeRegistered(address upgrader);

    struct Info {
        bool exists;
        bytes32 name;
    }

    /**
     * @dev Registers a module.
     * @param _module The module.
     * @param _name The unique name of the module.
     */
    function registerModule(address _module, bytes32 _name) external onlyOwner {
        require(!modules[_module].exists, "MR: module already exists");
        modules[_module] = Info({exists: true, name: _name});
        emit ModuleRegistered(_module, _name);
    }

    /**
     * @dev Deregisters a module.
     * @param _module The module.
     */
    function deregisterModule(address _module) external onlyOwner {
        require(modules[_module].exists, "MR: module does not exists");
        delete modules[_module];
        emit ModuleDeRegistered(_module);
    }

        /**
     * @dev Registers an upgrader.
     * @param _upgrader The upgrader.
     * @param _name The unique name of the upgrader.
     */
    function registerUpgrader(address _upgrader, bytes32 _name) external onlyOwner {
        require(!upgraders[_upgrader].exists, "MR: upgrader already exists");
        upgraders[_upgrader] = Info({exists: true, name: _name});
        emit UpgraderRegistered(_upgrader, _name);
    }

    /**
     * @dev Deregisters an upgrader.
     * @param _upgrader The _upgrader.
     */
    function deregisterUpgrader(address _upgrader) external onlyOwner {
        require(upgraders[_upgrader].exists, "MR: upgrader does not exists");
        delete upgraders[_upgrader];
        emit UpgraderDeRegistered(_upgrader);
    }

    /**
    * @dev Utility method enbaling the owner of the registry to claim any ERC20 token that was sent to the
    * registry.
    * @param _token The token to recover.
    */
    function recoverToken(address _token) external onlyOwner {
        uint total = ERC20(_token).balanceOf(address(this));
        ERC20(_token).transfer(msg.sender, total);
    } 

    /**
     * @dev Gets the name of a module from its address.
     * @param _module The module address.
     * @return the name.
     */
    function moduleInfo(address _module) external view returns (bytes32) {
        return modules[_module].name;
    }

    /**
     * @dev Gets the name of an upgrader from its address.
     * @param _upgrader The upgrader address.
     * @return the name.
     */
    function upgraderInfo(address _upgrader) external view returns (bytes32) {
        return upgraders[_upgrader].name;
    }

    /**
     * @dev Checks if a module is registered.
     * @param _module The module address.
     * @return true if the module is registered.
     */
    function isRegisteredModule(address _module) external view returns (bool) {
        return modules[_module].exists;
    }

    /**
     * @dev Checks if a list of modules are registered.
     * @param _modules The list of modules address.
     * @return true if all the modules are registered.
     */
    function isRegisteredModule(address[] _modules) external view returns (bool) {
        for(uint i = 0; i < _modules.length; i++) {
            if (!modules[_modules[i]].exists) {
                return false;
            }
        }
        return true;
    }  

    /**
     * @dev Checks if an upgrader is registered.
     * @param _upgrader The upgrader address.
     * @return true if the upgrader is registered.
     */
    function isRegisteredUpgrader(address _upgrader) external view returns (bool) {
        return upgraders[_upgrader].exists;
    } 
}

/**
 * @title BaseWallet
 * @dev Simple modular wallet that authorises modules to call its invoke() method.
 * Based on https://gist.github.com/Arachnid/a619d31f6d32757a4328a428286da186 by 
 * @author Julien Niset - <[email protected]>
 */
contract BaseWallet {

    // The implementation of the proxy
    address public implementation;
    // The owner 
    address public owner;
    // The authorised modules
    mapping (address => bool) public authorised;
    // The enabled static calls
    mapping (bytes4 => address) public enabled;
    // The number of modules
    uint public modules;
    
    event AuthorisedModule(address indexed module, bool value);
    event EnabledStaticCall(address indexed module, bytes4 indexed method);
    event Invoked(address indexed module, address indexed target, uint indexed value, bytes data);
    event Received(uint indexed value, address indexed sender, bytes data);
    event OwnerChanged(address owner);
    
    /**
     * @dev Throws if the sender is not an authorised module.
     */
    modifier moduleOnly {
        require(authorised[msg.sender], "BW: msg.sender not an authorized module");
        _;
    }

    /**
     * @dev Inits the wallet by setting the owner and authorising a list of modules.
     * @param _owner The owner.
     * @param _modules The modules to authorise.
     */
    function init(address _owner, address[] _modules) external {
        require(owner == address(0) && modules == 0, "BW: wallet already initialised");
        require(_modules.length > 0, "BW: construction requires at least 1 module");
        owner = _owner;
        modules = _modules.length;
        for(uint256 i = 0; i < _modules.length; i++) {
            require(authorised[_modules[i]] == false, "BW: module is already added");
            authorised[_modules[i]] = true;
            Module(_modules[i]).init(this);
            emit AuthorisedModule(_modules[i], true);
        }
    }
    
    /**
     * @dev Enables/Disables a module.
     * @param _module The target module.
     * @param _value Set to true to authorise the module.
     */
    function authoriseModule(address _module, bool _value) external moduleOnly {
        if (authorised[_module] != _value) {
            if(_value == true) {
                modules += 1;
                authorised[_module] = true;
                Module(_module).init(this);
            }
            else {
                modules -= 1;
                require(modules > 0, "BW: wallet must have at least one module");
                delete authorised[_module];
            }
            emit AuthorisedModule(_module, _value);
        }
    }

    /**
    * @dev Enables a static method by specifying the target module to which the call
    * must be delegated.
    * @param _module The target module.
    * @param _method The static method signature.
    */
    function enableStaticCall(address _module, bytes4 _method) external moduleOnly {
        require(authorised[_module], "BW: must be an authorised module for static call");
        enabled[_method] = _module;
        emit EnabledStaticCall(_module, _method);
    }

    /**
     * @dev Sets a new owner for the wallet.
     * @param _newOwner The new owner.
     */
    function setOwner(address _newOwner) external moduleOnly {
        require(_newOwner != address(0), "BW: address cannot be null");
        owner = _newOwner;
        emit OwnerChanged(_newOwner);
    }
    
    /**
     * @dev Performs a generic transaction.
     * @param _target The address for the transaction.
     * @param _value The value of the transaction.
     * @param _data The data of the transaction.
     */
    function invoke(address _target, uint _value, bytes _data) external moduleOnly {
        // solium-disable-next-line security/no-call-value
        require(_target.call.value(_value)(_data), "BW: call to target failed");
        emit Invoked(msg.sender, _target, _value, _data);
    }

    /**
     * @dev This method makes it possible for the wallet to comply to interfaces expecting the wallet to
     * implement specific static methods. It delegates the static call to a target contract if the data corresponds 
     * to an enabled method, or logs the call otherwise.
     */
    function() public payable {
        if(msg.data.length > 0) { 
            address module = enabled[msg.sig];
            if(module == address(0)) {
                emit Received(msg.value, msg.sender, msg.data);
            } 
            else {
                require(authorised[module], "BW: must be an authorised module for static call");
                // solium-disable-next-line security/no-inline-assembly
                assembly {
                    calldatacopy(0, 0, calldatasize())
                    let result := staticcall(gas, module, 0, calldatasize(), 0, 0)
                    returndatacopy(0, 0, returndatasize())
                    switch result 
                    case 0 {revert(0, returndatasize())} 
                    default {return (0, returndatasize())}
                }
            }
        }
    }
}

/* The MIT License (MIT)

Copyright (c) 2016 Smart Contract Solutions, Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

    /**
    * @dev Multiplies two numbers, reverts on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
    * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0); // Solidity only automatically asserts when dividing by 0
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
    * @dev Adds two numbers, reverts on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
    * @dev Divides two numbers and returns the remainder (unsigned integer modulo),
    * reverts when dividing by zero.
    */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }

    /**
    * @dev Returns ceil(a / b).
    */
    function ceil(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a / b;
        if(a % b == 0) {
            return c;
        }
        else {
            return c + 1;
        }
    }
}

contract KyberNetwork {

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

    function trade(
        ERC20 src,
        uint srcAmount,
        ERC20 dest,
        address destAddress,
        uint maxDestAmount,
        uint minConversionRate,
        address walletId
    )
        public
        payable
        returns(uint);
}

/**
 * @title Storage
 * @dev Base contract for the storage of a wallet.
 * @author Julien Niset - <[email protected]>
 */
contract Storage {

    /**
     * @dev Throws if the caller is not an authorised module.
     */
    modifier onlyModule(BaseWallet _wallet) {
        require(_wallet.authorised(msg.sender), "TS: must be an authorized module to call this method");
        _;
    }
}

/**
 * @title GuardianStorage
 * @dev Contract storing the state of wallets related to guardians and lock.
 * The contract only defines basic setters and getters with no logic. Only modules authorised
 * for a wallet can modify its state.
 * @author Julien Niset - <[email protected]>
 * @author Olivier Van Den Biggelaar - <[email protected]>
 */
contract GuardianStorage is Storage {

    struct GuardianStorageConfig {
        // the list of guardians
        address[] guardians;
        // the info about guardians
        mapping (address => GuardianInfo) info;
        // the lock's release timestamp
        uint256 lock; 
        // the module that set the last lock
        address locker;
    }

    struct GuardianInfo {
        bool exists;
        uint128 index;
    }

    // wallet specific storage
    mapping (address => GuardianStorageConfig) internal configs;

    // *************** External Functions ********************* //

    /**
     * @dev Lets an authorised module add a guardian to a wallet.
     * @param _wallet The target wallet.
     * @param _guardian The guardian to add.
     */
    function addGuardian(BaseWallet _wallet, address _guardian) external onlyModule(_wallet) {
        GuardianStorageConfig storage config = configs[_wallet];
        config.info[_guardian].exists = true;
        config.info[_guardian].index = uint128(config.guardians.push(_guardian) - 1);
    }

    /**
     * @dev Lets an authorised module revoke a guardian from a wallet.
     * @param _wallet The target wallet.
     * @param _guardian The guardian to revoke.
     */
    function revokeGuardian(BaseWallet _wallet, address _guardian) external onlyModule(_wallet) {
        GuardianStorageConfig storage config = configs[_wallet];
        address lastGuardian = config.guardians[config.guardians.length - 1];
        if (_guardian != lastGuardian) {
            uint128 targetIndex = config.info[_guardian].index;
            config.guardians[targetIndex] = lastGuardian;
            config.info[lastGuardian].index = targetIndex;
        }
        config.guardians.length--;
        delete config.info[_guardian];
    }

    /**
     * @dev Returns the number of guardians for a wallet.
     * @param _wallet The target wallet.
     * @return the number of guardians.
     */
    function guardianCount(BaseWallet _wallet) external view returns (uint256) {
        return configs[_wallet].guardians.length;
    }
    
    /**
     * @dev Gets the list of guaridans for a wallet.
     * @param _wallet The target wallet.
     * @return the list of guardians.
     */
    function getGuardians(BaseWallet _wallet) external view returns (address[]) {
        GuardianStorageConfig storage config = configs[_wallet];
        address[] memory guardians = new address[](config.guardians.length);
        for (uint256 i = 0; i < config.guardians.length; i++) {
            guardians[i] = config.guardians[i];
        }
        return guardians;
    }

    /**
     * @dev Checks if an account is a guardian for a wallet.
     * @param _wallet The target wallet.
     * @param _guardian The account.
     * @return true if the account is a guardian for a wallet.
     */
    function isGuardian(BaseWallet _wallet, address _guardian) external view returns (bool) {
        return configs[_wallet].info[_guardian].exists;
    }

    /**
     * @dev Lets an authorised module set the lock for a wallet.
     * @param _wallet The target wallet.
     * @param _releaseAfter The epoch time at which the lock should automatically release.
     */
    function setLock(BaseWallet _wallet, uint256 _releaseAfter) external onlyModule(_wallet) {
        configs[_wallet].lock = _releaseAfter;
        if(_releaseAfter != 0 && msg.sender != configs[_wallet].locker) {
            configs[_wallet].locker = msg.sender;
        }
    }

    /**
     * @dev Checks if the lock is set for a wallet.
     * @param _wallet The target wallet.
     * @return true if the lock is set for the wallet.
     */
    function isLocked(BaseWallet _wallet) external view returns (bool) {
        return configs[_wallet].lock > now;
    }

    /**
     * @dev Gets the time at which the lock of a wallet will release.
     * @param _wallet The target wallet.
     * @return the time at which the lock of a wallet will release, or zero if there is no lock set.
     */
    function getLock(BaseWallet _wallet) external view returns (uint256) {
        return configs[_wallet].lock;
    }

    /**
     * @dev Gets the address of the last module that modified the lock for a wallet.
     * @param _wallet The target wallet.
     * @return the address of the last module that modified the lock for a wallet.
     */
    function getLocker(BaseWallet _wallet) external view returns (address) {
        return configs[_wallet].locker;
    }
}

/**
 * @title TokenExchanger
 * @dev Module to trade tokens (ETH or ERC20) using KyberNetworks.
 * @author Julien Niset - <[email protected]>
 */
contract TokenExchanger is BaseModule, RelayerModule, OnlyOwnerModule {

    bytes32 constant NAME = "TokenExchanger";

    using SafeMath for uint256;

    // Mock token address for ETH
    address constant internal ETH_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    // The address of the KyberNetwork proxy contract
    address public kyber;
    // The address of the contract collecting fees for Argent.
    address public feeCollector;
    // The Argent fee in 1-per-10000.
    uint256 public feeRatio;
    // The Guardian storage 
    GuardianStorage public guardianStorage;

    event TokenExchanged(address indexed wallet, address srcToken, uint srcAmount, address destToken, uint destAmount);

    /**
     * @dev Throws if the wallet is locked.
     */
    modifier onlyWhenUnlocked(BaseWallet _wallet) {
        // solium-disable-next-line security/no-block-members
        require(!guardianStorage.isLocked(_wallet), "TT: wallet must be unlocked");
        _;
    }

    constructor(
        ModuleRegistry _registry, 
        GuardianStorage _guardianStorage, 
        address _kyber, 
        address _feeCollector, 
        uint _feeRatio
    ) 
        BaseModule(_registry, NAME) 
        public 
    {
        kyber = _kyber;
        feeCollector = _feeCollector;
        feeRatio = _feeRatio;
        guardianStorage = _guardianStorage;
    }

    /**
     * @dev Lets the owner of the wallet execute a trade.
     * @param _wallet The target wallet
     * @param _srcToken The address of the source token.
     * @param _srcAmount The amoutn of source token to trade.
     * @param _destToken The address of the destination token.
     * @param _maxDestAmount The maximum amount of destination token accepted for the trade.
     * @param _minConversionRate The minimum accepted rate for the trade.
     * @return The amount of destination tokens that have been received.
     */
    function trade(
        BaseWallet _wallet,
        address _srcToken,
        uint256 _srcAmount,
        address _destToken,
        uint256 _maxDestAmount,
        uint256 _minConversionRate
    )
        external 
        onlyOwner(_wallet)
        onlyWhenUnlocked(_wallet)
        returns(uint256)
    {    
        bytes memory methodData;
        require(_srcToken == ETH_TOKEN_ADDRESS || _destToken == ETH_TOKEN_ADDRESS, "TE: source or destination must be ETH");
        (uint256 destAmount, uint256 fee, ) = getExpectedTrade(_srcToken, _destToken, _srcAmount);
        if(destAmount > _maxDestAmount) {
            fee = fee.mul(_maxDestAmount).div(destAmount);
            destAmount = _maxDestAmount;
        }
        if(_srcToken == ETH_TOKEN_ADDRESS) {
            uint256 srcTradable = _srcAmount.sub(fee);
            methodData = abi.encodeWithSignature(
                "trade(address,uint256,address,address,uint256,uint256,address)", 
                _srcToken, 
                srcTradable,
                _destToken,
                address(_wallet),
                _maxDestAmount,
                _minConversionRate,
                feeCollector
                );
            _wallet.invoke(kyber, srcTradable, methodData);
        }
        else {
            // approve kyber on erc20 
            methodData = abi.encodeWithSignature("approve(address,uint256)", kyber, _srcAmount);
            _wallet.invoke(_srcToken, 0, methodData);
            // transfer erc20
            methodData = abi.encodeWithSignature(
                "trade(address,uint256,address,address,uint256,uint256,address)", 
                _srcToken, 
                _srcAmount,
                _destToken,
                address(_wallet),
                _maxDestAmount,
                _minConversionRate,
                feeCollector
                );
            _wallet.invoke(kyber, 0, methodData);
        }

        if (fee > 0) {
            _wallet.invoke(feeCollector, fee, "");
        }
        emit TokenExchanged(_wallet, _srcToken, _srcAmount, _destToken, destAmount);
        return destAmount;
    }

    /**
     * @dev Gets the expected terms of a trade.
     * @param _srcToken The address of the source token.
     * @param _destToken The address of the destination token.
     * @param _srcAmount The amount of source token to trade.
     * @return the amount of destination tokens to be received and the amount of ETH paid to Argent as fee.
     */
    function getExpectedTrade(
        address _srcToken,
        address _destToken,
        uint256 _srcAmount
    )
        public
        view
        returns(uint256 _destAmount, uint256 _fee, uint256 _expectedRate)
    {
        if(_srcToken == ETH_TOKEN_ADDRESS) {
            _fee = computeFee(_srcAmount);
            (_expectedRate,) = KyberNetwork(kyber).getExpectedRate(ERC20(_srcToken), ERC20(_destToken), _srcAmount.sub(_fee));  
            uint256 destDecimals = ERC20(_destToken).decimals();
            // destAmount = expectedRate * (_srcAmount - fee) / ETH_PRECISION * (DEST_PRECISION / SRC_PRECISION)
            _destAmount = _expectedRate.mul(_srcAmount.sub(_fee)).div(10 ** (36-destDecimals));
        }
        else {
            (_expectedRate,) = KyberNetwork(kyber).getExpectedRate(ERC20(_srcToken), ERC20(_destToken), _srcAmount);
            uint256 srcDecimals = ERC20(_srcToken).decimals();
            // destAmount = expectedRate * _srcAmount / ETH_PRECISION * (DEST_PRECISION / SRC_PRECISION) - fee
            _destAmount = _expectedRate.mul(_srcAmount).div(10 ** srcDecimals);
            _fee = computeFee(_destAmount);
            _destAmount -= _fee;
        }
    }

    /**
     * @dev Computes the Argent fee based on the amount of source tokens in ETH.
     * @param _srcAmount The amount of source token to trade in ETH.
     * @return the fee paid to Argent.
     */
    function computeFee(uint256 _srcAmount) internal view returns (uint256 fee) {
        fee = (_srcAmount * feeRatio) / 10000;
    }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_wallet","type":"address"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_wallet","type":"address"}],"name":"getNonce","outputs":[{"name":"nonce","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_wallet","type":"address"},{"name":"_srcToken","type":"address"},{"name":"_srcAmount","type":"uint256"},{"name":"_destToken","type":"address"},{"name":"_maxDestAmount","type":"uint256"},{"name":"_minConversionRate","type":"uint256"}],"name":"trade","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"feeRatio","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_wallet","type":"address"},{"name":"_module","type":"address"}],"name":"addModule","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_srcToken","type":"address"},{"name":"_destToken","type":"address"},{"name":"_srcAmount","type":"uint256"}],"name":"getExpectedTrade","outputs":[{"name":"_destAmount","type":"uint256"},{"name":"_fee","type":"uint256"},{"name":"_expectedRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"recoverToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kyber","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_wallet","type":"address"},{"name":"_data","type":"bytes"},{"name":"_nonce","type":"uint256"},{"name":"_signatures","type":"bytes"},{"name":"_gasPrice","type":"uint256"},{"name":"_gasLimit","type":"uint256"}],"name":"execute","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"feeCollector","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"relayer","outputs":[{"name":"nonce","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"guardianStorage","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_registry","type":"address"},{"name":"_guardianStorage","type":"address"},{"name":"_kyber","type":"address"},{"name":"_feeCollector","type":"address"},{"name":"_feeRatio","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"wallet","type":"address"},{"indexed":false,"name":"srcToken","type":"address"},{"indexed":false,"name":"srcAmount","type":"uint256"},{"indexed":false,"name":"destToken","type":"address"},{"indexed":false,"name":"destAmount","type":"uint256"}],"name":"TokenExchanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"wallet","type":"address"},{"indexed":true,"name":"success","type":"bool"},{"indexed":false,"name":"signedHash","type":"bytes32"}],"name":"TransactionExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"bytes32"}],"name":"ModuleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"wallet","type":"address"}],"name":"ModuleInitialised","type":"event"}]

608060405234801561001057600080fd5b5060405160a080611fcb833981016040818152825160208085015183860151606087015160809097015160008054600160a060020a031916600160a060020a0387161790557f546f6b656e45786368616e6765720000000000000000000000000000000000008088529551949792969195929490938893927f3019c8fc80239e3dff8f781212ae2004839c2cb61d6c70acd279ac65392145df929081900390910190a1505060028054600160a060020a03948516600160a060020a03199182161790915560038054938516938216939093179092556004556005805493909216921691909117905550611ec3806101086000396000f3006080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166319ab453c81146100be5780632d0335ab146100e15780632d8da11a1461011457806341744dd41461014b5780635a1db8c4146101605780636b5ad723146101875780639be65a60146101cf578063a2d10ba5146101f0578063aacaaf8814610221578063c415b95c14610278578063c9b5ef8e1461028d578063d89784fc146102ae575b600080fd5b3480156100ca57600080fd5b506100df600160a060020a03600435166102c3565b005b3480156100ed57600080fd5b50610102600160a060020a036004351661037b565b60408051918252519081900360200190f35b34801561012057600080fd5b50610102600160a060020a03600435811690602435811690604435906064351660843560a435610396565b34801561015757600080fd5b50610102610e08565b34801561016c57600080fd5b506100df600160a060020a0360043581169060243516610e0e565b34801561019357600080fd5b506101b1600160a060020a0360043581169060243516604435611038565b60408051938452602084019290925282820152519081900360600190f35b3480156101db57600080fd5b506100df600160a060020a0360043516611348565b3480156101fc57600080fd5b5061020561147c565b60408051600160a060020a039092168252519081900360200190f35b34801561022d57600080fd5b5061026460048035600160a060020a031690602480358082019290810135916044359160643591820191013560843560a43561148b565b604080519115158252519081900360200190f35b34801561028457600080fd5b506102056117a9565b34801561029957600080fd5b50610102600160a060020a03600435166117b8565b3480156102ba57600080fd5b506102056117ca565b8033600160a060020a0382161461033b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f424d3a2063616c6c6572206d7573742062652077616c6c657400000000000000604482015290519081900360640190fd5b60408051600160a060020a038416815290517f9fcca3f73f85397e2bf03647abf243c20b753bd54463ff3cae74de2971c112fa9181900360200190a15050565b600160a060020a031660009081526001602052604090205490565b600060608180808a333014806103b157506103b181336117d9565b151561044457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f424d3a206d75737420626520616e206f776e657220666f72207468652077616c60448201527f6c65740000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8b600560009054906101000a9004600160a060020a0316600160a060020a0316634a4fbeec826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156104ce57600080fd5b505af11580156104e2573d6000803e3d6000fd5b505050506040513d60208110156104f857600080fd5b50511561056657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f54543a2077616c6c6574206d75737420626520756e6c6f636b65640000000000604482015290519081900360640190fd5b600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14806105ad5750600160a060020a038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b151561064057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f54453a20736f75726365206f722064657374696e6174696f6e206d757374206260448201527f6520455448000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61064b8c8b8d611038565b50945094508885111561067e576106788561066c868c63ffffffff61187916565b9063ffffffff6118b216565b93508894505b600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156108ea576106b38b8563ffffffff6118d516565b92508b838b8f8c8c600360009054906101000a9004600160a060020a03166040516024018088600160a060020a0316600160a060020a0316815260200187815260200186600160a060020a0316600160a060020a0316815260200185600160a060020a0316600160a060020a0316815260200184815260200183815260200182600160a060020a0316600160a060020a031681526020019750505050505050506040516020818303038152906040527fcb3c28c7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f0332600260009054906101000a9004600160a060020a031685896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561087f578181015183820152602001610867565b50505050905090810190601f1680156108ac5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b50505050610cda565b600260009054906101000a9004600160a060020a03168b6040516024018083600160a060020a0316600160a060020a03168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f03328d6000896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a42578181015183820152602001610a2a565b50505050905090810190601f168015610a6f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b505050508b8b8b8f8c8c600360009054906101000a9004600160a060020a03166040516024018088600160a060020a0316600160a060020a0316815260200187815260200186600160a060020a0316600160a060020a0316815260200185600160a060020a0316600160a060020a0316815260200184815260200183815260200182600160a060020a0316600160a060020a031681526020019750505050505050506040516020818303038152906040527fcb3c28c7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f0332600260009054906101000a9004600160a060020a03166000896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c73578181015183820152602001610c5b565b50505050905090810190601f168015610ca05780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b505050505b6000841115610da1578c600160a060020a0316638f6f0332600360009054906101000a9004600160a060020a0316866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a03168152602001828152602001806020018281038252600081526020016020019350505050600060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b505050505b60408051600160a060020a038e81168252602082018e90528c811682840152606082018890529151918f16917fc8082d818d67bbb0b463bdaa897d7363157a1425f6b077691285ac6ca82b60b19181900360800190a250929b9a5050505050505050505050565b60045481565b81610e1981336117d9565b1515610eac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f424d3a206d73672e73656e646572206d75737420626520616e206f776e65722060448201527f666f72207468652077616c6c6574000000000000000000000000000000000000606482015290519081900360840190fd5b60008054604080517f0bcd4ebb000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015291519190921692630bcd4ebb92602480820193602093909283900390910190829087803b158015610f1757600080fd5b505af1158015610f2b573d6000803e3d6000fd5b505050506040513d6020811015610f4157600080fd5b50511515610fb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f424d3a206d6f64756c65206973206e6f74207265676973746572656400000000604482015290519081900360640190fd5b604080517f1f17732d000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260016024830152915191851691631f17732d9160448082019260009290919082900301818387803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050505050565b600080808080600160a060020a03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156111e65761106c866118ec565b600254909450600160a060020a031663809a9e5589896110928a8963ffffffff6118d516565b604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8716028152600160a060020a03948516600482015292909316602483015260448201528151606480830193928290030181600087803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b505050506040513d604081101561112557600080fd5b5051604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051919450600160a060020a0389169163313ce567916004808201926020929091908290030181600087803b15801561118657600080fd5b505af115801561119a573d6000803e3d6000fd5b505050506040513d60208110156111b057600080fd5b505191506111df6024839003600a0a61066c6111d2898863ffffffff6118d516565b869063ffffffff61187916565b945061133d565b600254604080517f809a9e55000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a9052825193169263809a9e55926064808401939192918290030181600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b505050506040513d604081101561128357600080fd5b5051604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051919450600160a060020a038a169163313ce567916004808201926020929091908290030181600087803b1580156112e457600080fd5b505af11580156112f8573d6000803e3d6000fd5b505050506040513d602081101561130e57600080fd5b5051905061132a600a82900a61066c858963ffffffff61187916565b9450611335856118ec565b935083850394505b505093509350939050565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038416916370a082319160248082019260209290919082900301818787803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506040513d60208110156113d657600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b505050506040513d602081101561147657600080fd5b50505050565b600254600160a060020a031681565b6000806000805a92506114d6308d60008e8e8080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508d8b8b6118f8565b91506114e38c8a84611aec565b151561155057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f524d3a204475706c696361746520726571756573740000000000000000000000604482015290519081900360640190fd5b61158a8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b00945050505050565b151561164357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524d3a207468652077616c6c657420617574686f72697a65642069732064696660448201527f666572656e74207468656e2074686520746172676574206f662074686520726560648201527f6c61796564206461746100000000000000000000000000000000000000000000608482015290519081900360a40190fd5b61167d8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b8d945050505050565b905060418102871415611758576116968c868884611b95565b156117585780158061171157506117118c8c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050848b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c69945050505050565b156117585730600160a060020a03168b8b604051808383808284378201915050925050506000604051808303816000865af191505093506117588c5a850388888533611c8e565b60408051838152905185151591600160a060020a038f16917f6bb0b384ce772133df63560651bc8c727c53306cec1d51e2cbf8ea35fb8f2ec19181900360200190a350505098975050505050505050565b600354600160a060020a031681565b60016020526000908152604090205481565b600554600160a060020a031681565b600081600160a060020a031683600160a060020a0316638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d602081101561186657600080fd5b5051600160a060020a0316149392505050565b60008083151561188c57600091506118ab565b5082820282848281151561189c57fe5b04146118a757600080fd5b8091505b5092915050565b6000808083116118c157600080fd5b82848115156118cc57fe5b04949350505050565b600080838311156118e557600080fd5b5050900390565b60045461271091020490565b6040517f190000000000000000000000000000000000000000000000000000000000000060208083018281526000602185018190526c01000000000000000000000000600160a060020a03808e16820260228801528c16026036860152604a85018a90528851909485938d938d938d938d938d938d938d939192606a909201918701908083835b6020831061199e5780518252601f19909201916020918201910161197f565b6001836020036101000a03801982511681845116808217855250505050505090500184815260200183815260200182815260200199505050505050505050506040516020818303038152906040526040518082805190602001908083835b60208310611a1b5780518252601f1990920191602091820191016119fc565b51815160209384036101000a6000190180199092169116179052604080519290940182900382207f19457468657265756d205369676e6564204d6573736167653a0a33320000000083830152603c8084019190915284518084039091018152605c9092019384905281519195509293508392850191508083835b60208310611ab45780518252601f199092019160209182019101611a95565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209b9a5050505050505050505050565b6000611af88484611d5d565b949350505050565b6000806024835110151515611b7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f524d3a20496e76616c6964206461746157616c6c657400000000000000000000604482015290519081900360640190fd5b505060240151600160a060020a0390811691161490565b600192915050565b60008083118015611ba65750600182115b8015611c51575082840285600160a060020a0316311080611c515750604080517fd6eb1bbf0000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0387169163d6eb1bbf9160248083019260209291908290030181600087803b158015611c2357600080fd5b505af1158015611c37573d6000803e3d6000fd5b505050506040513d6020811015611c4d57600080fd5b5051155b15611c5e57506000611af8565b506001949350505050565b600080611c7884846000611dea565b9050611c8486826117d9565b9695505050505050565b61726c8501600085118015611ca35750600183115b8015611caf5750838111155b1561102f573a851115611cc3573a02611cc6565b84025b604080517f8f6f0332000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052606060448301526000606483018190529251908a1692638f6f03329260a4808201939182900301818387803b158015611d3c57600080fd5b505af1158015611d50573d6000803e3d6000fd5b5050505050505050505050565b600160a060020a03821660009081526001602052604081205481908311611d8757600091506118ab565b507001000000000000000000000000000000006fffffffffffffffffffffffffffffffff198316044361271001811115611dc457600091506118ab565b5050600160a060020a039190911660009081526001602081905260409091209190915590565b6041808202830160208101516040820151919092015160009260ff9190911691601b831480611e1c57508260ff16601c145b1515611e2757600080fd5b60408051600080825260208083018085528b905260ff8716838501526060830186905260808301859052925160019360a0808501949193601f19840193928390039091019190865af1158015611e81573d6000803e3d6000fd5b5050604051601f190151989750505050505050505600a165627a7a72305820d70bac8b54c65915c749ff37148443ea96e6ec56e2c34d250083a98f107fa11b0029000000000000000000000000c17d432bd8e8850fd7b32b0270f5afac65db010500000000000000000000000044da3a8051ba88eab0440db3779cab9d679ae76f000000000000000000000000818e6fecd516ecc3849daf6845e3ec868087b755000000000000000000000000a5c603e1c27a96171487aea0649b01c56248d2e8000000000000000000000000000000000000000000000000000000000000000f

Deployed Bytecode

0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166319ab453c81146100be5780632d0335ab146100e15780632d8da11a1461011457806341744dd41461014b5780635a1db8c4146101605780636b5ad723146101875780639be65a60146101cf578063a2d10ba5146101f0578063aacaaf8814610221578063c415b95c14610278578063c9b5ef8e1461028d578063d89784fc146102ae575b600080fd5b3480156100ca57600080fd5b506100df600160a060020a03600435166102c3565b005b3480156100ed57600080fd5b50610102600160a060020a036004351661037b565b60408051918252519081900360200190f35b34801561012057600080fd5b50610102600160a060020a03600435811690602435811690604435906064351660843560a435610396565b34801561015757600080fd5b50610102610e08565b34801561016c57600080fd5b506100df600160a060020a0360043581169060243516610e0e565b34801561019357600080fd5b506101b1600160a060020a0360043581169060243516604435611038565b60408051938452602084019290925282820152519081900360600190f35b3480156101db57600080fd5b506100df600160a060020a0360043516611348565b3480156101fc57600080fd5b5061020561147c565b60408051600160a060020a039092168252519081900360200190f35b34801561022d57600080fd5b5061026460048035600160a060020a031690602480358082019290810135916044359160643591820191013560843560a43561148b565b604080519115158252519081900360200190f35b34801561028457600080fd5b506102056117a9565b34801561029957600080fd5b50610102600160a060020a03600435166117b8565b3480156102ba57600080fd5b506102056117ca565b8033600160a060020a0382161461033b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f424d3a2063616c6c6572206d7573742062652077616c6c657400000000000000604482015290519081900360640190fd5b60408051600160a060020a038416815290517f9fcca3f73f85397e2bf03647abf243c20b753bd54463ff3cae74de2971c112fa9181900360200190a15050565b600160a060020a031660009081526001602052604090205490565b600060608180808a333014806103b157506103b181336117d9565b151561044457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f424d3a206d75737420626520616e206f776e657220666f72207468652077616c60448201527f6c65740000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8b600560009054906101000a9004600160a060020a0316600160a060020a0316634a4fbeec826040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156104ce57600080fd5b505af11580156104e2573d6000803e3d6000fd5b505050506040513d60208110156104f857600080fd5b50511561056657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f54543a2077616c6c6574206d75737420626520756e6c6f636b65640000000000604482015290519081900360640190fd5b600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14806105ad5750600160a060020a038a1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee145b151561064057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f54453a20736f75726365206f722064657374696e6174696f6e206d757374206260448201527f6520455448000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61064b8c8b8d611038565b50945094508885111561067e576106788561066c868c63ffffffff61187916565b9063ffffffff6118b216565b93508894505b600160a060020a038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156108ea576106b38b8563ffffffff6118d516565b92508b838b8f8c8c600360009054906101000a9004600160a060020a03166040516024018088600160a060020a0316600160a060020a0316815260200187815260200186600160a060020a0316600160a060020a0316815260200185600160a060020a0316600160a060020a0316815260200184815260200183815260200182600160a060020a0316600160a060020a031681526020019750505050505050506040516020818303038152906040527fcb3c28c7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f0332600260009054906101000a9004600160a060020a031685896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561087f578181015183820152602001610867565b50505050905090810190601f1680156108ac5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b50505050610cda565b600260009054906101000a9004600160a060020a03168b6040516024018083600160a060020a0316600160a060020a03168152602001828152602001925050506040516020818303038152906040527f095ea7b3000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f03328d6000896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a42578181015183820152602001610a2a565b50505050905090810190601f168015610a6f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610a9057600080fd5b505af1158015610aa4573d6000803e3d6000fd5b505050508b8b8b8f8c8c600360009054906101000a9004600160a060020a03166040516024018088600160a060020a0316600160a060020a0316815260200187815260200186600160a060020a0316600160a060020a0316815260200185600160a060020a0316600160a060020a0316815260200184815260200183815260200182600160a060020a0316600160a060020a031681526020019750505050505050506040516020818303038152906040527fcb3c28c7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505095508c600160a060020a0316638f6f0332600260009054906101000a9004600160a060020a03166000896040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c73578181015183820152602001610c5b565b50505050905090810190601f168015610ca05780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b505050505b6000841115610da1578c600160a060020a0316638f6f0332600360009054906101000a9004600160a060020a0316866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a03168152602001828152602001806020018281038252600081526020016020019350505050600060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b505050505b60408051600160a060020a038e81168252602082018e90528c811682840152606082018890529151918f16917fc8082d818d67bbb0b463bdaa897d7363157a1425f6b077691285ac6ca82b60b19181900360800190a250929b9a5050505050505050505050565b60045481565b81610e1981336117d9565b1515610eac57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f424d3a206d73672e73656e646572206d75737420626520616e206f776e65722060448201527f666f72207468652077616c6c6574000000000000000000000000000000000000606482015290519081900360840190fd5b60008054604080517f0bcd4ebb000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015291519190921692630bcd4ebb92602480820193602093909283900390910190829087803b158015610f1757600080fd5b505af1158015610f2b573d6000803e3d6000fd5b505050506040513d6020811015610f4157600080fd5b50511515610fb057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f424d3a206d6f64756c65206973206e6f74207265676973746572656400000000604482015290519081900360640190fd5b604080517f1f17732d000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260016024830152915191851691631f17732d9160448082019260009290919082900301818387803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050505050565b600080808080600160a060020a03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156111e65761106c866118ec565b600254909450600160a060020a031663809a9e5589896110928a8963ffffffff6118d516565b604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8716028152600160a060020a03948516600482015292909316602483015260448201528151606480830193928290030181600087803b1580156110fb57600080fd5b505af115801561110f573d6000803e3d6000fd5b505050506040513d604081101561112557600080fd5b5051604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051919450600160a060020a0389169163313ce567916004808201926020929091908290030181600087803b15801561118657600080fd5b505af115801561119a573d6000803e3d6000fd5b505050506040513d60208110156111b057600080fd5b505191506111df6024839003600a0a61066c6111d2898863ffffffff6118d516565b869063ffffffff61187916565b945061133d565b600254604080517f809a9e55000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a9052825193169263809a9e55926064808401939192918290030181600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b505050506040513d604081101561128357600080fd5b5051604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051919450600160a060020a038a169163313ce567916004808201926020929091908290030181600087803b1580156112e457600080fd5b505af11580156112f8573d6000803e3d6000fd5b505050506040513d602081101561130e57600080fd5b5051905061132a600a82900a61066c858963ffffffff61187916565b9450611335856118ec565b935083850394505b505093509350939050565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038416916370a082319160248082019260209290919082900301818787803b1580156113ac57600080fd5b505af11580156113c0573d6000803e3d6000fd5b505050506040513d60208110156113d657600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b505050506040513d602081101561147657600080fd5b50505050565b600254600160a060020a031681565b6000806000805a92506114d6308d60008e8e8080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508d8b8b6118f8565b91506114e38c8a84611aec565b151561155057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f524d3a204475706c696361746520726571756573740000000000000000000000604482015290519081900360640190fd5b61158a8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b00945050505050565b151561164357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524d3a207468652077616c6c657420617574686f72697a65642069732064696660448201527f666572656e74207468656e2074686520746172676574206f662074686520726560648201527f6c61796564206461746100000000000000000000000000000000000000000000608482015290519081900360a40190fd5b61167d8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611b8d945050505050565b905060418102871415611758576116968c868884611b95565b156117585780158061171157506117118c8c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050848b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843750611c69945050505050565b156117585730600160a060020a03168b8b604051808383808284378201915050925050506000604051808303816000865af191505093506117588c5a850388888533611c8e565b60408051838152905185151591600160a060020a038f16917f6bb0b384ce772133df63560651bc8c727c53306cec1d51e2cbf8ea35fb8f2ec19181900360200190a350505098975050505050505050565b600354600160a060020a031681565b60016020526000908152604090205481565b600554600160a060020a031681565b600081600160a060020a031683600160a060020a0316638da5cb5b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b505050506040513d602081101561186657600080fd5b5051600160a060020a0316149392505050565b60008083151561188c57600091506118ab565b5082820282848281151561189c57fe5b04146118a757600080fd5b8091505b5092915050565b6000808083116118c157600080fd5b82848115156118cc57fe5b04949350505050565b600080838311156118e557600080fd5b5050900390565b60045461271091020490565b6040517f190000000000000000000000000000000000000000000000000000000000000060208083018281526000602185018190526c01000000000000000000000000600160a060020a03808e16820260228801528c16026036860152604a85018a90528851909485938d938d938d938d938d938d938d939192606a909201918701908083835b6020831061199e5780518252601f19909201916020918201910161197f565b6001836020036101000a03801982511681845116808217855250505050505090500184815260200183815260200182815260200199505050505050505050506040516020818303038152906040526040518082805190602001908083835b60208310611a1b5780518252601f1990920191602091820191016119fc565b51815160209384036101000a6000190180199092169116179052604080519290940182900382207f19457468657265756d205369676e6564204d6573736167653a0a33320000000083830152603c8084019190915284518084039091018152605c9092019384905281519195509293508392850191508083835b60208310611ab45780518252601f199092019160209182019101611a95565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209b9a5050505050505050505050565b6000611af88484611d5d565b949350505050565b6000806024835110151515611b7657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f524d3a20496e76616c6964206461746157616c6c657400000000000000000000604482015290519081900360640190fd5b505060240151600160a060020a0390811691161490565b600192915050565b60008083118015611ba65750600182115b8015611c51575082840285600160a060020a0316311080611c515750604080517fd6eb1bbf0000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0387169163d6eb1bbf9160248083019260209291908290030181600087803b158015611c2357600080fd5b505af1158015611c37573d6000803e3d6000fd5b505050506040513d6020811015611c4d57600080fd5b5051155b15611c5e57506000611af8565b506001949350505050565b600080611c7884846000611dea565b9050611c8486826117d9565b9695505050505050565b61726c8501600085118015611ca35750600183115b8015611caf5750838111155b1561102f573a851115611cc3573a02611cc6565b84025b604080517f8f6f0332000000000000000000000000000000000000000000000000000000008152600160a060020a03848116600483015260248201849052606060448301526000606483018190529251908a1692638f6f03329260a4808201939182900301818387803b158015611d3c57600080fd5b505af1158015611d50573d6000803e3d6000fd5b5050505050505050505050565b600160a060020a03821660009081526001602052604081205481908311611d8757600091506118ab565b507001000000000000000000000000000000006fffffffffffffffffffffffffffffffff198316044361271001811115611dc457600091506118ab565b5050600160a060020a039190911660009081526001602081905260409091209190915590565b6041808202830160208101516040820151919092015160009260ff9190911691601b831480611e1c57508260ff16601c145b1515611e2757600080fd5b60408051600080825260208083018085528b905260ff8716838501526060830186905260808301859052925160019360a0808501949193601f19840193928390039091019190865af1158015611e81573d6000803e3d6000fd5b5050604051601f190151989750505050505050505600a165627a7a72305820d70bac8b54c65915c749ff37148443ea96e6ec56e2c34d250083a98f107fa11b0029

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

000000000000000000000000c17d432bd8e8850fd7b32b0270f5afac65db010500000000000000000000000044da3a8051ba88eab0440db3779cab9d679ae76f000000000000000000000000818e6fecd516ecc3849daf6845e3ec868087b755000000000000000000000000a5c603e1c27a96171487aea0649b01c56248d2e8000000000000000000000000000000000000000000000000000000000000000f

-----Decoded View---------------
Arg [0] : _registry (address): 0xc17D432Bd8e8850Fd7b32B0270f5AfAc65DB0105
Arg [1] : _guardianStorage (address): 0x44DA3A8051bA88EAB0440DB3779cAB9D679ae76f
Arg [2] : _kyber (address): 0x818E6FECD516Ecc3849DAf6845e3EC868087B755
Arg [3] : _feeCollector (address): 0xa5c603e1C27a96171487aea0649b01c56248d2e8
Arg [4] : _feeRatio (uint256): 15

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000c17d432bd8e8850fd7b32b0270f5afac65db0105
Arg [1] : 00000000000000000000000044da3a8051ba88eab0440db3779cab9d679ae76f
Arg [2] : 000000000000000000000000818e6fecd516ecc3849daf6845e3ec868087b755
Arg [3] : 000000000000000000000000a5c603e1c27a96171487aea0649b01c56248d2e8
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000f


Swarm Source

bzzr://d70bac8b54c65915c749ff37148443ea96e6ec56e2c34d250083a98f107fa11b

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

Contract of Argent's Token Exchanger.

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.