Contract 0xcbc6a023eb975a1e2630223a7959988948e664f3

 

TxHash Block Age From To Value [TxFee]
0x10e6f44a144a3337fbecdd09030828be1debcf1b81034e07a6849cf366ce46f5(pending)3 mins ago0x990576e8aa202a7be9d3175796a75ff2ff426797  IN  0xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether(Pending)
0x415348f343ecd0286cf55b676ef8a817b0bc35fe444f89e075493cc9739a3749(pending)5 mins ago0x8ebd10fe696288c6ed1e024064fdf54541aa63e0  IN  0xcbc6a023eb975a1e2630223a7959988948e664f32 Ether(Pending)
0x6826b06a8c23fe94eaa8f5773dab190b5310f8935bda22bb5bb9bd3379030da3(pending)5 mins ago0x0733662b90862f6f006ddb5f0e80728f8f60a6c9  IN  0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether(Pending)
0xa599575eb5054f9c55ec523275eb3da0e5027a19cf2fc41e20a9e3d46aabb521723077612 mins ago0x990576e8aa202a7be9d3175796a75ff2ff426797  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether0.002056999
0x3e4db7d18c0dab753892da4dd1fce8ba9d4d0078fcc2d1899a7ba181f41a3aa7723074924 mins ago0x0733662b90862f6f006ddb5f0e80728f8f60a6c9  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether0.002685144
0x30e1873424dae22363910b7d6830b0db1ad41db9f7aee07713219a2eecac0fa8723070242 mins ago0x00923b9a074762b93650716333b3e1473a15048e  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether0.002819306
0x15dd120d9a812153bf2d4c85d21db51ab4b2178d4958545ffc814ef9808e7d3b723069943 mins ago0x0733662b90862f6f006ddb5f0e80728f8f60a6c9  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.5 Ether0.002684632
0xde9b86a4d94c24c7495384d94fe6f36546a93451e7f31d9220dd02c134ded19a723069045 mins ago0x65471a455b20de893b6b9eef43fd7c779c7a7d87  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.07 Ether0.002649456
0xadfc82338f45206c8780f41b00e771b2e8fdd363e2500afca42f46f870dc61a9723069045 mins ago0x0733662b90862f6f006ddb5f0e80728f8f60a6c9  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether0.002468744
0x87099afd5882c098577bdd8a8a061b2cca96e63ad8c66298a96a1dcbbbc3305b723068946 mins ago0x00a2aebc7e233cd2ffe5ab5856f90f0ad2fa3ccd  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether0.002729895
0x1b25885db3b0f62a16e9b4e868a5dae6e750e1de4271d930bace142de2a18aa4723066753 mins ago0xee86773cdb6c9db345789d0c7c7e81e2b38f7011  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.5 Ether0.002649832
0xfb8afbfc41823688dda1dbdd067935a01fa8c4cb4d03694a56c2d6eb4145036072306171 hr 12 mins ago0xd95be72cf63900ff140a1edfe86359fb2acf6168  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.65 Ether0.002677472
0xf13611178a12248879dac5aca84a77f0b1bfefad7f1eb2e24ef714db11259a5172305371 hr 39 mins ago0x41e4146cc5164314bda4318962cfe50ad56c755a  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.463501072349373 Ether0.002658384
0x852c86b91de4046a2c5ca90c15b804f740a7e6b10b9ed4b47285576e1cd87dbe72305261 hr 43 mins ago0x932441719fed3d09e9b6c06deba4b1e333610ecb  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.497272820425349 Ether0.003308914
0xe3288bbdb93e0f5a24a5f587adeb30ed67aa709ee5ff4e0eddaa0583254f634d72305121 hr 48 mins ago0x005fde5294199d5c3eb5eb7a6e51954123b74b1c  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether0.002709273
0xbe6ebaeb8c295ca93e6e64ea68a309a35c0a4101d29130988f02e47fd686b92472305011 hr 52 mins ago0x00d1ce825dacbcb6789e2d5fb1873a7178312abc  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31.6 Ether0.002719661
0x2d58ea6ae5f3d4ceee7a5951380b7fea87c395bb086f4453ad5d4c688a73bc2772304951 hr 54 mins ago0x00d1ce825dacbcb6789e2d5fb1873a7178312abc  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31 Ether0.002718919
0x00eb6f84c4b06917a9ad025595f7e51dabca948c1b8cf328bf15125806d1477d72304951 hr 54 mins ago0x2f92511447cbb0f7658b4adb4978dbab20f03358  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31.77 Ether0.00265288
0xd89fe895d6d6ae7e3ce0cc598229134d995ec6c0f117e61d4a2fdeea1386aca072304841 hr 57 mins ago0xc218fdef2cbc28d563e4cb7c37ead0e6cc9a1642  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.5 Ether0.002657576
0x6000022045d5c20f4543ed165ec39d2671a0f29d234879ef75dff67ed3c30cf472304672 hrs 4 mins ago0x0dc411b17d337af85d83ea5a3577d09132aae866  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.599005176324357 Ether0.002773504
0xae7d421b4a6cfc5c02d3f9b258e2bf68b0a428b192942e6bb04c50716182900b72304592 hrs 6 mins ago0x85c349538c7fef8dbff24ab4972d94588b1932bc  IN   0xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether0.002791496
0x3fd1e80148a0b6efea8b52b3ec6e255ecf5a8020cb7f0220d7b43cb074a07cbf72304422 hrs 11 mins ago0x95ce7dccf1b39424da09e7fcc97032ccc4a40c11  IN   0xcbc6a023eb975a1e2630223a7959988948e664f311.12 Ether0.002480328
0x1e9c2c68e6f50ef55af14d6f4fd605b9240def2282e5cb7f62903a9433a2ed0372304422 hrs 11 mins ago0x66ac0f7de491783d46341d81c61d668f6e0be13e  IN   0xcbc6a023eb975a1e2630223a7959988948e664f33.3 Ether0.002481352
0x65b350323d40df75c32bd4873f5a5ab57cdaa194178e061aac619965b2e7bd1d72304412 hrs 11 mins ago0x9596c2d008f9808a73c624ab7dd934ce81f4f507  IN   0xcbc6a023eb975a1e2630223a7959988948e664f33.5 Ether0.00265892
0x4d2d643c2358da074f0a4f894a8da111685d5c6e4bd4a517bb2d4e74a98344ec72304322 hrs 14 mins ago0xfbe318be9ff2cc61730c51c0f79a0257d0888a9d  IN   0xcbc6a023eb975a1e2630223a7959988948e664f30.059 Ether0.00359528
[ Download CSV Export 

Latest 25 Internal Transaction, Click here to view more Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0xef80fb5f7d43818ae8aa3e5b128b2037fb643ad2c78e425431eef885ff6cbb7372307859 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.003412250877341432 Ether
0xef80fb5f7d43818ae8aa3e5b128b2037fb643ad2c78e425431eef885ff6cbb7372307859 mins ago0x36c03a02d4a703354348ebe7098b8e3ccefcaef50xcbc6a023eb975a1e2630223a7959988948e664f31.003412250877341432 Ether
0xa599575eb5054f9c55ec523275eb3da0e5027a19cf2fc41e20a9e3d46aabb521723077612 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0xe4f1e93aafa9e54ab0c56328f7390a0891efad8a519ee84561db6b924aed8804723077014 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0xe4f1e93aafa9e54ab0c56328f7390a0891efad8a519ee84561db6b924aed8804723077014 mins ago0x57f5429a31e7a1cf3a3ade75372846420f9498470xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether
0x6b53945ae9a40c2481b64fa0c9dc5943cc466d43006df845bce853feed7a60f2723074924 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0x6b53945ae9a40c2481b64fa0c9dc5943cc466d43006df845bce853feed7a60f2723074924 mins ago0x57f5429a31e7a1cf3a3ade75372846420f9498470xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether
0x3e4db7d18c0dab753892da4dd1fce8ba9d4d0078fcc2d1899a7ba181f41a3aa7723074924 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1 Ether
0x4a9e9d1f795389a6207378e94d9cb9def0ef6e570dc4ccb6a60115f7cbae829c723074526 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0x4a9e9d1f795389a6207378e94d9cb9def0ef6e570dc4ccb6a60115f7cbae829c723074526 mins ago0x57f5429a31e7a1cf3a3ade75372846420f9498470xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether
0x8841e29d9a473e87d53d0388fead531c961947c4ba40373d8176b066c38eec25723071636 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0x8841e29d9a473e87d53d0388fead531c961947c4ba40373d8176b066c38eec25723071636 mins ago0x57f5429a31e7a1cf3a3ade75372846420f9498470xcbc6a023eb975a1e2630223a7959988948e664f31.5 Ether
0x30e1873424dae22363910b7d6830b0db1ad41db9f7aee07713219a2eecac0fa8723070242 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1 Ether
0x15dd120d9a812153bf2d4c85d21db51ab4b2178d4958545ffc814ef9808e7d3b723069943 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.5 Ether
0xde9b86a4d94c24c7495384d94fe6f36546a93451e7f31d9220dd02c134ded19a723069045 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.07 Ether
0xadfc82338f45206c8780f41b00e771b2e8fdd363e2500afca42f46f870dc61a9723069045 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1.5 Ether
0x87099afd5882c098577bdd8a8a061b2cca96e63ad8c66298a96a1dcbbbc3305b723068946 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db1 Ether
0x1b25885db3b0f62a16e9b4e868a5dae6e750e1de4271d930bace142de2a18aa4723066753 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.5 Ether
0xa515e06a4e9db2bf0bc4f5787b3998404e35cf17645d87c97d30504494a9175772306261 hr 10 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.939083753082679645 Ether
0xa515e06a4e9db2bf0bc4f5787b3998404e35cf17645d87c97d30504494a9175772306261 hr 10 mins ago0x36c03a02d4a703354348ebe7098b8e3ccefcaef50xcbc6a023eb975a1e2630223a7959988948e664f30.939083753082679645 Ether
0xfb8afbfc41823688dda1dbdd067935a01fa8c4cb4d03694a56c2d6eb4145036072306171 hr 12 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.65 Ether
0x8d35dcddda24cb17f219ce60c2071ca59b8dc5ac0de0fe1bc46f77224519f1e472305681 hr 29 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.677439695895269909 Ether
0x8d35dcddda24cb17f219ce60c2071ca59b8dc5ac0de0fe1bc46f77224519f1e472305681 hr 29 mins ago0x36c03a02d4a703354348ebe7098b8e3ccefcaef50xcbc6a023eb975a1e2630223a7959988948e664f30.677439695895269909 Ether
0xa0838867d633d6ec18a3a5673e195d2c1cd21ba134f465f221ff5d4ad87b8ccc72305451 hr 37 mins ago0xcbc6a023eb975a1e2630223a7959988948e664f30x6690819cb98c1211a8e38790d6cd48316ed518db0.47421979066879215 Ether
0xa0838867d633d6ec18a3a5673e195d2c1cd21ba134f465f221ff5d4ad87b8ccc72305451 hr 37 mins ago0x36c03a02d4a703354348ebe7098b8e3ccefcaef50xcbc6a023eb975a1e2630223a7959988948e664f30.47421979066879215 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Verified Source Code for Contract 0x804033aa859a7f0e51d3cce376d9e7dd9c900c45
Contract Name: BancorConverter
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.24;

// File: contracts/token/interfaces/IERC20Token.sol

/*
    ERC20 Standard Token interface
*/
contract IERC20Token {
    // these functions aren't abstract since the compiler emits automatically generated getter functions as external
    function name() public view returns (string) {}
    function symbol() public view returns (string) {}
    function decimals() public view returns (uint8) {}
    function totalSupply() public view returns (uint256) {}
    function balanceOf(address _owner) public view returns (uint256) { _owner; }
    function allowance(address _owner, address _spender) public view returns (uint256) { _owner; _spender; }

    function transfer(address _to, uint256 _value) public returns (bool success);
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
    function approve(address _spender, uint256 _value) public returns (bool success);
}

// File: contracts/utility/interfaces/IWhitelist.sol

/*
    Whitelist interface
*/
contract IWhitelist {
    function isWhitelisted(address _address) public view returns (bool);
}

// File: contracts/converter/interfaces/IBancorConverter.sol

/*
    Bancor Converter interface
*/
contract IBancorConverter {
    function getReturn(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount) public view returns (uint256, uint256);
    function convert(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256);
    function conversionWhitelist() public view returns (IWhitelist) {}
    function conversionFee() public view returns (uint32) {}
    function connectors(address _address) public view returns (uint256, uint32, bool, bool, bool) { _address; }
    function getConnectorBalance(IERC20Token _connectorToken) public view returns (uint256);
    function claimTokens(address _from, uint256 _amount) public;
    // deprecated, backward compatibility
    function change(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256);
}

// File: contracts/converter/interfaces/IBancorConverterUpgrader.sol

/*
    Bancor Converter Upgrader interface
*/
contract IBancorConverterUpgrader {
    function upgrade(bytes32 _version) public;
    function upgrade(uint16 _version) public;
}

// File: contracts/converter/interfaces/IBancorFormula.sol

/*
    Bancor Formula interface
*/
contract IBancorFormula {
    function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) public view returns (uint256);
    function calculateSaleReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _sellAmount) public view returns (uint256);
    function calculateCrossConnectorReturn(uint256 _fromConnectorBalance, uint32 _fromConnectorWeight, uint256 _toConnectorBalance, uint32 _toConnectorWeight, uint256 _amount) public view returns (uint256);
}

// File: contracts/IBancorNetwork.sol

/*
    Bancor Network interface
*/
contract IBancorNetwork {
    function convert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256);
    function convertFor(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for) public payable returns (uint256);
    
    function convertForPrioritized3(
        IERC20Token[] _path,
        uint256 _amount,
        uint256 _minReturn,
        address _for,
        uint256 _customVal,
        uint256 _block,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) public payable returns (uint256);
    
    // deprecated, backward compatibility
    function convertForPrioritized2(
        IERC20Token[] _path,
        uint256 _amount,
        uint256 _minReturn,
        address _for,
        uint256 _block,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) public payable returns (uint256);

    // deprecated, backward compatibility
    function convertForPrioritized(
        IERC20Token[] _path,
        uint256 _amount,
        uint256 _minReturn,
        address _for,
        uint256 _block,
        uint256 _nonce,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) public payable returns (uint256);
}

// File: contracts/ContractIds.sol

/**
    Id definitions for bancor contracts

    Can be used in conjunction with the contract registry to get contract addresses
*/
contract ContractIds {
    // generic
    bytes32 public constant CONTRACT_FEATURES = "ContractFeatures";
    bytes32 public constant CONTRACT_REGISTRY = "ContractRegistry";

    // bancor logic
    bytes32 public constant BANCOR_NETWORK = "BancorNetwork";
    bytes32 public constant BANCOR_FORMULA = "BancorFormula";
    bytes32 public constant BANCOR_GAS_PRICE_LIMIT = "BancorGasPriceLimit";
    bytes32 public constant BANCOR_CONVERTER_UPGRADER = "BancorConverterUpgrader";
    bytes32 public constant BANCOR_CONVERTER_FACTORY = "BancorConverterFactory";

    // BNT core
    bytes32 public constant BNT_TOKEN = "BNTToken";
    bytes32 public constant BNT_CONVERTER = "BNTConverter";

    // BancorX
    bytes32 public constant BANCOR_X = "BancorX";
    bytes32 public constant BANCOR_X_UPGRADER = "BancorXUpgrader";
}

// File: contracts/FeatureIds.sol

/**
    Id definitions for bancor contract features

    Can be used to query the ContractFeatures contract to check whether a certain feature is supported by a contract
*/
contract FeatureIds {
    // converter features
    uint256 public constant CONVERTER_CONVERSION_WHITELIST = 1 << 0;
}

// File: contracts/utility/interfaces/IOwned.sol

/*
    Owned contract interface
*/
contract IOwned {
    // this function isn't abstract since the compiler emits automatically generated getter functions as external
    function owner() public view returns (address) {}

    function transferOwnership(address _newOwner) public;
    function acceptOwnership() public;
}

// File: contracts/utility/Owned.sol

/*
    Provides support and utilities for contract ownership
*/
contract Owned is IOwned {
    address public owner;
    address public newOwner;

    event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner);

    /**
        @dev constructor
    */
    constructor() public {
        owner = msg.sender;
    }

    // allows execution by the owner only
    modifier ownerOnly {
        require(msg.sender == owner);
        _;
    }

    /**
        @dev allows transferring the contract ownership
        the new owner still needs to accept the transfer
        can only be called by the contract owner

        @param _newOwner    new contract owner
    */
    function transferOwnership(address _newOwner) public ownerOnly {
        require(_newOwner != owner);
        newOwner = _newOwner;
    }

    /**
        @dev used by a new owner to accept an ownership transfer
    */
    function acceptOwnership() public {
        require(msg.sender == newOwner);
        emit OwnerUpdate(owner, newOwner);
        owner = newOwner;
        newOwner = address(0);
    }
}

// File: contracts/utility/Managed.sol

/*
    Provides support and utilities for contract management
    Note that a managed contract must also have an owner
*/
contract Managed is Owned {
    address public manager;
    address public newManager;

    event ManagerUpdate(address indexed _prevManager, address indexed _newManager);

    /**
        @dev constructor
    */
    constructor() public {
        manager = msg.sender;
    }

    // allows execution by the manager only
    modifier managerOnly {
        assert(msg.sender == manager);
        _;
    }

    // allows execution by either the owner or the manager only
    modifier ownerOrManagerOnly {
        require(msg.sender == owner || msg.sender == manager);
        _;
    }

    /**
        @dev allows transferring the contract management
        the new manager still needs to accept the transfer
        can only be called by the contract manager

        @param _newManager    new contract manager
    */
    function transferManagement(address _newManager) public ownerOrManagerOnly {
        require(_newManager != manager);
        newManager = _newManager;
    }

    /**
        @dev used by a new manager to accept a management transfer
    */
    function acceptManagement() public {
        require(msg.sender == newManager);
        emit ManagerUpdate(manager, newManager);
        manager = newManager;
        newManager = address(0);
    }
}

// File: contracts/utility/Utils.sol

/*
    Utilities & Common Modifiers
*/
contract Utils {
    /**
        constructor
    */
    constructor() public {
    }

    // verifies that an amount is greater than zero
    modifier greaterThanZero(uint256 _amount) {
        require(_amount > 0);
        _;
    }

    // validates an address - currently only checks that it isn't null
    modifier validAddress(address _address) {
        require(_address != address(0));
        _;
    }

    // verifies that the address is different than this contract address
    modifier notThis(address _address) {
        require(_address != address(this));
        _;
    }

}

// File: contracts/utility/SafeMath.sol

/*
    Library for basic math operations with overflow/underflow protection
*/
library SafeMath {
    /**
        @dev returns the sum of _x and _y, reverts if the calculation overflows

        @param _x   value 1
        @param _y   value 2

        @return sum
    */
    function add(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x + _y;
        require(z >= _x);
        return z;
    }

    /**
        @dev returns the difference of _x minus _y, reverts if the calculation underflows

        @param _x   minuend
        @param _y   subtrahend

        @return difference
    */
    function sub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        require(_x >= _y);
        return _x - _y;
    }

    /**
        @dev returns the product of multiplying _x by _y, reverts if the calculation overflows

        @param _x   factor 1
        @param _y   factor 2

        @return product
    */
    function mul(uint256 _x, uint256 _y) internal pure returns (uint256) {
        // gas optimization
        if (_x == 0)
            return 0;

        uint256 z = _x * _y;
        require(z / _x == _y);
        return z;
    }

      /**
        @dev Integer division of two numbers truncating the quotient, reverts on division by zero.

        @param _x   dividend
        @param _y   divisor

        @return quotient
    */
    function div(uint256 _x, uint256 _y) internal pure returns (uint256) {
        require(_y > 0);
        uint256 c = _x / _y;

        return c;
    }
}

// File: contracts/utility/interfaces/IContractRegistry.sol

/*
    Contract Registry interface
*/
contract IContractRegistry {
    function addressOf(bytes32 _contractName) public view returns (address);

    // deprecated, backward compatibility
    function getAddress(bytes32 _contractName) public view returns (address);
}

// File: contracts/utility/interfaces/IContractFeatures.sol

/*
    Contract Features interface
*/
contract IContractFeatures {
    function isSupported(address _contract, uint256 _features) public view returns (bool);
    function enableFeatures(uint256 _features, bool _enable) public;
}

// File: contracts/token/interfaces/ISmartToken.sol

/*
    Smart Token interface
*/
contract ISmartToken is IOwned, IERC20Token {
    function disableTransfers(bool _disable) public;
    function issue(address _to, uint256 _amount) public;
    function destroy(address _from, uint256 _amount) public;
}

// File: contracts/utility/interfaces/ITokenHolder.sol

/*
    Token Holder interface
*/
contract ITokenHolder is IOwned {
    function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public;
}

// File: contracts/utility/TokenHolder.sol

/*
    We consider every contract to be a 'token holder' since it's currently not possible
    for a contract to deny receiving tokens.

    The TokenHolder's contract sole purpose is to provide a safety mechanism that allows
    the owner to send tokens that were sent to the contract by mistake back to their sender.
*/
contract TokenHolder is ITokenHolder, Owned, Utils {
    /**
        @dev constructor
    */
    constructor() public {
    }

    /**
        @dev withdraws tokens held by the contract and sends them to an account
        can only be called by the owner

        @param _token   ERC20 token contract address
        @param _to      account to receive the new amount
        @param _amount  amount to withdraw
    */
    function withdrawTokens(IERC20Token _token, address _to, uint256 _amount)
        public
        ownerOnly
        validAddress(_token)
        validAddress(_to)
        notThis(_to)
    {
        assert(_token.transfer(_to, _amount));
    }
}

// File: contracts/token/SmartTokenController.sol

/*
    The smart token controller is an upgradable part of the smart token that allows
    more functionality as well as fixes for bugs/exploits.
    Once it accepts ownership of the token, it becomes the token's sole controller
    that can execute any of its functions.

    To upgrade the controller, ownership must be transferred to a new controller, along with
    any relevant data.

    The smart token must be set on construction and cannot be changed afterwards.
    Wrappers are provided (as opposed to a single 'execute' function) for each of the token's functions, for easier access.

    Note that the controller can transfer token ownership to a new controller that
    doesn't allow executing any function on the token, for a trustless solution.
    Doing that will also remove the owner's ability to upgrade the controller.
*/
contract SmartTokenController is TokenHolder {
    ISmartToken public token;   // smart token

    /**
        @dev constructor
    */
    constructor(ISmartToken _token)
        public
        validAddress(_token)
    {
        token = _token;
    }

    // ensures that the controller is the token's owner
    modifier active() {
        require(token.owner() == address(this));
        _;
    }

    // ensures that the controller is not the token's owner
    modifier inactive() {
        require(token.owner() != address(this));
        _;
    }

    /**
        @dev allows transferring the token ownership
        the new owner needs to accept the transfer
        can only be called by the contract owner

        @param _newOwner    new token owner
    */
    function transferTokenOwnership(address _newOwner) public ownerOnly {
        token.transferOwnership(_newOwner);
    }

    /**
        @dev used by a new owner to accept a token ownership transfer
        can only be called by the contract owner
    */
    function acceptTokenOwnership() public ownerOnly {
        token.acceptOwnership();
    }

    /**
        @dev disables/enables token transfers
        can only be called by the contract owner

        @param _disable    true to disable transfers, false to enable them
    */
    function disableTokenTransfers(bool _disable) public ownerOnly {
        token.disableTransfers(_disable);
    }

    /**
        @dev withdraws tokens held by the controller and sends them to an account
        can only be called by the owner

        @param _token   ERC20 token contract address
        @param _to      account to receive the new amount
        @param _amount  amount to withdraw
    */
    function withdrawFromToken(IERC20Token _token, address _to, uint256 _amount) public ownerOnly {
        ITokenHolder(token).withdrawTokens(_token, _to, _amount);
    }
}

// File: contracts/token/interfaces/IEtherToken.sol

/*
    Ether Token interface
*/
contract IEtherToken is ITokenHolder, IERC20Token {
    function deposit() public payable;
    function withdraw(uint256 _amount) public;
    function withdrawTo(address _to, uint256 _amount) public;
}

// File: contracts/bancorx/interfaces/IBancorX.sol

contract IBancorX {
    function xTransfer(bytes32 _toBlockchain, bytes32 _to, uint256 _amount, uint256 _id) public;
    function getXTransferAmount(uint256 _xTransferId, address _for) public view returns (uint256);
}

// File: contracts/converter/BancorConverter.sol

/*
    Bancor Converter v12

    The Bancor version of the token converter, allows conversion between a smart token and other ERC20 tokens and between different ERC20 tokens and themselves.

    ERC20 connector balance can be virtual, meaning that the calculations are based on the virtual balance instead of relying on
    the actual connector balance. This is a security mechanism that prevents the need to keep a very large (and valuable) balance in a single contract.

    The converter is upgradable (just like any SmartTokenController).

    WARNING: It is NOT RECOMMENDED to use the converter with Smart Tokens that have less than 8 decimal digits
             or with very small numbers because of precision loss

    Open issues:
    - Front-running attacks are currently mitigated by the following mechanisms:
        - minimum return argument for each conversion provides a way to define a minimum/maximum price for the transaction
        - gas price limit prevents users from having control over the order of execution
        - gas price limit check can be skipped if the transaction comes from a trusted, whitelisted signer
      Other potential solutions might include a commit/reveal based schemes
    - Possibly add getters for the connector fields so that the client won't need to rely on the order in the struct
*/
contract BancorConverter is IBancorConverter, SmartTokenController, Managed, ContractIds, FeatureIds {
    using SafeMath for uint256;

    
    uint32 private constant MAX_WEIGHT = 1000000;
    uint64 private constant MAX_CONVERSION_FEE = 1000000;

    struct Connector {
        uint256 virtualBalance;         // connector virtual balance
        uint32 weight;                  // connector weight, represented in ppm, 1-1000000
        bool isVirtualBalanceEnabled;   // true if virtual balance is enabled, false if not
        bool isSaleEnabled;             // is sale of the connector token enabled, can be set by the owner
        bool isSet;                     // used to tell if the mapping element is defined
    }

    uint16 public version = 12;
    string public converterType = 'bancor';

    bool public allowRegistryUpdate = true;             // allows the owner to prevent/allow the registry to be updated
    bool public claimTokensEnabled = false;             // allows BancorX contract to claim tokens without allowance (one transaction instread of two)
    IContractRegistry public prevRegistry;              // address of previous registry as security mechanism
    IContractRegistry public registry;                  // contract registry contract
    IWhitelist public conversionWhitelist;              // whitelist contract with list of addresses that are allowed to use the converter
    IERC20Token[] public connectorTokens;               // ERC20 standard token addresses
    mapping (address => Connector) public connectors;   // connector token addresses -> connector data
    uint32 private totalConnectorWeight = 0;            // used to efficiently prevent increasing the total connector weight above 100%
    uint32 public maxConversionFee = 0;                 // maximum conversion fee for the lifetime of the contract,
                                                        // represented in ppm, 0...1000000 (0 = no fee, 100 = 0.01%, 1000000 = 100%)
    uint32 public conversionFee = 0;                    // current conversion fee, represented in ppm, 0...maxConversionFee
    bool public conversionsEnabled = true;              // true if token conversions is enabled, false if not
    IERC20Token[] private convertPath;

    // triggered when a conversion between two tokens occurs
    event Conversion(
        address indexed _fromToken,
        address indexed _toToken,
        address indexed _trader,
        uint256 _amount,
        uint256 _return,
        int256 _conversionFee
    );
    // triggered after a conversion with new price data
    event PriceDataUpdate(
        address indexed _connectorToken,
        uint256 _tokenSupply,
        uint256 _connectorBalance,
        uint32 _connectorWeight
    );
    // triggered when the conversion fee is updated
    event ConversionFeeUpdate(uint32 _prevFee, uint32 _newFee);

    // triggered when conversions are enabled/disabled
    event ConversionsEnable(bool _conversionsEnabled);

    /**
        @dev constructor

        @param  _token              smart token governed by the converter
        @param  _registry           address of a contract registry contract
        @param  _maxConversionFee   maximum conversion fee, represented in ppm
        @param  _connectorToken     optional, initial connector, allows defining the first connector at deployment time
        @param  _connectorWeight    optional, weight for the initial connector
    */
    constructor(
        ISmartToken _token,
        IContractRegistry _registry,
        uint32 _maxConversionFee,
        IERC20Token _connectorToken,
        uint32 _connectorWeight
    )
        public
        SmartTokenController(_token)
        validAddress(_registry)
        validMaxConversionFee(_maxConversionFee)
    {
        registry = _registry;
        prevRegistry = _registry;
        IContractFeatures features = IContractFeatures(registry.addressOf(ContractIds.CONTRACT_FEATURES));

        // initialize supported features
        if (features != address(0))
            features.enableFeatures(FeatureIds.CONVERTER_CONVERSION_WHITELIST, true);

        maxConversionFee = _maxConversionFee;

        if (_connectorToken != address(0))
            addConnector(_connectorToken, _connectorWeight, false);
    }

    // validates a connector token address - verifies that the address belongs to one of the connector tokens
    modifier validConnector(IERC20Token _address) {
        require(connectors[_address].isSet);
        _;
    }

    // validates a token address - verifies that the address belongs to one of the convertible tokens
    modifier validToken(IERC20Token _address) {
        require(_address == token || connectors[_address].isSet);
        _;
    }

    // validates maximum conversion fee
    modifier validMaxConversionFee(uint32 _conversionFee) {
        require(_conversionFee >= 0 && _conversionFee <= MAX_CONVERSION_FEE);
        _;
    }

    // validates conversion fee
    modifier validConversionFee(uint32 _conversionFee) {
        require(_conversionFee >= 0 && _conversionFee <= maxConversionFee);
        _;
    }

    // validates connector weight range
    modifier validConnectorWeight(uint32 _weight) {
        require(_weight > 0 && _weight <= MAX_WEIGHT);
        _;
    }

    // validates a conversion path - verifies that the number of elements is odd and that maximum number of 'hops' is 10
    modifier validConversionPath(IERC20Token[] _path) {
        require(_path.length > 2 && _path.length <= (1 + 2 * 10) && _path.length % 2 == 1);
        _;
    }

    // allows execution only when the total weight is 100%
    modifier maxTotalWeightOnly() {
        require(totalConnectorWeight == MAX_WEIGHT);
        _;
    }

    // allows execution only when conversions aren't disabled
    modifier conversionsAllowed {
        assert(conversionsEnabled);
        _;
    }

    // allows execution by the BancorNetwork contract only
    modifier bancorNetworkOnly {
        IBancorNetwork bancorNetwork = IBancorNetwork(registry.addressOf(ContractIds.BANCOR_NETWORK));
        require(msg.sender == address(bancorNetwork));
        _;
    }

    // allows execution by the converter upgrader contract only
    modifier converterUpgraderOnly {
        address converterUpgrader = registry.addressOf(ContractIds.BANCOR_CONVERTER_UPGRADER);
        require(owner == converterUpgrader);
        _;
    }

    // allows execution only when claim tokens is enabled
    modifier whenClaimTokensEnabled {
        require(claimTokensEnabled);
        _;
    }

    /**
        @dev sets the contract registry to whichever address the current registry is pointing to
     */
    function updateRegistry() public {
        // require that upgrading is allowed or that the caller is the owner
        require(allowRegistryUpdate || msg.sender == owner);

        // get the address of whichever registry the current registry is pointing to
        address newRegistry = registry.addressOf(ContractIds.CONTRACT_REGISTRY);

        // if the new registry hasn't changed or is the zero address, revert
        require(newRegistry != address(registry) && newRegistry != address(0));

        // set the previous registry as current registry and current registry as newRegistry
        prevRegistry = registry;
        registry = IContractRegistry(newRegistry);
    }

    /**
        @dev security mechanism allowing the converter owner to revert to the previous registry,
        to be used in emergency scenario
    */
    function restoreRegistry() public ownerOrManagerOnly {
        // set the registry as previous registry
        registry = prevRegistry;

        // after a previous registry is restored, only the owner can allow future updates
        allowRegistryUpdate = false;
    }

    /**
        @dev disables the registry update functionality
        this is a safety mechanism in case of a emergency
        can only be called by the manager or owner

        @param _disable    true to disable registry updates, false to re-enable them
    */
    function disableRegistryUpdate(bool _disable) public ownerOrManagerOnly {
        allowRegistryUpdate = !_disable;
    }

    /**
        @dev disables/enables the claim tokens functionality

        @param _enable    true to enable claiming of tokens, false to disable
     */
    function enableClaimTokens(bool _enable) public ownerOnly {
        claimTokensEnabled = _enable;
    }

    /**
        @dev returns the number of connector tokens defined

        @return number of connector tokens
    */
    function connectorTokenCount() public view returns (uint16) {
        return uint16(connectorTokens.length);
    }

    /**
        @dev allows the owner to update & enable the conversion whitelist contract address
        when set, only addresses that are whitelisted are actually allowed to use the converter
        note that the whitelist check is actually done by the BancorNetwork contract

        @param _whitelist    address of a whitelist contract
    */
    function setConversionWhitelist(IWhitelist _whitelist)
        public
        ownerOnly
        notThis(_whitelist)
    {
        conversionWhitelist = _whitelist;
    }

    /**
        @dev disables the entire conversion functionality
        this is a safety mechanism in case of a emergency
        can only be called by the manager

        @param _disable true to disable conversions, false to re-enable them
    */
    function disableConversions(bool _disable) public ownerOrManagerOnly {
        if (conversionsEnabled == _disable) {
            conversionsEnabled = !_disable;
            emit ConversionsEnable(conversionsEnabled);
        }
    }

    /**
        @dev allows transferring the token ownership
        the new owner needs to accept the transfer
        can only be called by the contract owner
        note that token ownership can only be transferred while the owner is the converter upgrader contract

        @param _newOwner    new token owner
    */
    function transferTokenOwnership(address _newOwner)
        public
        ownerOnly
        converterUpgraderOnly
    {
        super.transferTokenOwnership(_newOwner);
    }

    /**
        @dev updates the current conversion fee
        can only be called by the manager

        @param _conversionFee new conversion fee, represented in ppm
    */
    function setConversionFee(uint32 _conversionFee)
        public
        ownerOrManagerOnly
        validConversionFee(_conversionFee)
    {
        emit ConversionFeeUpdate(conversionFee, _conversionFee);
        conversionFee = _conversionFee;
    }

    /**
        @dev given a return amount, returns the amount minus the conversion fee

        @param _amount      return amount
        @param _magnitude   1 for standard conversion, 2 for cross connector conversion

        @return return amount minus conversion fee
    */
    function getFinalAmount(uint256 _amount, uint8 _magnitude) public view returns (uint256) {
        return _amount.mul((MAX_CONVERSION_FEE - conversionFee) ** _magnitude).div(MAX_CONVERSION_FEE ** _magnitude);
    }

    /**
        @dev withdraws tokens held by the converter and sends them to an account
        can only be called by the owner
        note that connector tokens can only be withdrawn by the owner while the converter is inactive
        unless the owner is the converter upgrader contract

        @param _token   ERC20 token contract address
        @param _to      account to receive the new amount
        @param _amount  amount to withdraw
    */
    function withdrawTokens(IERC20Token _token, address _to, uint256 _amount) public {
        address converterUpgrader = registry.addressOf(ContractIds.BANCOR_CONVERTER_UPGRADER);

        // if the token is not a connector token, allow withdrawal
        // otherwise verify that the converter is inactive or that the owner is the upgrader contract
        require(!connectors[_token].isSet || token.owner() != address(this) || owner == converterUpgrader);
        super.withdrawTokens(_token, _to, _amount);
    }

    /**
        @dev allows the BancorX contract to claim BNT from any address (so that users
        dont have to first give allowance when calling BancorX)

        @param _from      address to claim the BNT from
        @param _amount    the amount to claim
     */
    function claimTokens(address _from, uint256 _amount) public whenClaimTokensEnabled {
        address bancorX = registry.addressOf(ContractIds.BANCOR_X);

        // only the bancorX contract may call this method
        require(msg.sender == bancorX);

        // destroy the tokens belonging to _from, and issue the same amount to bancorX contract
        token.destroy(_from, _amount);
        token.issue(msg.sender, _amount);
    }

    /**
        @dev upgrades the converter to the latest version
        can only be called by the owner
        note that the owner needs to call acceptOwnership/acceptManagement on the new converter after the upgrade
    */
    function upgrade() public ownerOnly {
        IBancorConverterUpgrader converterUpgrader = IBancorConverterUpgrader(registry.addressOf(ContractIds.BANCOR_CONVERTER_UPGRADER));

        transferOwnership(converterUpgrader);
        converterUpgrader.upgrade(version);
        acceptOwnership();
    }

    /**
        @dev defines a new connector for the token
        can only be called by the owner while the converter is inactive

        @param _token                  address of the connector token
        @param _weight                 constant connector weight, represented in ppm, 1-1000000
        @param _enableVirtualBalance   true to enable virtual balance for the connector, false to disable it
    */
    function addConnector(IERC20Token _token, uint32 _weight, bool _enableVirtualBalance)
        public
        ownerOnly
        inactive
        validAddress(_token)
        notThis(_token)
        validConnectorWeight(_weight)
    {
        require(_token != token && !connectors[_token].isSet && totalConnectorWeight + _weight <= MAX_WEIGHT); // validate input

        connectors[_token].virtualBalance = 0;
        connectors[_token].weight = _weight;
        connectors[_token].isVirtualBalanceEnabled = _enableVirtualBalance;
        connectors[_token].isSaleEnabled = true;
        connectors[_token].isSet = true;
        connectorTokens.push(_token);
        totalConnectorWeight += _weight;
    }

    /**
        @dev updates one of the token connectors
        can only be called by the owner

        @param _connectorToken         address of the connector token
        @param _weight                 constant connector weight, represented in ppm, 1-1000000
        @param _enableVirtualBalance   true to enable virtual balance for the connector, false to disable it
        @param _virtualBalance         new connector's virtual balance
    */
    function updateConnector(IERC20Token _connectorToken, uint32 _weight, bool _enableVirtualBalance, uint256 _virtualBalance)
        public
        ownerOnly
        validConnector(_connectorToken)
        validConnectorWeight(_weight)
    {
        Connector storage connector = connectors[_connectorToken];
        require(totalConnectorWeight - connector.weight + _weight <= MAX_WEIGHT); // validate input

        totalConnectorWeight = totalConnectorWeight - connector.weight + _weight;
        connector.weight = _weight;
        connector.isVirtualBalanceEnabled = _enableVirtualBalance;
        connector.virtualBalance = _virtualBalance;
    }

    /**
        @dev disables converting from the given connector token in case the connector token got compromised
        can only be called by the owner
        note that converting to the token is still enabled regardless of this flag and it cannot be disabled by the owner

        @param _connectorToken  connector token contract address
        @param _disable         true to disable the token, false to re-enable it
    */
    function disableConnectorSale(IERC20Token _connectorToken, bool _disable)
        public
        ownerOnly
        validConnector(_connectorToken)
    {
        connectors[_connectorToken].isSaleEnabled = !_disable;
    }

    /**
        @dev returns the connector's virtual balance if one is defined, otherwise returns the actual balance

        @param _connectorToken  connector token contract address

        @return connector balance
    */
    function getConnectorBalance(IERC20Token _connectorToken)
        public
        view
        validConnector(_connectorToken)
        returns (uint256)
    {
        Connector storage connector = connectors[_connectorToken];
        return connector.isVirtualBalanceEnabled ? connector.virtualBalance : _connectorToken.balanceOf(this);
    }

    /**
        @dev returns the expected return for converting a specific amount of _fromToken to _toToken

        @param _fromToken  ERC20 token to convert from
        @param _toToken    ERC20 token to convert to
        @param _amount     amount to convert, in fromToken

        @return expected conversion return amount and conversion fee
    */
    function getReturn(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount) public view returns (uint256, uint256) {
        require(_fromToken != _toToken); // validate input

        // conversion between the token and one of its connectors
        if (_toToken == token)
            return getPurchaseReturn(_fromToken, _amount);
        else if (_fromToken == token)
            return getSaleReturn(_toToken, _amount);

        // conversion between 2 connectors
        return getCrossConnectorReturn(_fromToken, _toToken, _amount);
    }

    /**
        @dev returns the expected return for buying the token for a connector token

        @param _connectorToken  connector token contract address
        @param _depositAmount   amount to deposit (in the connector token)

        @return expected purchase return amount and conversion fee
    */
    function getPurchaseReturn(IERC20Token _connectorToken, uint256 _depositAmount)
        public
        view
        active
        validConnector(_connectorToken)
        returns (uint256, uint256)
    {
        Connector storage connector = connectors[_connectorToken];
        require(connector.isSaleEnabled); // validate input

        uint256 tokenSupply = token.totalSupply();
        uint256 connectorBalance = getConnectorBalance(_connectorToken);
        IBancorFormula formula = IBancorFormula(registry.addressOf(ContractIds.BANCOR_FORMULA));
        uint256 amount = formula.calculatePurchaseReturn(tokenSupply, connectorBalance, connector.weight, _depositAmount);
        uint256 finalAmount = getFinalAmount(amount, 1);

        // return the amount minus the conversion fee and the conversion fee
        return (finalAmount, amount - finalAmount);
    }

    /**
        @dev returns the expected return for selling the token for one of its connector tokens

        @param _connectorToken  connector token contract address
        @param _sellAmount      amount to sell (in the smart token)

        @return expected sale return amount and conversion fee
    */
    function getSaleReturn(IERC20Token _connectorToken, uint256 _sellAmount)
        public
        view
        active
        validConnector(_connectorToken)
        returns (uint256, uint256)
    {
        Connector storage connector = connectors[_connectorToken];
        uint256 tokenSupply = token.totalSupply();
        uint256 connectorBalance = getConnectorBalance(_connectorToken);
        IBancorFormula formula = IBancorFormula(registry.addressOf(ContractIds.BANCOR_FORMULA));
        uint256 amount = formula.calculateSaleReturn(tokenSupply, connectorBalance, connector.weight, _sellAmount);
        uint256 finalAmount = getFinalAmount(amount, 1);

        // return the amount minus the conversion fee and the conversion fee
        return (finalAmount, amount - finalAmount);
    }

    /**
        @dev returns the expected return for selling one of the connector tokens for another connector token

        @param _fromConnectorToken  contract address of the connector token to convert from
        @param _toConnectorToken    contract address of the connector token to convert to
        @param _sellAmount          amount to sell (in the from connector token)

        @return expected sale return amount and conversion fee (in the to connector token)
    */
    function getCrossConnectorReturn(IERC20Token _fromConnectorToken, IERC20Token _toConnectorToken, uint256 _sellAmount)
        public
        view
        active
        validConnector(_fromConnectorToken)
        validConnector(_toConnectorToken)
        returns (uint256, uint256)
    {
        Connector storage fromConnector = connectors[_fromConnectorToken];
        Connector storage toConnector = connectors[_toConnectorToken];
        require(fromConnector.isSaleEnabled); // validate input

        IBancorFormula formula = IBancorFormula(registry.addressOf(ContractIds.BANCOR_FORMULA));
        uint256 amount = formula.calculateCrossConnectorReturn(
            getConnectorBalance(_fromConnectorToken), 
            fromConnector.weight, 
            getConnectorBalance(_toConnectorToken), 
            toConnector.weight, 
            _sellAmount);
        uint256 finalAmount = getFinalAmount(amount, 2);

        // return the amount minus the conversion fee and the conversion fee
        // the fee is higher (magnitude = 2) since cross connector conversion equals 2 conversions (from / to the smart token)
        return (finalAmount, amount - finalAmount);
    }

    /**
        @dev converts a specific amount of _fromToken to _toToken

        @param _fromToken  ERC20 token to convert from
        @param _toToken    ERC20 token to convert to
        @param _amount     amount to convert, in fromToken
        @param _minReturn  if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero

        @return conversion return amount
    */
    function convertInternal(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn)
        public
        bancorNetworkOnly
        conversionsAllowed
        greaterThanZero(_minReturn)
        returns (uint256)
    {
        require(_fromToken != _toToken); // validate input

        // conversion between the token and one of its connectors
        if (_toToken == token)
            return buy(_fromToken, _amount, _minReturn);
        else if (_fromToken == token)
            return sell(_toToken, _amount, _minReturn);

        uint256 amount;
        uint256 feeAmount;

        // conversion between 2 connectors
        (amount, feeAmount) = getCrossConnectorReturn(_fromToken, _toToken, _amount);
        // ensure the trade gives something in return and meets the minimum requested amount
        require(amount != 0 && amount >= _minReturn);

        // update the source token virtual balance if relevant
        Connector storage fromConnector = connectors[_fromToken];
        if (fromConnector.isVirtualBalanceEnabled)
            fromConnector.virtualBalance = fromConnector.virtualBalance.add(_amount);

        // update the target token virtual balance if relevant
        Connector storage toConnector = connectors[_toToken];
        if (toConnector.isVirtualBalanceEnabled)
            toConnector.virtualBalance = toConnector.virtualBalance.sub(amount);

        // ensure that the trade won't deplete the connector balance
        uint256 toConnectorBalance = getConnectorBalance(_toToken);
        assert(amount < toConnectorBalance);

        // transfer funds from the caller in the from connector token
        assert(_fromToken.transferFrom(msg.sender, this, _amount));
        // transfer funds to the caller in the to connector token
        // the transfer might fail if the actual connector balance is smaller than the virtual balance
        assert(_toToken.transfer(msg.sender, amount));

        // dispatch the conversion event
        // the fee is higher (magnitude = 2) since cross connector conversion equals 2 conversions (from / to the smart token)
        dispatchConversionEvent(_fromToken, _toToken, _amount, amount, feeAmount);

        // dispatch price data updates for the smart token / both connectors
        emit PriceDataUpdate(_fromToken, token.totalSupply(), getConnectorBalance(_fromToken), fromConnector.weight);
        emit PriceDataUpdate(_toToken, token.totalSupply(), getConnectorBalance(_toToken), toConnector.weight);
        return amount;
    }

    /**
        @dev converts a specific amount of _fromToken to _toToken

        @param _fromToken  ERC20 token to convert from
        @param _toToken    ERC20 token to convert to
        @param _amount     amount to convert, in fromToken
        @param _minReturn  if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero

        @return conversion return amount
    */
    function convert(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256) {
        convertPath = [_fromToken, token, _toToken];
        return quickConvert(convertPath, _amount, _minReturn);
    }

    /**
        @dev buys the token by depositing one of its connector tokens

        @param _connectorToken  connector token contract address
        @param _depositAmount   amount to deposit (in the connector token)
        @param _minReturn       if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero

        @return buy return amount
    */
    function buy(IERC20Token _connectorToken, uint256 _depositAmount, uint256 _minReturn) internal returns (uint256) {
        uint256 amount;
        uint256 feeAmount;
        (amount, feeAmount) = getPurchaseReturn(_connectorToken, _depositAmount);
        // ensure the trade gives something in return and meets the minimum requested amount
        require(amount != 0 && amount >= _minReturn);

        // update virtual balance if relevant
        Connector storage connector = connectors[_connectorToken];
        if (connector.isVirtualBalanceEnabled)
            connector.virtualBalance = connector.virtualBalance.add(_depositAmount);

        // transfer funds from the caller in the connector token
        assert(_connectorToken.transferFrom(msg.sender, this, _depositAmount));
        // issue new funds to the caller in the smart token
        token.issue(msg.sender, amount);

        // dispatch the conversion event
        dispatchConversionEvent(_connectorToken, token, _depositAmount, amount, feeAmount);

        // dispatch price data update for the smart token/connector
        emit PriceDataUpdate(_connectorToken, token.totalSupply(), getConnectorBalance(_connectorToken), connector.weight);
        return amount;
    }

    /**
        @dev sells the token by withdrawing from one of its connector tokens

        @param _connectorToken  connector token contract address
        @param _sellAmount      amount to sell (in the smart token)
        @param _minReturn       if the conversion results in an amount smaller the minimum return - it is cancelled, must be nonzero

        @return sell return amount
    */
    function sell(IERC20Token _connectorToken, uint256 _sellAmount, uint256 _minReturn) internal returns (uint256) {
        require(_sellAmount <= token.balanceOf(msg.sender)); // validate input
        uint256 amount;
        uint256 feeAmount;
        (amount, feeAmount) = getSaleReturn(_connectorToken, _sellAmount);
        // ensure the trade gives something in return and meets the minimum requested amount
        require(amount != 0 && amount >= _minReturn);

        // ensure that the trade will only deplete the connector balance if the total supply is depleted as well
        uint256 tokenSupply = token.totalSupply();
        uint256 connectorBalance = getConnectorBalance(_connectorToken);
        assert(amount < connectorBalance || (amount == connectorBalance && _sellAmount == tokenSupply));

        // update virtual balance if relevant
        Connector storage connector = connectors[_connectorToken];
        if (connector.isVirtualBalanceEnabled)
            connector.virtualBalance = connector.virtualBalance.sub(amount);

        // destroy _sellAmount from the caller's balance in the smart token
        token.destroy(msg.sender, _sellAmount);
        // transfer funds to the caller in the connector token
        // the transfer might fail if the actual connector balance is smaller than the virtual balance
        assert(_connectorToken.transfer(msg.sender, amount));

        // dispatch the conversion event
        dispatchConversionEvent(token, _connectorToken, _sellAmount, amount, feeAmount);

        // dispatch price data update for the smart token/connector
        emit PriceDataUpdate(_connectorToken, token.totalSupply(), getConnectorBalance(_connectorToken), connector.weight);
        return amount;
    }

    /**
        @dev converts the token to any other token in the bancor network by following a predefined conversion path
        note that when converting from an ERC20 token (as opposed to a smart token), allowance must be set beforehand

        @param _path        conversion path, see conversion path format in the BancorNetwork contract
        @param _amount      amount to convert from (in the initial source token)
        @param _minReturn   if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero

        @return tokens issued in return
    */
    function quickConvert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn)
        public
        payable
        returns (uint256)
    {
        return quickConvertPrioritized(_path, _amount, _minReturn, 0x0, 0x0, 0x0, 0x0);
    }

    /**
        @dev converts the token to any other token in the bancor network by following a predefined conversion path
        note that when converting from an ERC20 token (as opposed to a smart token), allowance must be set beforehand

        @param _path        conversion path, see conversion path format in the BancorNetwork contract
        @param _amount      amount to convert from (in the initial source token)
        @param _minReturn   if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero
        @param _block       if the current block exceeded the given parameter - it is cancelled
        @param _v           (signature[128:130]) associated with the signer address and helps validating if the signature is legit
        @param _r           (signature[0:64]) associated with the signer address and helps validating if the signature is legit
        @param _s           (signature[64:128]) associated with the signer address and helps validating if the signature is legit

        @return tokens issued in return
    */
    function quickConvertPrioritized(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, uint256 _block, uint8 _v, bytes32 _r, bytes32 _s)
        public
        payable
        returns (uint256)
    {
        IERC20Token fromToken = _path[0];
        IBancorNetwork bancorNetwork = IBancorNetwork(registry.addressOf(ContractIds.BANCOR_NETWORK));

        // we need to transfer the source tokens from the caller to the BancorNetwork contract,
        // so it can execute the conversion on behalf of the caller
        if (msg.value == 0) {
            // not ETH, send the source tokens to the BancorNetwork contract
            // if the token is the smart token, no allowance is required - destroy the tokens
            // from the caller and issue them to the BancorNetwork contract
            if (fromToken == token) {
                token.destroy(msg.sender, _amount); // destroy _amount tokens from the caller's balance in the smart token
                token.issue(bancorNetwork, _amount); // issue _amount new tokens to the BancorNetwork contract
            } else {
                // otherwise, we assume we already have allowance, transfer the tokens directly to the BancorNetwork contract
                assert(fromToken.transferFrom(msg.sender, bancorNetwork, _amount));
            }
        }

        // execute the conversion and pass on the ETH with the call
        return bancorNetwork.convertForPrioritized3.value(msg.value)(_path, _amount, _minReturn, msg.sender, _amount, _block, _v, _r, _s);
    }

    /**
        @dev allows a user to convert BNT that was sent from another blockchain into any other
        token on the BancorNetwork without specifying the amount of BNT to be converted, but
        rather by providing the xTransferId which allows us to get the amount from BancorX.

        @param _path             conversion path, see conversion path format in the BancorNetwork contract
        @param _minReturn        if the conversion results in an amount smaller than the minimum return - it is cancelled, must be nonzero
        @param _conversionId     pre-determined unique (if non zero) id which refers to this transaction 
        @param _block            if the current block exceeded the given parameter - it is cancelled
        @param _v                (signature[128:130]) associated with the signer address and helps to validate if the signature is legit
        @param _r                (signature[0:64]) associated with the signer address and helps to validate if the signature is legit
        @param _s                (signature[64:128]) associated with the signer address and helps to validate if the signature is legit

        @return tokens issued in return
    */
    function completeXConversion(
        IERC20Token[] _path,
        uint256 _minReturn,
        uint256 _conversionId,
        uint256 _block,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    )
        public
        returns (uint256)
    {
        IBancorX bancorX = IBancorX(registry.addressOf(ContractIds.BANCOR_X));
        IBancorNetwork bancorNetwork = IBancorNetwork(registry.addressOf(ContractIds.BANCOR_NETWORK));

        // verify that the first token in the path is BNT
        require(_path[0] == registry.addressOf(ContractIds.BNT_TOKEN));

        // get conversion amount from BancorX contract
        uint256 amount = bancorX.getXTransferAmount(_conversionId, msg.sender);

        // send BNT from msg.sender to the BancorNetwork contract
        token.destroy(msg.sender, amount);
        token.issue(bancorNetwork, amount);

        return bancorNetwork.convertForPrioritized3(_path, amount, _minReturn, msg.sender, _conversionId, _block, _v, _r, _s);
    }

    /**
        @dev buys the token with all connector tokens using the same percentage
        i.e. if the caller increases the supply by 10%, it will cost an amount equal to
        10% of each connector token balance
        can only be called if the max total weight is exactly 100% and while conversions are enabled

        @param _amount  amount to increase the supply by (in the smart token)
    */
    function fund(uint256 _amount)
        public
        maxTotalWeightOnly
        conversionsAllowed
    {
        uint256 supply = token.totalSupply();

        // iterate through the connector tokens and transfer a percentage equal to the ratio between _amount
        // and the total supply in each connector from the caller to the converter
        IERC20Token connectorToken;
        uint256 connectorBalance;
        uint256 connectorAmount;
        for (uint16 i = 0; i < connectorTokens.length; i++) {
            connectorToken = connectorTokens[i];
            connectorBalance = getConnectorBalance(connectorToken);
            connectorAmount = _amount.mul(connectorBalance).div(supply);

            // update virtual balance if relevant
            Connector storage connector = connectors[connectorToken];
            if (connector.isVirtualBalanceEnabled)
                connector.virtualBalance = connector.virtualBalance.add(connectorAmount);

            // transfer funds from the caller in the connector token
            assert(connectorToken.transferFrom(msg.sender, this, connectorAmount));

            // dispatch price data update for the smart token/connector
            emit PriceDataUpdate(connectorToken, supply + _amount, connectorBalance + connectorAmount, connector.weight);
        }

        // issue new funds to the caller in the smart token
        token.issue(msg.sender, _amount);
    }

    /**
        @dev sells the token for all connector tokens using the same percentage
        i.e. if the holder sells 10% of the supply, they will receive 10% of each
        connector token balance in return
        can only be called if the max total weight is exactly 100%
        note that the function can also be called if conversions are disabled

        @param _amount  amount to liquidate (in the smart token)
    */
    function liquidate(uint256 _amount) public maxTotalWeightOnly {
        uint256 supply = token.totalSupply();

        // destroy _amount from the caller's balance in the smart token
        token.destroy(msg.sender, _amount);

        // iterate through the connector tokens and send a percentage equal to the ratio between _amount
        // and the total supply from each connector balance to the caller
        IERC20Token connectorToken;
        uint256 connectorBalance;
        uint256 connectorAmount;
        for (uint16 i = 0; i < connectorTokens.length; i++) {
            connectorToken = connectorTokens[i];
            connectorBalance = getConnectorBalance(connectorToken);
            connectorAmount = _amount.mul(connectorBalance).div(supply);

            // update virtual balance if relevant
            Connector storage connector = connectors[connectorToken];
            if (connector.isVirtualBalanceEnabled)
                connector.virtualBalance = connector.virtualBalance.sub(connectorAmount);

            // transfer funds to the caller in the connector token
            // the transfer might fail if the actual connector balance is smaller than the virtual balance
            assert(connectorToken.transfer(msg.sender, connectorAmount));

            // dispatch price data update for the smart token/connector
            emit PriceDataUpdate(connectorToken, supply - _amount, connectorBalance - connectorAmount, connector.weight);
        }
    }

    // deprecated, backward compatibility
    function change(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256) {
        return convertInternal(_fromToken, _toToken, _amount, _minReturn);
    }

    /**
        @dev helper, dispatches the Conversion event

        @param _fromToken       ERC20 token to convert from
        @param _toToken         ERC20 token to convert to
        @param _amount          amount purchased/sold (in the source token)
        @param _returnAmount    amount returned (in the target token)
    */
    function dispatchConversionEvent(IERC20Token _fromToken, IERC20Token _toToken, uint256 _amount, uint256 _returnAmount, uint256 _feeAmount) private {
        // fee amount is converted to 255 bits -
        // negative amount means the fee is taken from the source token, positive amount means its taken from the target token
        // currently the fee is always taken from the target token
        // since we convert it to a signed number, we first ensure that it's capped at 255 bits to prevent overflow
        assert(_feeAmount <= 2 ** 255);
        emit Conversion(_fromToken, _toToken, msg.sender, _amount, _returnAmount, int256(_feeAmount));
    }
}

Contract ABI
[{"constant":true,"inputs":[],"name":"BANCOR_CONVERTER_UPGRADER","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_connectorToken","type":"address"},{"name":"_weight","type":"uint32"},{"name":"_enableVirtualBalance","type":"bool"},{"name":"_virtualBalance","type":"uint256"}],"name":"updateConnector","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"connectors","outputs":[{"name":"virtualBalance","type":"uint256"},{"name":"weight","type":"uint32"},{"name":"isVirtualBalanceEnabled","type":"bool"},{"name":"isSaleEnabled","type":"bool"},{"name":"isSet","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"connectorTokens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BNT_TOKEN","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_fromToken","type":"address"},{"name":"_toToken","type":"address"},{"name":"_amount","type":"uint256"}],"name":"getReturn","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allowRegistryUpdate","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferTokenOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_block","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"quickConvertPrioritized","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_disable","type":"bool"}],"name":"disableConversions","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_REGISTRY","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fromToken","type":"address"},{"name":"_toToken","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"convertInternal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptTokenOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_magnitude","type":"uint8"}],"name":"getFinalAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"converterType","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_weight","type":"uint32"},{"name":"_enableVirtualBalance","type":"bool"}],"name":"addConnector","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"liquidate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"withdrawFromToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newManager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"manager","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"updateRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_whitelist","type":"address"}],"name":"setConversionWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_minReturn","type":"uint256"},{"name":"_conversionId","type":"uint256"},{"name":"_block","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"completeXConversion","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"conversionFee","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_CONVERTER_FACTORY","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_fromToken","type":"address"},{"name":"_toToken","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"change","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"prevRegistry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BNT_CONVERTER","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_FORMULA","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"connectorTokenCount","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_connectorToken","type":"address"},{"name":"_sellAmount","type":"uint256"}],"name":"getSaleReturn","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fromToken","type":"address"},{"name":"_toToken","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"convert","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"registry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_FEATURES","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_disable","type":"bool"}],"name":"disableTokenTransfers","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"claimTokensEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_fromConnectorToken","type":"address"},{"name":"_toConnectorToken","type":"address"},{"name":"_sellAmount","type":"uint256"}],"name":"getCrossConnectorReturn","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_NETWORK","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_GAS_PRICE_LIMIT","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONVERTER_CONVERSION_WHITELIST","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxConversionFee","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_connectorToken","type":"address"},{"name":"_disable","type":"bool"}],"name":"disableConnectorSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_connectorToken","type":"address"},{"name":"_depositAmount","type":"uint256"}],"name":"getPurchaseReturn","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_enable","type":"bool"}],"name":"enableClaimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"restoreRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"conversionsEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"conversionWhitelist","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_X","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptManagement","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"fund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_X_UPGRADER","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"upgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_connectorToken","type":"address"}],"name":"getConnectorBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newManager","type":"address"}],"name":"transferManagement","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_conversionFee","type":"uint32"}],"name":"setConversionFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"quickConvert","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_disable","type":"bool"}],"name":"disableRegistryUpdate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_amount","type":"uint256"}],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_registry","type":"address"},{"name":"_maxConversionFee","type":"uint32"},{"name":"_connectorToken","type":"address"},{"name":"_connectorWeight","type":"uint32"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_fromToken","type":"address"},{"indexed":true,"name":"_toToken","type":"address"},{"indexed":true,"name":"_trader","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_return","type":"uint256"},{"indexed":false,"name":"_conversionFee","type":"int256"}],"name":"Conversion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_connectorToken","type":"address"},{"indexed":false,"name":"_tokenSupply","type":"uint256"},{"indexed":false,"name":"_connectorBalance","type":"uint256"},{"indexed":false,"name":"_connectorWeight","type":"uint32"}],"name":"PriceDataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_prevFee","type":"uint32"},{"indexed":false,"name":"_newFee","type":"uint32"}],"name":"ConversionFeeUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_conversionsEnabled","type":"bool"}],"name":"ConversionsEnable","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_prevManager","type":"address"},{"indexed":true,"name":"_newManager","type":"address"}],"name":"ManagerUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_prevOwner","type":"address"},{"indexed":true,"name":"_newOwner","type":"address"}],"name":"OwnerUpdate","type":"event"}]

Contract Creation Code
6004805460a060020a61ffff021916740c000000000000000000000000000000000000000017905560c0604052600660808190527f62616e636f72000000000000000000000000000000000000000000000000000060a090815262000068916005919062000593565b506006805461ff001960ff19909116600117169055600b80546001606860020a0319166c01000000000000000000000000179055348015620000a957600080fd5b5060405160a08062004d168339810160409081528151602083015191830151606084015160809094015160008054600160a060020a03191633178155929491928580600160a060020a03811615156200010157600080fd5b5060028054600160a060020a03928316600160a060020a03199182161790915560038054909116331790558590811615156200013c57600080fd5b8460008163ffffffff16101580156200015e5750620f424063ffffffff821611155b15156200016a57600080fd5b60078054600160a060020a031916600160a060020a0389811691821792839055600680546201000060b060020a0319166201000090930292909217909155604080517fbb34534c0000000000000000000000000000000000000000000000000000000081527f436f6e747261637446656174757265730000000000000000000000000000000060048201529051929091169163bb34534c916024808201926020929091908290030181600087803b1580156200022557600080fd5b505af11580156200023a573d6000803e3d6000fd5b505050506040513d60208110156200025157600080fd5b50519250600160a060020a03831615620002e857604080517f2c7077c000000000000000000000000000000000000000000000000000000000815260016004820181905260248201529051600160a060020a03851691632c7077c091604480830192600092919082900301818387803b158015620002ce57600080fd5b505af1158015620002e3573d6000803e3d6000fd5b505050505b600b805467ffffffff00000000191664010000000063ffffffff891602179055600160a060020a038516156200032f576200032f858560006401000000006200033d810204565b505050505050505062000638565b600054600160a060020a031633146200035557600080fd5b600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b158015620003b557600080fd5b505af1158015620003ca573d6000803e3d6000fd5b505050506040513d6020811015620003e157600080fd5b5051600160a060020a03161415620003f857600080fd5b82600160a060020a03811615156200040f57600080fd5b83600160a060020a0381163014156200042757600080fd5b8360008163ffffffff16118015620004485750620f424063ffffffff821611155b15156200045457600080fd5b600254600160a060020a03878116911614801590620004995750600160a060020a0386166000908152600a60205260409020600101546601000000000000900460ff16155b8015620004b85750600b54620f424063ffffffff918216870190911611155b1515620004c457600080fd5b505050600160a060020a039092166000818152600a602052604081208181556001908101805466ff0000000000001965ff0000000000199715156401000000000264ff000000001963ffffffff808a1663ffffffff19958616179190911691909117989098166501000000000017166601000000000000179091556009805492830181559092527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018054600160a060020a031916909217909155600b80548085169093019093169116179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620005d657805160ff191683800117855562000606565b8280016001018555821562000606579182015b8281111562000606578251825591602001919060010190620005e9565b506200061492915062000618565b5090565b6200063591905b808211156200061457600081556001016200061f565b90565b6146ce80620006486000396000f3006080604052600436106102e75763ffffffff60e060020a6000350416630c87355e81146102ec5780630ca78923146103135780630e53aae91461034757806319b640151461039c5780631d000b61146103d05780631e1401f8146103e557806320d7d3671461042857806321e6b53d146104515780632274256414610472578063228d2820146104da57806325f9bfef146104f45780632a2e2f0c1461050957806338a5e016146105365780633aa0145a1461054b5780633e8ff43f146105695780633f4d2fc2146105f3578063415f12401461062257806341a5b33d1461063a5780634290602914610664578063481c6a751461067957806349d10b641461068e5780634af80f0e146106a357806350057351146106c457806354fd4d5014610739578063579cd3ca146107655780635a46f06c146107935780635e35359e146107a85780635e5144eb146107d257806361cd756e146107ff57806362614ae6146108145780636d7bd3fc1461082957806371f52bf31461083e57806372b44b2c1461085357806375892cf11461087757806379ba5097146108a45780637b103999146108b957806383315b6e146108ce57806385d5e631146108e35780638b34839f146108fd5780638da5cb5b146109125780638e3047e0146109275780639232494e146109515780639249993a1461096657806392d1abb71461097b57806394c275ad146109905780639e568553146109a5578063a2c4c336146109cb578063ad374f5b146109ef578063b4a176d314610a09578063bf75455814610a1e578063c45d3d9214610a33578063c4a8598e14610a48578063c8c2fe6c14610a5d578063ca1d209d14610a72578063cc97b38f14610a8a578063d4ee1d9014610a9f578063d55ec69714610ab4578063d895951214610ac9578063e4edf85214610aea578063ecbca55d14610b0b578063f0843ba914610b29578063f2fde38b14610b7a578063fa1c594e14610b9b578063fc0c546a14610bb5578063fe417fa514610bca575b600080fd5b3480156102f857600080fd5b50610301610bee565b60408051918252519081900360200190f35b34801561031f57600080fd5b50610345600160a060020a036004351663ffffffff602435166044351515606435610c00565b005b34801561035357600080fd5b50610368600160a060020a0360043516610d13565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156103a857600080fd5b506103b4600435610d59565b60408051600160a060020a039092168252519081900360200190f35b3480156103dc57600080fd5b50610301610d81565b3480156103f157600080fd5b5061040f600160a060020a0360043581169060243516604435610da5565b6040805192835260208301919091528051918290030190f35b34801561043457600080fd5b5061043d610e22565b604080519115158252519081900360200190f35b34801561045d57600080fd5b50610345600160a060020a0360043516610e2b565b6040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020830135926040810135925060ff606082013516915060808101359060a00135610ef5565b3480156104e657600080fd5b506103456004351515611257565b34801561050057600080fd5b50610301611316565b34801561051557600080fd5b50610301600160a060020a036004358116906024351660443560643561133a565b34801561054257600080fd5b50610345611816565b34801561055757600080fd5b5061030160043560ff6024351661189a565b34801561057557600080fd5b5061057e611904565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105b85781810151838201526020016105a0565b50505050905090810190601f1680156105e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105ff57600080fd5b50610345600160a060020a036004351663ffffffff602435166044351515611992565b34801561062e57600080fd5b50610345600435611bdc565b34801561064657600080fd5b50610345600160a060020a0360043581169060243516604435611e89565b34801561067057600080fd5b506103b4611f2a565b34801561068557600080fd5b506103b4611f39565b34801561069a57600080fd5b50610345611f48565b3480156106af57600080fd5b50610345600160a060020a036004351661208f565b3480156106d057600080fd5b506040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020830135926040810135925060ff606082013516915060808101359060a001356120e0565b34801561074557600080fd5b5061074e612584565b6040805161ffff9092168252519081900360200190f35b34801561077157600080fd5b5061077a6125a6565b6040805163ffffffff9092168252519081900360200190f35b34801561079f57600080fd5b506103016125be565b3480156107b457600080fd5b50610345600160a060020a03600435811690602435166044356125e2565b3480156107de57600080fd5b50610301600160a060020a0360043581169060243516604435606435612763565b34801561080b57600080fd5b506103b461277a565b34801561082057600080fd5b5061030161278f565b34801561083557600080fd5b506103016127b3565b34801561084a57600080fd5b5061074e6127c5565b34801561085f57600080fd5b5061040f600160a060020a03600435166024356127cc565b34801561088357600080fd5b50610301600160a060020a0360043581169060243516604435606435612ab0565b3480156108b057600080fd5b50610345612b51565b3480156108c557600080fd5b506103b4612bcc565b3480156108da57600080fd5b50610301612bdb565b3480156108ef57600080fd5b506103456004351515612bff565b34801561090957600080fd5b5061043d612c98565b34801561091e57600080fd5b506103b4612ca6565b34801561093357600080fd5b5061040f600160a060020a0360043581169060243516604435612cb5565b34801561095d57600080fd5b50610301612f74565b34801561097257600080fd5b50610301612f86565b34801561098757600080fd5b50610301612faa565b34801561099c57600080fd5b5061077a612faf565b3480156109b157600080fd5b50610345600160a060020a03600435166024351515612fc3565b3480156109d757600080fd5b5061040f600160a060020a036004351660243561304b565b3480156109fb57600080fd5b5061034560043515156132fc565b348015610a1557600080fd5b5061034561332d565b348015610a2a57600080fd5b5061043d613387565b348015610a3f57600080fd5b506103b46133a0565b348015610a5457600080fd5b506103016133af565b348015610a6957600080fd5b506103456133d3565b348015610a7e57600080fd5b50610345600435613450565b348015610a9657600080fd5b5061030161370a565b348015610aab57600080fd5b506103b461372e565b348015610ac057600080fd5b5061034561373d565b348015610ad557600080fd5b50610301600160a060020a036004351661386b565b348015610af657600080fd5b50610345600160a060020a036004351661396f565b348015610b1757600080fd5b5061034563ffffffff600435166139da565b6040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020909201359150613ac19050565b348015610b8657600080fd5b50610345600160a060020a0360043516613ad2565b348015610ba757600080fd5b506103456004351515613b26565b348015610bc157600080fd5b506103b4613b66565b348015610bd657600080fd5b50610345600160a060020a0360043516602435613b75565b60008051602061466383398151915281565b60008054600160a060020a03163314610c1857600080fd5b600160a060020a0385166000908152600a602052604090206001015485906601000000000000900460ff161515610c4e57600080fd5b8460008163ffffffff16118015610c6e5750620f424063ffffffff821611155b1515610c7957600080fd5b600160a060020a0387166000908152600a602052604090206001810154600b54919450620f424063ffffffff918216928216929092038801161115610cbd57600080fd5b5050600181018054600b805463ffffffff928316818416038801831663ffffffff199182161790915582549515156401000000000264ff0000000019929097169516949094179390931693909317909155905550565b600a602052600090815260409020805460019091015463ffffffff81169060ff640100000000820481169165010000000000810482169166010000000000009091041685565b6009805482908110610d6757fe5b600091825260209091200154600160a060020a0316905081565b7f424e54546f6b656e00000000000000000000000000000000000000000000000081565b600080600160a060020a038581169085161415610dc157600080fd5b600254600160a060020a0385811691161415610dea57610de1858461304b565b91509150610e1a565b600254600160a060020a0386811691161415610e0a57610de184846127cc565b610e15858585612cb5565b915091505b935093915050565b60065460ff1681565b600054600160a060020a03163314610e4257600080fd5b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050506040513d6020811015610ec957600080fd5b5051600054909150600160a060020a03808316911614610ee857600080fd5b610ef182613d07565b5050565b6000806000896000815181101515610f0957fe5b60209081029091018101516007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051929550600160a060020a039091169263bb34534c926024808401938290030181600087803b158015610f6f57600080fd5b505af1158015610f83573d6000803e3d6000fd5b505050506040513d6020811015610f9957600080fd5b5051905034151561112d57600254600160a060020a038381169116141561109d576002546040805160e060020a63a24835d1028152336004820152602481018c90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b15801561101057600080fd5b505af1158015611024573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152600160a060020a038681166004830152602482018f9052915191909216935063867904b49250604480830192600092919082900301818387803b15801561108057600080fd5b505af1158015611094573d6000803e3d6000fd5b5050505061112d565b6040805160e060020a6323b872dd028152336004820152600160a060020a038381166024830152604482018c90529151918416916323b872dd916064808201926020929091908290030181600087803b1580156110f957600080fd5b505af115801561110d573d6000803e3d6000fd5b505050506040513d602081101561112357600080fd5b5051151561112d57fe5b80600160a060020a031663b406d386348c8c8c338f8e8e8e8e6040518b63ffffffff1660e060020a02815260040180806020018a815260200189815260200188600160a060020a0316600160a060020a031681526020018781526020018681526020018560ff1660ff1681526020018460001916600019168152602001836000191660001916815260200182810382528b818151815260200191508051906020019060200280838360005b838110156111f05781810151838201526020016111d8565b505050509050019a50505050505050505050506020604051808303818588803b15801561121c57600080fd5b505af1158015611230573d6000803e3d6000fd5b50505050506040513d602081101561124757600080fd5b50519a9950505050505050505050565b600054600160a060020a031633148061127a5750600354600160a060020a031633145b151561128557600080fd5b600b5460ff6c01000000000000000000000000909104161515811515141561131357600b80546c01000000000000000000000000831581026cff000000000000000000000000199092169190911791829055604080519190920460ff161515815290517fb8e670608a57255ce4f35952b324cba70211a4200a91ce81d26e06d488c1f66b9181900360200190a15b50565b7f436f6e747261637452656769737472790000000000000000000000000000000081565b6007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051600092839283928392839283928392600160a060020a03169163bb34534c91602480830192602092919082900301818787803b1580156113a357600080fd5b505af11580156113b7573d6000803e3d6000fd5b505050506040513d60208110156113cd57600080fd5b5051905033600160a060020a038216146113e657600080fd5b600b546c01000000000000000000000000900460ff16151561140457fe5b876000811161141257600080fd5b600160a060020a038c8116908c16141561142b57600080fd5b600254600160a060020a038c8116911614156114535761144c8c8b8b613d85565b9750611807565b600254600160a060020a038d8116911614156114745761144c8b8b8b613fdf565b61147f8c8c8c612cb5565b909750955086158015906114935750888710155b151561149e57600080fd5b600160a060020a038c166000908152600a602052604090206001810154909550640100000000900460ff16156114e35784546114e0908b63ffffffff61439916565b85555b600160a060020a038b166000908152600a602052604090206001810154909450640100000000900460ff1615611528578354611525908863ffffffff6143b616565b84555b6115318b61386b565b925082871061153c57fe5b6040805160e060020a6323b872dd028152336004820152306024820152604481018c90529051600160a060020a038e16916323b872dd9160648083019260209291908290030181600087803b15801561159457600080fd5b505af11580156115a8573d6000803e3d6000fd5b505050506040513d60208110156115be57600080fd5b505115156115c857fe5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d169163a9059cbb9160448083019260209291908290030181600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b505050506040513d602081101561165a57600080fd5b5051151561166457fe5b6116718c8c8c8a8a6143cb565b8b600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156116dd57600080fd5b505af11580156116f1573d6000803e3d6000fd5b505050506040513d602081101561170757600080fd5b50516117128f61386b565b600189015460408051938452602084019290925263ffffffff1682820152519081900360600190a28a600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b505050506040513d60208110156117d057600080fd5b50516117db8e61386b565b600188015460408051938452602084019290925263ffffffff1682820152519081900360600190a28697505b50505050505050949350505050565b600054600160a060020a0316331461182d57600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166379ba50976040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561188057600080fd5b505af1158015611894573d6000803e3d6000fd5b50505050565b60006118fd8260ff16620f42400a67ffffffffffffffff166118f18460ff16600b60089054906101000a900463ffffffff1663ffffffff16620f4240030a67ffffffffffffffff168661444f90919063ffffffff16565b9063ffffffff61447d16565b9392505050565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561198a5780601f1061195f5761010080835404028352916020019161198a565b820191906000526020600020905b81548152906001019060200180831161196d57829003601f168201915b505050505081565b600054600160a060020a031633146119a957600080fd5b600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b158015611a0857600080fd5b505af1158015611a1c573d6000803e3d6000fd5b505050506040513d6020811015611a3257600080fd5b5051600160a060020a03161415611a4857600080fd5b82600160a060020a0381161515611a5e57600080fd5b83600160a060020a038116301415611a7557600080fd5b8360008163ffffffff16118015611a955750620f424063ffffffff821611155b1515611aa057600080fd5b600254600160a060020a03878116911614801590611ae45750600160a060020a0386166000908152600a60205260409020600101546601000000000000900460ff16155b8015611b025750600b54620f424063ffffffff918216870190911611155b1515611b0d57600080fd5b505050600160a060020a039092166000818152600a602052604081208181556001908101805466ff0000000000001965ff0000000000199715156401000000000264ff000000001963ffffffff808a1663ffffffff19958616179190911691909117989098166501000000000017166601000000000000179091556009805492830181559092527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018054600160a060020a031916909217909155600b80548085169093019093169116179055565b600b546000908190819081908190819063ffffffff16620f424014611c0057600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c5357600080fd5b505af1158015611c67573d6000803e3d6000fd5b505050506040513d6020811015611c7d57600080fd5b50516002546040805160e060020a63a24835d1028152336004820152602481018b90529051929850600160a060020a039091169163a24835d19160448082019260009290919082900301818387803b158015611cd857600080fd5b505af1158015611cec573d6000803e3d6000fd5b50505050600091505b60095461ffff83161015611e80576009805461ffff8416908110611d1557fe5b600091825260209091200154600160a060020a03169450611d358561386b565b9350611d4b866118f1898763ffffffff61444f16565b600160a060020a0386166000908152600a6020526040902060018101549194509150640100000000900460ff1615611d92578054611d8f908463ffffffff6143b616565b81555b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a0387169163a9059cbb9160448083019260209291908290030181600087803b158015611dfa57600080fd5b505af1158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b50511515611e2e57fe5b6001810154604080518989038152858703602082015263ffffffff9092168282015251600160a060020a03871691600080516020614683833981519152919081900360600190a2600190910190611cf5565b50505050505050565b600054600160a060020a03163314611ea057600080fd5b600254604080517f5e35359e000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015285811660248301526044820185905291519190921691635e35359e91606480830192600092919082900301818387803b158015611f1657600080fd5b505af1158015611e80573d6000803e3d6000fd5b600454600160a060020a031681565b600354600160a060020a031681565b60065460009060ff1680611f665750600054600160a060020a031633145b1515611f7157600080fd5b6007546040805160e260020a632ecd14d30281527f436f6e747261637452656769737472790000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015611fe157600080fd5b505af1158015611ff5573d6000803e3d6000fd5b505050506040513d602081101561200b57600080fd5b5051600754909150600160a060020a038083169116148015906120365750600160a060020a03811615155b151561204157600080fd5b600780546006805475ffffffffffffffffffffffffffffffffffffffff00001916600160a060020a03808416620100000291909117909155600160a060020a03199091169216919091179055565b600054600160a060020a031633146120a657600080fd5b80600160a060020a0381163014156120bd57600080fd5b5060088054600160a060020a031916600160a060020a0392909216919091179055565b6007546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051600092839283928392600160a060020a03169163bb34534c91602480830192602092919082900301818787803b15801561215557600080fd5b505af1158015612169573d6000803e3d6000fd5b505050506040513d602081101561217f57600080fd5b50516007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051929550600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b1580156121e257600080fd5b505af11580156121f6573d6000803e3d6000fd5b505050506040513d602081101561220c57600080fd5b50516007546040805160e260020a632ecd14d30281527f424e54546f6b656e00000000000000000000000000000000000000000000000060048201529051929450600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b15801561228157600080fd5b505af1158015612295573d6000803e3d6000fd5b505050506040513d60208110156122ab57600080fd5b50518b51600160a060020a03909116908c9060009081106122c857fe5b60209081029091010151600160a060020a0316146122e557600080fd5b604080517faafd6b76000000000000000000000000000000000000000000000000000000008152600481018b90523360248201529051600160a060020a0385169163aafd6b769160448083019260209291908290030181600087803b15801561234d57600080fd5b505af1158015612361573d6000803e3d6000fd5b505050506040513d602081101561237757600080fd5b50516002546040805160e060020a63a24835d1028152336004820152602481018490529051929350600160a060020a039091169163a24835d19160448082019260009290919082900301818387803b1580156123d257600080fd5b505af11580156123e6573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152600160a060020a03878116600483015260248201879052915191909216935063867904b49250604480830192600092919082900301818387803b15801561244257600080fd5b505af1158015612456573d6000803e3d6000fd5b5050505081600160a060020a031663b406d3868c838d338e8e8e8e8e6040518a63ffffffff1660e060020a02815260040180806020018a815260200189815260200188600160a060020a0316600160a060020a031681526020018781526020018681526020018560ff1660ff1681526020018460001916600019168152602001836000191660001916815260200182810382528b818151815260200191508051906020019060200280838360005b8381101561251c578181015183820152602001612504565b505050509050019a5050505050505050505050602060405180830381600087803b15801561254957600080fd5b505af115801561255d573d6000803e3d6000fd5b505050506040513d602081101561257357600080fd5b50519b9a5050505050505050505050565b60045474010000000000000000000000000000000000000000900461ffff1681565b600b5468010000000000000000900463ffffffff1681565b7f42616e636f72436f6e766572746572466163746f72790000000000000000000081565b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b15801561263f57600080fd5b505af1158015612653573d6000803e3d6000fd5b505050506040513d602081101561266957600080fd5b5051600160a060020a0385166000908152600a60205260409020600101549091506601000000000000900460ff1615806127355750600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b1580156126fd57600080fd5b505af1158015612711573d6000803e3d6000fd5b505050506040513d602081101561272757600080fd5b5051600160a060020a031614155b8061274d5750600054600160a060020a038281169116145b151561275857600080fd5b6118948484846144a0565b60006127718585858561133a565b95945050505050565b600654620100009004600160a060020a031681565b7f424e54436f6e766572746572000000000000000000000000000000000000000081565b60008051602061462383398151915281565b6009545b90565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561283557600080fd5b505af1158015612849573d6000803e3d6000fd5b505050506040513d602081101561285f57600080fd5b5051600160a060020a03161461287457600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff1615156128aa57600080fd5b600160a060020a03808c166000908152600a6020908152604080832060025482517f18160ddd0000000000000000000000000000000000000000000000000000000081529251919c50909416936318160ddd93600480840194938390030190829087803b15801561291a57600080fd5b505af115801561292e573d6000803e3d6000fd5b505050506040513d602081101561294457600080fd5b505195506129518b61386b565b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b1580156129b257600080fd5b505af11580156129c6573d6000803e3d6000fd5b505050506040513d60208110156129dc57600080fd5b50516001880154604080517f49f9b0f7000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916349f9b0f7916084808201926020929091908290030181600087803b158015612a6357600080fd5b505af1158015612a77573d6000803e3d6000fd5b505050506040513d6020811015612a8d57600080fd5b50519250612a9c83600161189a565b9b928c90039a509198505050505050505050565b60408051606081018252600160a060020a03808716825260025481166020830152851691810191909152600090612aeb90600c906003614599565b50612771600c805480602002602001604051908101604052809291908181526020018280548015612b4557602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311612b27575b50505050508484613ac1565b600154600160a060020a03163314612b6857600080fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a36001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600754600160a060020a031681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b600054600160a060020a03163314612c1657600080fd5b600254604080517f1608f18f00000000000000000000000000000000000000000000000000000000815283151560048201529051600160a060020a0390921691631608f18f9160248082019260009290919082900301818387803b158015612c7d57600080fd5b505af1158015612c91573d6000803e3d6000fd5b5050505050565b600654610100900460ff1681565b600054600160a060020a031681565b600080600080600080600030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612d1d57600080fd5b505af1158015612d31573d6000803e3d6000fd5b505050506040513d6020811015612d4757600080fd5b5051600160a060020a031614612d5c57600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff161515612d9257600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff161515612dc857600080fd5b600160a060020a038c81166000908152600a6020526040808220928e16825290206001820154919850965065010000000000900460ff161515612e0a57600080fd5b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015612e6857600080fd5b505af1158015612e7c573d6000803e3d6000fd5b505050506040513d6020811015612e9257600080fd5b50519450600160a060020a0385166365098bb3612eae8e61386b565b60018a015463ffffffff16612ec28f61386b565b60018b01546040805163ffffffff87811660e060020a028252600482019690965293851660248501526044840192909252929092166064820152608481018e9052905160a48083019260209291908290030181600087803b158015612f2657600080fd5b505af1158015612f3a573d6000803e3d6000fd5b505050506040513d6020811015612f5057600080fd5b50519350612f5f84600261189a565b9c938d90039b50929950505050505050505050565b60008051602061464383398151915281565b7f42616e636f7247617350726963654c696d69740000000000000000000000000081565b600181565b600b54640100000000900463ffffffff1681565b600054600160a060020a03163314612fda57600080fd5b600160a060020a0382166000908152600a602052604090206001015482906601000000000000900460ff16151561301057600080fd5b50600160a060020a03919091166000908152600a60205260409020600101805465ff0000000000191691156501000000000002919091179055565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156130b457600080fd5b505af11580156130c8573d6000803e3d6000fd5b505050506040513d60208110156130de57600080fd5b5051600160a060020a0316146130f357600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff16151561312957600080fd5b600160a060020a038b166000908152600a60205260409020600181015490975065010000000000900460ff16151561316057600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156131b357600080fd5b505af11580156131c7573d6000803e3d6000fd5b505050506040513d60208110156131dd57600080fd5b505195506131ea8b61386b565b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b15801561324b57600080fd5b505af115801561325f573d6000803e3d6000fd5b505050506040513d602081101561327557600080fd5b50516001880154604080517f29a00e7c000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916329a00e7c916084808201926020929091908290030181600087803b158015612a6357600080fd5b600054600160a060020a0316331461331357600080fd5b600680549115156101000261ff0019909216919091179055565b600054600160a060020a03163314806133505750600354600160a060020a031633145b151561335b57600080fd5b6006805460078054600160a060020a031916600160a060020a036201000084041617905560ff19169055565b600b546c01000000000000000000000000900460ff1681565b600854600160a060020a031681565b7f42616e636f72580000000000000000000000000000000000000000000000000081565b600454600160a060020a031633146133ea57600080fd5b600454600354604051600160a060020a0392831692909116907fbe4cc281795971a471c980e842627a7f1ea3892ddfce8c5b6357cd2611c1973290600090a36004805460038054600160a060020a0319908116600160a060020a03841617909155169055565b600b546000908190819081908190819063ffffffff16620f42401461347457600080fd5b600b546c01000000000000000000000000900460ff16151561349257fe5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156134e557600080fd5b505af11580156134f9573d6000803e3d6000fd5b505050506040513d602081101561350f57600080fd5b50519550600091505b60095461ffff83161015613693576009805461ffff841690811061353857fe5b600091825260209091200154600160a060020a031694506135588561386b565b935061356e866118f1898763ffffffff61444f16565b600160a060020a0386166000908152600a6020526040902060018101549194509150640100000000900460ff16156135b55780546135b2908463ffffffff61439916565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018590529051600160a060020a038716916323b872dd9160648083019260209291908290030181600087803b15801561360d57600080fd5b505af1158015613621573d6000803e3d6000fd5b505050506040513d602081101561363757600080fd5b5051151561364157fe5b600181015460408051888a018152868601602082015263ffffffff9092168282015251600160a060020a03871691600080516020614683833981519152919081900360600190a2600190910190613518565b6002546040805160e260020a63219e412d028152336004820152602481018a90529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b1580156136e957600080fd5b505af11580156136fd573d6000803e3d6000fd5b5050505050505050505050565b7f42616e636f72585570677261646572000000000000000000000000000000000081565b600154600160a060020a031681565b60008054600160a060020a0316331461375557600080fd5b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b1580156137b357600080fd5b505af11580156137c7573d6000803e3d6000fd5b505050506040513d60208110156137dd57600080fd5b505190506137ea81613ad2565b80600160a060020a03166390f58c96600460149054906101000a900461ffff166040518263ffffffff1660e060020a028152600401808261ffff1661ffff168152602001915050600060405180830381600087803b15801561384b57600080fd5b505af115801561385f573d6000803e3d6000fd5b50505050611313612b51565b600160a060020a0381166000908152600a6020526040812060010154819083906601000000000000900460ff1615156138a357600080fd5b600160a060020a0384166000908152600a602052604090206001810154909250640100000000900460ff1661396457604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038616916370a082319160248083019260209291908290030181600087803b15801561393357600080fd5b505af1158015613947573d6000803e3d6000fd5b505050506040513d602081101561395d57600080fd5b5051613967565b81545b949350505050565b600054600160a060020a03163314806139925750600354600160a060020a031633145b151561399d57600080fd5b600354600160a060020a03828116911614156139b857600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314806139fd5750600354600160a060020a031633145b1515613a0857600080fd5b8060008163ffffffff1610158015613a345750600b5463ffffffff640100000000909104811690821611155b1515613a3f57600080fd5b600b546040805163ffffffff6801000000000000000090930483168152918416602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a150600b805463ffffffff90921668010000000000000000026bffffffff000000000000000019909216919091179055565b600061396784848484808080610ef5565b600054600160a060020a03163314613ae957600080fd5b600054600160a060020a0382811691161415613b0457600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a0316331480613b495750600354600160a060020a031633145b1515613b5457600080fd5b6006805460ff19169115919091179055565b600254600160a060020a031681565b600654600090610100900460ff161515613b8e57600080fd5b6007546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015613bfe57600080fd5b505af1158015613c12573d6000803e3d6000fd5b505050506040513d6020811015613c2857600080fd5b5051905033600160a060020a03821614613c4157600080fd5b6002546040805160e060020a63a24835d1028152600160a060020a038681166004830152602482018690529151919092169163a24835d191604480830192600092919082900301818387803b158015613c9957600080fd5b505af1158015613cad573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152336004820152602481018790529051600160a060020a03909216935063867904b4925060448082019260009290919082900301818387803b158015611f1657600080fd5b600054600160a060020a03163314613d1e57600080fd5b600254604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b158015612c7d57600080fd5b600080600080613d95878761304b565b90935091508215801590613da95750848310155b1515613db457600080fd5b50600160a060020a0386166000908152600a602052604090206001810154640100000000900460ff1615613df7578054613df4908763ffffffff61439916565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a038916916323b872dd9160648083019260209291908290030181600087803b158015613e4f57600080fd5b505af1158015613e63573d6000803e3d6000fd5b505050506040513d6020811015613e7957600080fd5b50511515613e8357fe5b6002546040805160e260020a63219e412d028152336004820152602481018690529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b158015613ed957600080fd5b505af1158015613eed573d6000803e3d6000fd5b5050600254613f0b9250899150600160a060020a03168886866143cb565b86600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613f7757600080fd5b505af1158015613f8b573d6000803e3d6000fd5b505050506040513d6020811015613fa157600080fd5b5051613fac8a61386b565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a2509095945050505050565b600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905160009283928392839283928392600160a060020a03909216916370a082319160248082019260209290919082900301818787803b15801561405157600080fd5b505af1158015614065573d6000803e3d6000fd5b505050506040513d602081101561407b57600080fd5b505188111561408957600080fd5b61409389896127cc565b909550935084158015906140a75750868510155b15156140b257600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561410557600080fd5b505af1158015614119573d6000803e3d6000fd5b505050506040513d602081101561412f57600080fd5b5051925061413c8961386b565b9150818510806141555750818514801561415557508288145b151561415d57fe5b50600160a060020a0388166000908152600a602052604090206001810154640100000000900460ff16156141a057805461419d908663ffffffff6143b616565b81555b6002546040805160e060020a63a24835d1028152336004820152602481018b90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b1580156141f657600080fd5b505af115801561420a573d6000803e3d6000fd5b5050604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d16935063a9059cbb925060448083019260209291908290030181600087803b15801561427657600080fd5b505af115801561428a573d6000803e3d6000fd5b505050506040513d60208110156142a057600080fd5b505115156142aa57fe5b6002546142c390600160a060020a03168a8a88886143cb565b88600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561432f57600080fd5b505af1158015614343573d6000803e3d6000fd5b505050506040513d602081101561435957600080fd5b50516143648c61386b565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a25092979650505050505050565b6000828201838110156143ab57600080fd5b8091505b5092915050565b6000818310156143c557600080fd5b50900390565b7f80000000000000000000000000000000000000000000000000000000000000008111156143f557fe5b604080518481526020810184905280820183905290513391600160a060020a0387811692908916917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb919081900360600190a45050505050565b60008083151561446257600091506143af565b5082820282848281151561447257fe5b04146143ab57600080fd5b60008080831161448c57600080fd5b828481151561449757fe5b04949350505050565b600054600160a060020a031633146144b757600080fd5b82600160a060020a03811615156144cd57600080fd5b82600160a060020a03811615156144e357600080fd5b83600160a060020a0381163014156144fa57600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561455d57600080fd5b505af1158015614571573d6000803e3d6000fd5b505050506040513d602081101561458757600080fd5b5051151561459157fe5b505050505050565b8280548282559060005260206000209081019282156145ee579160200282015b828111156145ee5782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906145b9565b506145fa9291506145fe565b5090565b6127c991905b808211156145fa578054600160a060020a0319168155600101614604560042616e636f72466f726d756c610000000000000000000000000000000000000042616e636f724e6574776f726b0000000000000000000000000000000000000042616e636f72436f6e76657274657255706772616465720000000000000000008a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788a165627a7a72305820e93622f34bf989ef0685ad017400ad7bfa2ba06cf1843cf9e545980baf2290e4002900000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd400000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd4000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002710


   Swarm Source:
bzzr://e93622f34bf989ef0685ad017400ad7bfa2ba06cf1843cf9e545980baf2290e4
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.