Contract 0x9e8f95969ab023c36541bc089e25d50c6fcf0811

 

TxHash Block Age From To Value [TxFee]
0xf386a0cd1c14b697c08a68facd9ef69ffb561994cb69b182d7bcd9720d0da35b741239913 mins ago0xef599ec4e1510b220cba211d97456defeaeceb01 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002372192
0x3c64cc373458b08348318c074ae7e0825cca9e1dc375fa00bca0a2a4a692a703741236520 mins ago0x95332f025dbf4ca932c202a8b9a6bcb6701b77a8 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.00242068
0x25669a36f1cc9a5cd8f4074653e3aa30394c890ff66e276e614108fd6669f6f674119342 hrs 4 mins ago0x488c3eca67729f23e6d024a7f86cf3dcc21e7462 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002419544
0x76522471a766649957f051421c49b5bd3c7fa4b7588abeb8b54d97a716d7ca4f74119032 hrs 11 mins ago0xa3d6b6d6d80906d823f4d89af19c2af59c504f6d IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002253216
0x283cd5a2af12c536bb9b616a44620ea8b65757b3e1ff93356f700f042513599374118572 hrs 19 mins ago0x74ed60ce346ccb5ee5f71b81d5e6a671e57711d7 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002542728
0xb2cecc23114d59792fa0cecb6b41c7f0210e302746c5c5baa199ac4e7a5176e774116763 hrs 1 min ago0x45edb83057cde1e61e275d8dbfa8b0bb22f4a6b1 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001267532
0x7d72bba6bdc413cb30194d39298b87378ee2e0f90396fc752a70107d76e8e2ca74115343 hrs 33 mins ago0x049a0418e782080e1e1e8541ce95d92a5f0e16cc IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002217733
0x61ebe0925ba73e14c55bf50a5e97d344a3b97a0aae8b72875e032f049aaca10774110395 hrs 20 mins ago0x4ba44e8a5de02935ff68543d2be580f4b6fb8a7b IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.00296524
0x8ce9628cb22059f6b9d84993d0cadea222badbd61ec714d10471f97ba7ce6bb474108146 hrs 12 mins ago0x00a183fdbebce39cc1065b14b1015cea3b40b651 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002053264
0x093160befa000e131795af33762f346c3eba58097b2e3b9353e4a873f47df92474102198 hrs 34 mins ago0xef599ec4e1510b220cba211d97456defeaeceb01 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002075668
0x5ef9990306eff85331257d65786914f9fec11075e99c856afdd2982191ffa27474098959 hrs 44 mins ago0x09086a772d9e9b99380e2735bf4ff3dec3ead8f5 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002074772
0x93b2acdf8ebdb4dff474b226309e2fb4d420dd3132907bd8e7c4cb22cb05a255740983210 hrs ago0x049a0418e782080e1e1e8541ce95d92a5f0e16cc IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002218181
0x25970732b9a06b4a67c90f07c43e0bca083e2d891e7e833cfd80bb6195eda67d740976910 hrs 14 mins ago0x8c3b8446d3065190e1c22a45ee379cec1e1dd8c9 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002075668
0x5ab2cc428f8443dbdac2a508b7fa7dc8ff62c0d0f007493b3f1b99d4a247b07a740971810 hrs 30 mins ago0xabc6df3c401faf815d680bb5e417db47102a1f80 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.002075668
0x46f2e0c3aeb1fedfaf97185f8c93aa39a237a94ba1e52e0256310a31dae6d829740899813 hrs 4 mins ago0xb1a8f9e6dbf33f98b7673882333fbba817399cab IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001278044
0x88641d9912bd1cc7afdcfeb4c89cea04b52e9ee79348da5fc583c9d168960bec740889813 hrs 28 mins ago0xb1a8f9e6dbf33f98b7673882333fbba817399cab IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001278044
0x478600e20571e76851f141f8afc87d830c224a9cdec351df3d6436f3d861a2c7740883213 hrs 44 mins ago0xabc6df3c401faf815d680bb5e417db47102a1f80 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001186096
0x79c29c08fa7143839ca5b693e10ed4289c4e83cae19fa9c42b6707a34011222f740805216 hrs 36 mins ago0x5e4b61220039823aef8a54efbe47773194494f77 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001270596
0x8731899ae2f8f0f37f1c4efe84b834a79df1f4cbb63543d9f2d5bf731888d641740801416 hrs 44 mins ago0xef599ec4e1510b220cba211d97456defeaeceb01 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001185584
0x068cd5031e84651c124c57337f4b9b7b97d296de29b7cb5de07a8053a62ad1b1740798716 hrs 49 mins ago0x09086a772d9e9b99380e2735bf4ff3dec3ead8f5 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.00118584
0xde483cca4955867086535459e3e9f4bf755b44226be1303ebd23e4d6010768c9740798316 hrs 50 mins ago0x6c48082fe02975cadf093988bc8497190cc13235 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001126096
0x430c68536b42b08900ba9e57f8e12fcfbbf1d35741dbb9ac0139776f0a973bb6740772817 hrs 46 mins ago0xef599ec4e1510b220cba211d97456defeaeceb01 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.00118584
0x3623835c837524aefff67805528b45c922e0282a49ef3f9c2ceed44ab0550823740739319 hrs ago0xa15b3a98dd7ef7cdfa8bd89914bdd9ed61b96542 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001186096
0xb25fd17c10c0507b26b442e23ef55ffe23ab3851a89f49ce502c02c1a18c8c6a740735019 hrs 11 mins ago0x4ba44e8a5de02935ff68543d2be580f4b6fb8a7b IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.001350524
0x581cf3f70a8baa432467b6032a1de2c45ba51d691edda9b5446b490a87ec7c66740733919 hrs 13 mins ago0xef599ec4e1510b220cba211d97456defeaeceb01 IN  0x9e8f95969ab023c36541bc089e25d50c6fcf08110 Ether0.00118584
[ 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
0x05475ab04f60ceaaa3dbddfe6c45e97c82717df6e7808a33f6a5cfee448cef3e740972110 hrs 30 mins ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db4.5 Ether
0x05475ab04f60ceaaa3dbddfe6c45e97c82717df6e7808a33f6a5cfee448cef3e740972110 hrs 30 mins ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08114.5 Ether
0x9b264d6c7dcd255e2004565ebaa6b238acc1f5a461cf2e3318bac25ed454f36974046111 day 5 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db4.75 Ether
0x9b264d6c7dcd255e2004565ebaa6b238acc1f5a461cf2e3318bac25ed454f36974046111 day 5 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08114.75 Ether
0xf28184c23536a9516cba2a1ec35b92b24b8a305e33b9e51211a368b0156949b874027571 day 12 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db4.75 Ether
0xf28184c23536a9516cba2a1ec35b92b24b8a305e33b9e51211a368b0156949b874027571 day 12 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08114.75 Ether
0x7090c680e5895f450770ca1174ee6405c4744c1785720aa6b99458b02fcf61df74027411 day 12 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db0.5 Ether
0x7090c680e5895f450770ca1174ee6405c4744c1785720aa6b99458b02fcf61df74027411 day 12 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08110.5 Ether
0xc017239713ada49b90d078412655583dfce0527873b508cae15b41690d43793a73993862 days 47 mins ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db7.5 Ether
0xc017239713ada49b90d078412655583dfce0527873b508cae15b41690d43793a73993862 days 47 mins ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08117.5 Ether
0x6c937980e3bc002e4cc0be8b5762175e2b13ec7ea8463ba193076f03abdd823b73987772 days 3 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db4.75 Ether
0x6c937980e3bc002e4cc0be8b5762175e2b13ec7ea8463ba193076f03abdd823b73987772 days 3 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08114.75 Ether
0xf09197009275c348fd18b1fe35b4e3e67d3c20ad34780027132e7d47718f14a273976642 days 7 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db2.25 Ether
0xf09197009275c348fd18b1fe35b4e3e67d3c20ad34780027132e7d47718f14a273976642 days 7 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08112.25 Ether
0x7bc981c3f65de486703c3db66b6e8bdcbe5d1a4bca60f550dfd155ad4e0c61b273939402 days 21 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db2.25 Ether
0x7bc981c3f65de486703c3db66b6e8bdcbe5d1a4bca60f550dfd155ad4e0c61b273939402 days 21 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08112.25 Ether
0xf76a9afee2a5a53973372ca4fc17b4638251351fff8b39ceb8fb0e4339b707d873926023 days 2 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db4.75 Ether
0xf76a9afee2a5a53973372ca4fc17b4638251351fff8b39ceb8fb0e4339b707d873926023 days 2 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08114.75 Ether
0xd663896e885e0416ff8638440915213e7ec8e8e88e1b1e4fabc10f63811c3c3673925203 days 2 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db9.5 Ether
0xd663896e885e0416ff8638440915213e7ec8e8e88e1b1e4fabc10f63811c3c3673925203 days 2 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08119.5 Ether
0x74c5ed2035066c313ffc23131a2673f91fd87ccade7901be75a1b8b9590330ed73924293 days 2 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db9.5 Ether
0x74c5ed2035066c313ffc23131a2673f91fd87ccade7901be75a1b8b9590330ed73924293 days 2 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08119.5 Ether
0xe19d0dc80f58f1fd58a3f419693583282b49892c2cfb1e8fd57196ef521b974f73920783 days 4 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db7.75 Ether
0xe19d0dc80f58f1fd58a3f419693583282b49892c2cfb1e8fd57196ef521b974f73920783 days 4 hrs ago0x40ddbf3bde9c33661c8b4a4e9045ee7ade9e71020x9e8f95969ab023c36541bc089e25d50c6fcf08117.75 Ether
0xff644c29dab81a5b0b0274ae5910773d73b7a5aed53eff0e266730daf434f58173920723 days 4 hrs ago0x9e8f95969ab023c36541bc089e25d50c6fcf08110x6690819cb98c1211a8e38790d6cd48316ed518db1.25 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 0x7eb741fb3812000afb71278b53241efb07b5d8b9

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;
}

// 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 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";

    // Ids of BNT converter and BNT token
    bytes32 public constant BNT_TOKEN = "BNTToken";
    bytes32 public constant BNT_CONVERTER = "BNTConverter";

    // Id of BancorX contract
    bytes32 public constant BANCOR_X = "BancorX";
}

// 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));
        _;
    }

    // Overflow protected math functions

    /**
        @dev returns the sum of _x and _y, asserts if the calculation overflows

        @param _x   value 1
        @param _y   value 2

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

    /**
        @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number

        @param _x   minuend
        @param _y   subtrahend

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

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

        @param _x   factor 1
        @param _y   factor 2

        @return product
    */
    function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }
}

// 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/converter/BancorConverter.sol

/*
    Bancor Converter v0.11

    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 {
    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 isPurchaseEnabled;         // is purchase of the smart token enabled with the connector, can be set by the owner
        bool isSet;                     // used to tell if the mapping element is defined
    }

    bytes32 public version = '0.11';
    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 safeMul(_amount, (MAX_CONVERSION_FEE - conversionFee) ** _magnitude) / 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(bancorX, _amount);
    }

    /**
        @dev upgrades the converter to the latest version
        can only be called by the owner
        note that the owner needs to call acceptOwnership 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].isPurchaseEnabled = 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 purchasing with the given connector token in case the connector token got compromised
        can only be called by the owner
        note that selling 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 disableConnectorPurchases(IERC20Token _connectorToken, bool _disable)
        public
        ownerOnly
        validConnector(_connectorToken)
    {
        connectors[_connectorToken].isPurchaseEnabled = !_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.isPurchaseEnabled); // 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(toConnector.isPurchaseEnabled); // 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 = safeAdd(fromConnector.virtualBalance, _amount);

        // update the target token virtual balance if relevant
        Connector storage toConnector = connectors[_toToken];
        if (toConnector.isVirtualBalanceEnabled)
            toConnector.virtualBalance = safeSub(toConnector.virtualBalance, 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 = safeAdd(connector.virtualBalance, _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 = safeSub(connector.virtualBalance, 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
        validConversionPath(_path)
        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
        validConversionPath(_path)
        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.convertForPrioritized2.value(msg.value)(_path, _amount, _minReturn, msg.sender, _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 = safeMul(_amount, connectorBalance) / supply;

            // update virtual balance if relevant
            Connector storage connector = connectors[connectorToken];
            if (connector.isVirtualBalanceEnabled)
                connector.virtualBalance = safeAdd(connector.virtualBalance, 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 = safeMul(_amount, connectorBalance) / supply;

            // update virtual balance if relevant
            Connector storage connector = connectors[connectorToken];
            if (connector.isVirtualBalanceEnabled)
                connector.virtualBalance = safeSub(connector.virtualBalance, 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":"isPurchaseEnabled","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":"_connectorToken","type":"address"},{"name":"_disable","type":"bool"}],"name":"disableConnectorPurchases","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"bytes32"}],"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":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":"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

7f302e31310000000000000000000000000000000000000000000000000000000060055560c0604052600660808190527f62616e636f72000000000000000000000000000000000000000000000000000060a0908152620000629190816200058d565b506007805461ff001960ff19909116600117169055600c80546001606860020a0319166c01000000000000000000000000179055348015620000a357600080fd5b5060405160a080620048008339810160409081528151602083015191830151606084015160809094015160008054600160a060020a03191633178155929491928580600160a060020a0381161515620000fb57600080fd5b5060028054600160a060020a03928316600160a060020a03199182161790915560038054909116331790558590811615156200013657600080fd5b8460008163ffffffff1610158015620001585750620f424063ffffffff821611155b15156200016457600080fd5b60088054600160a060020a031916600160a060020a0389811691821792839055600780546201000060b060020a0319166201000090930292909217909155604080517fbb34534c0000000000000000000000000000000000000000000000000000000081527f436f6e747261637446656174757265730000000000000000000000000000000060048201529051929091169163bb34534c916024808201926020929091908290030181600087803b1580156200021f57600080fd5b505af115801562000234573d6000803e3d6000fd5b505050506040513d60208110156200024b57600080fd5b50519250600160a060020a03831615620002e257604080517f2c7077c000000000000000000000000000000000000000000000000000000000815260016004820181905260248201529051600160a060020a03851691632c7077c091604480830192600092919082900301818387803b158015620002c857600080fd5b505af1158015620002dd573d6000803e3d6000fd5b505050505b600c805467ffffffff00000000191664010000000063ffffffff891602179055600160a060020a038516156200032957620003298585600064010000000062000337810204565b505050505050505062000632565b600054600160a060020a031633146200034f57600080fd5b600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b158015620003af57600080fd5b505af1158015620003c4573d6000803e3d6000fd5b505050506040513d6020811015620003db57600080fd5b5051600160a060020a03161415620003f257600080fd5b82600160a060020a03811615156200040957600080fd5b83600160a060020a0381163014156200042157600080fd5b8360008163ffffffff16118015620004425750620f424063ffffffff821611155b15156200044e57600080fd5b600254600160a060020a03878116911614801590620004935750600160a060020a0386166000908152600b60205260409020600101546601000000000000900460ff16155b8015620004b25750600c54620f424063ffffffff918216870190911611155b1515620004be57600080fd5b505050600160a060020a039092166000818152600b602052604081208181556001908101805466ff0000000000001965ff0000000000199715156401000000000264ff000000001963ffffffff808a1663ffffffff1995861617919091169190911798909816650100000000001716660100000000000017909155600a805492830181559092527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8018054600160a060020a031916909217909155600c80548085169093019093169116179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620005d057805160ff191683800117855562000600565b8280016001018555821562000600579182015b8281111562000600578251825591602001919060010190620005e3565b506200060e92915062000612565b5090565b6200062f91905b808211156200060e576000815560010162000619565b90565b6141be80620006426000396000f3006080604052600436106102d15763ffffffff60e060020a6000350416630c87355e81146102d65780630ca78923146102fd5780630e53aae91461033157806319b64015146103865780631d000b61146103ba5780631e1401f8146103cf57806320d7d3671461041257806321e6b53d1461043b578063227425641461045c578063228d2820146104c457806325f9bfef146104de5780632a2e2f0c146104f357806338a5e016146105205780633aa0145a146105355780633e8ff43f146105535780633f4d2fc2146105dd578063415f12401461060c57806341a5b33d14610624578063429060291461064e578063481c6a751461066357806349d10b64146106785780634af80f0e1461068d578063514385be146106ae57806354fd4d50146106d4578063579cd3ca146106e95780635a46f06c146107175780635e35359e1461072c5780635e5144eb1461075657806361cd756e1461078357806362614ae6146107985780636d7bd3fc146107ad57806371f52bf3146107c257806372b44b2c146107ee57806375892cf11461081257806379ba50971461083f5780637b1039991461085457806383315b6e1461086957806385d5e6311461087e5780638b34839f146108985780638da5cb5b146108ad5780638e3047e0146108c25780639232494e146108ec5780639249993a1461090157806392d1abb71461091657806394c275ad1461092b578063a2c4c33614610940578063ad374f5b14610964578063b4a176d31461097e578063bf75455814610993578063c45d3d92146109a8578063c4a8598e146109bd578063c8c2fe6c146109d2578063ca1d209d146109e7578063d4ee1d90146109ff578063d55ec69714610a14578063d895951214610a29578063e4edf85214610a4a578063ecbca55d14610a6b578063f0843ba914610a89578063f2fde38b14610ada578063fa1c594e14610afb578063fc0c546a14610b15578063fe417fa514610b2a575b600080fd5b3480156102e257600080fd5b506102eb610b4e565b60408051918252519081900360200190f35b34801561030957600080fd5b5061032f600160a060020a036004351663ffffffff602435166044351515606435610b60565b005b34801561033d57600080fd5b50610352600160a060020a0360043516610c73565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b34801561039257600080fd5b5061039e600435610cb9565b60408051600160a060020a039092168252519081900360200190f35b3480156103c657600080fd5b506102eb610ce1565b3480156103db57600080fd5b506103f9600160a060020a0360043581169060243516604435610d05565b6040805192835260208301919091528051918290030190f35b34801561041e57600080fd5b50610427610d82565b604080519115158252519081900360200190f35b34801561044757600080fd5b5061032f600160a060020a0360043516610d8b565b604080516020600480358082013583810280860185019096528085526102eb95369593946024949385019291829185019084908082843750949750508435955050506020830135926040810135925060ff606082013516915060808101359060a00135610e55565b3480156104d057600080fd5b5061032f6004351515611212565b3480156104ea57600080fd5b506102eb6112d1565b3480156104ff57600080fd5b506102eb600160a060020a03600435811690602435166044356064356112f5565b34801561052c57600080fd5b5061032f6117d7565b34801561054157600080fd5b506102eb60043560ff6024351661185b565b34801561055f57600080fd5b506105686118b7565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105a257818101518382015260200161058a565b50505050905090810190601f1680156105cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105e957600080fd5b5061032f600160a060020a036004351663ffffffff602435166044351515611945565b34801561061857600080fd5b5061032f600435611b8f565b34801561063057600080fd5b5061032f600160a060020a0360043581169060243516604435611e39565b34801561065a57600080fd5b5061039e611eda565b34801561066f57600080fd5b5061039e611ee9565b34801561068457600080fd5b5061032f611ef8565b34801561069957600080fd5b5061032f600160a060020a036004351661203f565b3480156106ba57600080fd5b5061032f600160a060020a03600435166024351515612090565b3480156106e057600080fd5b506102eb612118565b3480156106f557600080fd5b506106fe61211e565b6040805163ffffffff9092168252519081900360200190f35b34801561072357600080fd5b506102eb612136565b34801561073857600080fd5b5061032f600160a060020a036004358116906024351660443561215a565b34801561076257600080fd5b506102eb600160a060020a03600435811690602435166044356064356122db565b34801561078f57600080fd5b5061039e6122f2565b3480156107a457600080fd5b506102eb612307565b3480156107b957600080fd5b506102eb61232b565b3480156107ce57600080fd5b506107d761233d565b6040805161ffff9092168252519081900360200190f35b3480156107fa57600080fd5b506103f9600160a060020a0360043516602435612344565b34801561081e57600080fd5b506102eb600160a060020a0360043581169060243516604435606435612628565b34801561084b57600080fd5b5061032f6126c9565b34801561086057600080fd5b5061039e612744565b34801561087557600080fd5b506102eb612753565b34801561088a57600080fd5b5061032f6004351515612777565b3480156108a457600080fd5b50610427612810565b3480156108b957600080fd5b5061039e61281e565b3480156108ce57600080fd5b506103f9600160a060020a036004358116906024351660443561282d565b3480156108f857600080fd5b506102eb612aec565b34801561090d57600080fd5b506102eb612b10565b34801561092257600080fd5b506102eb612b34565b34801561093757600080fd5b506106fe612b39565b34801561094c57600080fd5b506103f9600160a060020a0360043516602435612b4d565b34801561097057600080fd5b5061032f6004351515612dfe565b34801561098a57600080fd5b5061032f612e2f565b34801561099f57600080fd5b50610427612e89565b3480156109b457600080fd5b5061039e612ea2565b3480156109c957600080fd5b506102eb612eb1565b3480156109de57600080fd5b5061032f612ed5565b3480156109f357600080fd5b5061032f600435612f52565b348015610a0b57600080fd5b5061039e61321f565b348015610a2057600080fd5b5061032f61322e565b348015610a3557600080fd5b506102eb600160a060020a036004351661335f565b348015610a5657600080fd5b5061032f600160a060020a0360043516613463565b348015610a7757600080fd5b5061032f63ffffffff600435166134ce565b604080516020600480358082013583810280860185019096528085526102eb953695939460249493850192918291850190849080828437509497505084359550505060209092013591506135b59050565b348015610ae657600080fd5b5061032f600160a060020a03600435166135f7565b348015610b0757600080fd5b5061032f600435151561364b565b348015610b2157600080fd5b5061039e61368b565b348015610b3657600080fd5b5061032f600160a060020a036004351660243561369a565b60008051602061415383398151915281565b60008054600160a060020a03163314610b7857600080fd5b600160a060020a0385166000908152600b602052604090206001015485906601000000000000900460ff161515610bae57600080fd5b8460008163ffffffff16118015610bce5750620f424063ffffffff821611155b1515610bd957600080fd5b600160a060020a0387166000908152600b602052604090206001810154600c54919450620f424063ffffffff918216928216929092038801161115610c1d57600080fd5b5050600181018054600c805463ffffffff928316818416038801831663ffffffff199182161790915582549515156401000000000264ff0000000019929097169516949094179390931693909317909155905550565b600b602052600090815260409020805460019091015463ffffffff81169060ff640100000000820481169165010000000000810482169166010000000000009091041685565b600a805482908110610cc757fe5b600091825260209091200154600160a060020a0316905081565b7f424e54546f6b656e00000000000000000000000000000000000000000000000081565b600080600160a060020a038581169085161415610d2157600080fd5b600254600160a060020a0385811691161415610d4a57610d418584612b4d565b91509150610d7a565b600254600160a060020a0386811691161415610d6a57610d418484612344565b610d7585858561282d565b915091505b935093915050565b60075460ff1681565b600054600160a060020a03163314610da257600080fd5b6008546040805160e260020a632ecd14d302815260008051602061415383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b158015610dff57600080fd5b505af1158015610e13573d6000803e3d6000fd5b505050506040513d6020811015610e2957600080fd5b5051600054909150600160a060020a03808316911614610e4857600080fd5b610e5182613844565b5050565b60008060008960028151118015610e6e57506015815111155b8015610e7f57508051600290066001145b1515610e8a57600080fd5b8a6000815181101515610e9957fe5b60209081029091018101516008546040805160e260020a632ecd14d30281527f42616e636f724e6574776f726b0000000000000000000000000000000000000060048201529051929650600160a060020a039091169263bb34534c926024808401938290030181600087803b158015610f1157600080fd5b505af1158015610f25573d6000803e3d6000fd5b505050506040513d6020811015610f3b57600080fd5b505191503415156110ef57600254600160a060020a038481169116141561105f576002546040805160e060020a63a24835d1028152336004820152602481018d90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b158015610fb257600080fd5b505af1158015610fc6573d6000803e3d6000fd5b50505050600260009054906101000a9004600160a060020a0316600160a060020a031663867904b4838c6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b15801561104257600080fd5b505af1158015611056573d6000803e3d6000fd5b505050506110ef565b6040805160e060020a6323b872dd028152336004820152600160a060020a038481166024830152604482018d90529151918516916323b872dd916064808201926020929091908290030181600087803b1580156110bb57600080fd5b505af11580156110cf573d6000803e3d6000fd5b505050506040513d60208110156110e557600080fd5b505115156110ef57fe5b81600160a060020a0316636b08f2ef348d8d8d338e8e8e8e6040518a63ffffffff1660e060020a028152600401808060200189815260200188815260200187600160a060020a0316600160a060020a031681526020018681526020018560ff1660ff1681526020018460001916600019168152602001836000191660001916815260200182810382528a818151815260200191508051906020019060200280838360005b838110156111ab578181015183820152602001611193565b5050505090500199505050505050505050506020604051808303818588803b1580156111d657600080fd5b505af11580156111ea573d6000803e3d6000fd5b50505050506040513d602081101561120157600080fd5b50519b9a5050505050505050505050565b600054600160a060020a03163314806112355750600354600160a060020a031633145b151561124057600080fd5b600c5460ff6c0100000000000000000000000090910416151581151514156112ce57600c80546c01000000000000000000000000831581026cff000000000000000000000000199092169190911791829055604080519190920460ff161515815290517fb8e670608a57255ce4f35952b324cba70211a4200a91ce81d26e06d488c1f66b9181900360200190a15b50565b7f436f6e747261637452656769737472790000000000000000000000000000000081565b6008546040805160e260020a632ecd14d30281527f42616e636f724e6574776f726b0000000000000000000000000000000000000060048201529051600092839283928392839283928392600160a060020a03169163bb34534c91602480830192602092919082900301818787803b15801561137057600080fd5b505af1158015611384573d6000803e3d6000fd5b505050506040513d602081101561139a57600080fd5b5051905033600160a060020a038216146113b357600080fd5b600c546c01000000000000000000000000900460ff1615156113d157fe5b87600081116113df57600080fd5b600160a060020a038c8116908c1614156113f857600080fd5b600254600160a060020a038c811691161415611420576114198c8b8b6138c2565b97506117c8565b600254600160a060020a038d811691161415611441576114198b8b8b613b2c565b61144c8c8c8c61282d565b909750955086158015906114605750888710155b151561146b57600080fd5b600160a060020a038c166000908152600b602052604090206001810154909550640100000000900460ff16156114aa5784546114a7908b613ee0565b85555b600160a060020a038b166000908152600b602052604090206001810154909450640100000000900460ff16156114e95783546114e69088613ef6565b84555b6114f28b61335f565b92508287106114fd57fe5b6040805160e060020a6323b872dd028152336004820152306024820152604481018c90529051600160a060020a038e16916323b872dd9160648083019260209291908290030181600087803b15801561155557600080fd5b505af1158015611569573d6000803e3d6000fd5b505050506040513d602081101561157f57600080fd5b5051151561158957fe5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d169163a9059cbb9160448083019260209291908290030181600087803b1580156115f157600080fd5b505af1158015611605573d6000803e3d6000fd5b505050506040513d602081101561161b57600080fd5b5051151561162557fe5b6116328c8c8c8a8a613f08565b8b600160a060020a0316600080516020614173833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561169e57600080fd5b505af11580156116b2573d6000803e3d6000fd5b505050506040513d60208110156116c857600080fd5b50516116d38f61335f565b600189015460408051938452602084019290925263ffffffff1682820152519081900360600190a28a600160a060020a0316600080516020614173833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561176757600080fd5b505af115801561177b573d6000803e3d6000fd5b505050506040513d602081101561179157600080fd5b505161179c8e61335f565b600188015460408051938452602084019290925263ffffffff1682820152519081900360600190a28697505b50505050505050949350505050565b600054600160a060020a031633146117ee57600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166379ba50976040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561184157600080fd5b505af1158015611855573d6000803e3d6000fd5b50505050565b60008160ff16620f42400a67ffffffffffffffff166118a6848460ff16600c60089054906101000a900463ffffffff1663ffffffff16620f4240030a67ffffffffffffffff16613f8c565b8115156118af57fe5b049392505050565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561193d5780601f106119125761010080835404028352916020019161193d565b820191906000526020600020905b81548152906001019060200180831161192057829003601f168201915b505050505081565b600054600160a060020a0316331461195c57600080fd5b600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b1580156119bb57600080fd5b505af11580156119cf573d6000803e3d6000fd5b505050506040513d60208110156119e557600080fd5b5051600160a060020a031614156119fb57600080fd5b82600160a060020a0381161515611a1157600080fd5b83600160a060020a038116301415611a2857600080fd5b8360008163ffffffff16118015611a485750620f424063ffffffff821611155b1515611a5357600080fd5b600254600160a060020a03878116911614801590611a975750600160a060020a0386166000908152600b60205260409020600101546601000000000000900460ff16155b8015611ab55750600c54620f424063ffffffff918216870190911611155b1515611ac057600080fd5b505050600160a060020a039092166000818152600b602052604081208181556001908101805466ff0000000000001965ff0000000000199715156401000000000264ff000000001963ffffffff808a1663ffffffff1995861617919091169190911798909816650100000000001716660100000000000017909155600a805492830181559092527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8018054600160a060020a031916909217909155600c80548085169093019093169116179055565b600c546000908190819081908190819063ffffffff16620f424014611bb357600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c0657600080fd5b505af1158015611c1a573d6000803e3d6000fd5b505050506040513d6020811015611c3057600080fd5b50516002546040805160e060020a63a24835d1028152336004820152602481018b90529051929850600160a060020a039091169163a24835d19160448082019260009290919082900301818387803b158015611c8b57600080fd5b505af1158015611c9f573d6000803e3d6000fd5b50505050600091505b600a5461ffff83161015611e3057600a805461ffff8416908110611cc857fe5b600091825260209091200154600160a060020a03169450611ce88561335f565b935085611cf58886613f8c565b811515611cfe57fe5b600160a060020a0387166000908152600b6020526040902060018101549290910494509150640100000000900460ff1615611d42578054611d3f9084613ef6565b81555b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a0387169163a9059cbb9160448083019260209291908290030181600087803b158015611daa57600080fd5b505af1158015611dbe573d6000803e3d6000fd5b505050506040513d6020811015611dd457600080fd5b50511515611dde57fe5b6001810154604080518989038152858703602082015263ffffffff9092168282015251600160a060020a03871691600080516020614173833981519152919081900360600190a2600190910190611ca8565b50505050505050565b600054600160a060020a03163314611e5057600080fd5b600254604080517f5e35359e000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015285811660248301526044820185905291519190921691635e35359e91606480830192600092919082900301818387803b158015611ec657600080fd5b505af1158015611e30573d6000803e3d6000fd5b600454600160a060020a031681565b600354600160a060020a031681565b60075460009060ff1680611f165750600054600160a060020a031633145b1515611f2157600080fd5b6008546040805160e260020a632ecd14d30281527f436f6e747261637452656769737472790000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015611f9157600080fd5b505af1158015611fa5573d6000803e3d6000fd5b505050506040513d6020811015611fbb57600080fd5b5051600854909150600160a060020a03808316911614801590611fe65750600160a060020a03811615155b1515611ff157600080fd5b600880546007805475ffffffffffffffffffffffffffffffffffffffff00001916600160a060020a03808416620100000291909117909155600160a060020a03199091169216919091179055565b600054600160a060020a0316331461205657600080fd5b80600160a060020a03811630141561206d57600080fd5b5060098054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a031633146120a757600080fd5b600160a060020a0382166000908152600b602052604090206001015482906601000000000000900460ff1615156120dd57600080fd5b50600160a060020a03919091166000908152600b60205260409020600101805465ff0000000000191691156501000000000002919091179055565b60055481565b600c5468010000000000000000900463ffffffff1681565b7f42616e636f72436f6e766572746572466163746f72790000000000000000000081565b6008546040805160e260020a632ecd14d302815260008051602061415383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506040513d60208110156121e157600080fd5b5051600160a060020a0385166000908152600b60205260409020600101549091506601000000000000900460ff1615806122ad5750600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b15801561227557600080fd5b505af1158015612289573d6000803e3d6000fd5b505050506040513d602081101561229f57600080fd5b5051600160a060020a031614155b806122c55750600054600160a060020a038281169116145b15156122d057600080fd5b611855848484613fb0565b60006122e9858585856112f5565b95945050505050565b600754620100009004600160a060020a031681565b7f424e54436f6e766572746572000000000000000000000000000000000000000081565b60008051602061413383398151915281565b600a545b90565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156123ad57600080fd5b505af11580156123c1573d6000803e3d6000fd5b505050506040513d60208110156123d757600080fd5b5051600160a060020a0316146123ec57600080fd5b600160a060020a038a166000908152600b60205260409020600101548a906601000000000000900460ff16151561242257600080fd5b600160a060020a03808c166000908152600b6020908152604080832060025482517f18160ddd0000000000000000000000000000000000000000000000000000000081529251919c50909416936318160ddd93600480840194938390030190829087803b15801561249257600080fd5b505af11580156124a6573d6000803e3d6000fd5b505050506040513d60208110156124bc57600080fd5b505195506124c98b61335f565b6008546040805160e260020a632ecd14d302815260008051602061413383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b15801561252a57600080fd5b505af115801561253e573d6000803e3d6000fd5b505050506040513d602081101561255457600080fd5b50516001880154604080517f49f9b0f7000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916349f9b0f7916084808201926020929091908290030181600087803b1580156125db57600080fd5b505af11580156125ef573d6000803e3d6000fd5b505050506040513d602081101561260557600080fd5b5051925061261483600161185b565b9b928c90039a509198505050505050505050565b60408051606081018252600160a060020a0380871682526002548116602083015285169181019190915260009061266390600d9060036140a9565b506122e9600d8054806020026020016040519081016040528092919081815260200182805480156126bd57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161269f575b505050505084846135b5565b600154600160a060020a031633146126e057600080fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a36001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600854600160a060020a031681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b600054600160a060020a0316331461278e57600080fd5b600254604080517f1608f18f00000000000000000000000000000000000000000000000000000000815283151560048201529051600160a060020a0390921691631608f18f9160248082019260009290919082900301818387803b1580156127f557600080fd5b505af1158015612809573d6000803e3d6000fd5b5050505050565b600754610100900460ff1681565b600054600160a060020a031681565b600080600080600080600030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561289557600080fd5b505af11580156128a9573d6000803e3d6000fd5b505050506040513d60208110156128bf57600080fd5b5051600160a060020a0316146128d457600080fd5b600160a060020a038a166000908152600b60205260409020600101548a906601000000000000900460ff16151561290a57600080fd5b600160a060020a038a166000908152600b60205260409020600101548a906601000000000000900460ff16151561294057600080fd5b600160a060020a038c81166000908152600b6020526040808220928e16825290206001810154919850965065010000000000900460ff16151561298257600080fd5b6008546040805160e260020a632ecd14d302815260008051602061413383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b1580156129e057600080fd5b505af11580156129f4573d6000803e3d6000fd5b505050506040513d6020811015612a0a57600080fd5b50519450600160a060020a0385166365098bb3612a268e61335f565b60018a015463ffffffff16612a3a8f61335f565b60018b01546040805163ffffffff87811660e060020a028252600482019690965293851660248501526044840192909252929092166064820152608481018e9052905160a48083019260209291908290030181600087803b158015612a9e57600080fd5b505af1158015612ab2573d6000803e3d6000fd5b505050506040513d6020811015612ac857600080fd5b50519350612ad784600261185b565b9c938d90039b50929950505050505050505050565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b7f42616e636f7247617350726963654c696d69740000000000000000000000000081565b600181565b600c54640100000000900463ffffffff1681565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612bb657600080fd5b505af1158015612bca573d6000803e3d6000fd5b505050506040513d6020811015612be057600080fd5b5051600160a060020a031614612bf557600080fd5b600160a060020a038a166000908152600b60205260409020600101548a906601000000000000900460ff161515612c2b57600080fd5b600160a060020a038b166000908152600b60205260409020600181015490975065010000000000900460ff161515612c6257600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612cb557600080fd5b505af1158015612cc9573d6000803e3d6000fd5b505050506040513d6020811015612cdf57600080fd5b50519550612cec8b61335f565b6008546040805160e260020a632ecd14d302815260008051602061413383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b158015612d4d57600080fd5b505af1158015612d61573d6000803e3d6000fd5b505050506040513d6020811015612d7757600080fd5b50516001880154604080517f29a00e7c000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916329a00e7c916084808201926020929091908290030181600087803b1580156125db57600080fd5b600054600160a060020a03163314612e1557600080fd5b600780549115156101000261ff0019909216919091179055565b600054600160a060020a0316331480612e525750600354600160a060020a031633145b1515612e5d57600080fd5b6007805460088054600160a060020a031916600160a060020a036201000084041617905560ff19169055565b600c546c01000000000000000000000000900460ff1681565b600954600160a060020a031681565b7f42616e636f72580000000000000000000000000000000000000000000000000081565b600454600160a060020a03163314612eec57600080fd5b600454600354604051600160a060020a0392831692909116907fbe4cc281795971a471c980e842627a7f1ea3892ddfce8c5b6357cd2611c1973290600090a36004805460038054600160a060020a0319908116600160a060020a03841617909155169055565b600c546000908190819081908190819063ffffffff16620f424014612f7657600080fd5b600c546c01000000000000000000000000900460ff161515612f9457fe5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612fe757600080fd5b505af1158015612ffb573d6000803e3d6000fd5b505050506040513d602081101561301157600080fd5b50519550600091505b600a5461ffff8316101561319257600a805461ffff841690811061303a57fe5b600091825260209091200154600160a060020a0316945061305a8561335f565b9350856130678886613f8c565b81151561307057fe5b600160a060020a0387166000908152600b6020526040902060018101549290910494509150640100000000900460ff16156130b45780546130b19084613ee0565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018590529051600160a060020a038716916323b872dd9160648083019260209291908290030181600087803b15801561310c57600080fd5b505af1158015613120573d6000803e3d6000fd5b505050506040513d602081101561313657600080fd5b5051151561314057fe5b600181015460408051888a018152868601602082015263ffffffff9092168282015251600160a060020a03871691600080516020614173833981519152919081900360600190a260019091019061301a565b600254604080517f867904b4000000000000000000000000000000000000000000000000000000008152336004820152602481018a90529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b1580156131fe57600080fd5b505af1158015613212573d6000803e3d6000fd5b5050505050505050505050565b600154600160a060020a031681565b60008054600160a060020a0316331461324657600080fd5b6008546040805160e260020a632ecd14d302815260008051602061415383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b1580156132a457600080fd5b505af11580156132b8573d6000803e3d6000fd5b505050506040513d60208110156132ce57600080fd5b505190506132db816135f7565b600554604080517fbc444e13000000000000000000000000000000000000000000000000000000008152600481019290925251600160a060020a0383169163bc444e1391602480830192600092919082900301818387803b15801561333f57600080fd5b505af1158015613353573d6000803e3d6000fd5b505050506112ce6126c9565b600160a060020a0381166000908152600b6020526040812060010154819083906601000000000000900460ff16151561339757600080fd5b600160a060020a0384166000908152600b602052604090206001810154909250640100000000900460ff1661345857604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038616916370a082319160248083019260209291908290030181600087803b15801561342757600080fd5b505af115801561343b573d6000803e3d6000fd5b505050506040513d602081101561345157600080fd5b505161345b565b81545b949350505050565b600054600160a060020a03163314806134865750600354600160a060020a031633145b151561349157600080fd5b600354600160a060020a03828116911614156134ac57600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314806134f15750600354600160a060020a031633145b15156134fc57600080fd5b8060008163ffffffff16101580156135285750600c5463ffffffff640100000000909104811690821611155b151561353357600080fd5b600c546040805163ffffffff6801000000000000000090930483168152918416602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a150600c805463ffffffff90921668010000000000000000026bffffffff000000000000000019909216919091179055565b600083600281511180156135cb57506015815111155b80156135dc57508051600290066001145b15156135e757600080fd5b6122e98585856000808080610e55565b600054600160a060020a0316331461360e57600080fd5b600054600160a060020a038281169116141561362957600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a031633148061366e5750600354600160a060020a031633145b151561367957600080fd5b6007805460ff19169115919091179055565b600254600160a060020a031681565b600754600090610100900460ff1615156136b357600080fd5b6008546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561372357600080fd5b505af1158015613737573d6000803e3d6000fd5b505050506040513d602081101561374d57600080fd5b5051905033600160a060020a0382161461376657600080fd5b6002546040805160e060020a63a24835d1028152600160a060020a038681166004830152602482018690529151919092169163a24835d191604480830192600092919082900301818387803b1580156137be57600080fd5b505af11580156137d2573d6000803e3d6000fd5b5050600254604080517f867904b4000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015260248201889052915191909216935063867904b49250604480830192600092919082900301818387803b158015611ec657600080fd5b600054600160a060020a0316331461385b57600080fd5b600254604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b1580156127f557600080fd5b6000806000806138d28787612b4d565b909350915082158015906138e65750848310155b15156138f157600080fd5b50600160a060020a0386166000908152600b602052604090206001810154640100000000900460ff161561392e57805461392b9087613ee0565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a038916916323b872dd9160648083019260209291908290030181600087803b15801561398657600080fd5b505af115801561399a573d6000803e3d6000fd5b505050506040513d60208110156139b057600080fd5b505115156139ba57fe5b600254604080517f867904b4000000000000000000000000000000000000000000000000000000008152336004820152602481018690529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b158015613a2657600080fd5b505af1158015613a3a573d6000803e3d6000fd5b5050600254613a589250899150600160a060020a0316888686613f08565b86600160a060020a0316600080516020614173833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613ac457600080fd5b505af1158015613ad8573d6000803e3d6000fd5b505050506040513d6020811015613aee57600080fd5b5051613af98a61335f565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a2509095945050505050565b600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905160009283928392839283928392600160a060020a03909216916370a082319160248082019260209290919082900301818787803b158015613b9e57600080fd5b505af1158015613bb2573d6000803e3d6000fd5b505050506040513d6020811015613bc857600080fd5b5051881115613bd657600080fd5b613be08989612344565b90955093508415801590613bf45750868510155b1515613bff57600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613c5257600080fd5b505af1158015613c66573d6000803e3d6000fd5b505050506040513d6020811015613c7c57600080fd5b50519250613c898961335f565b915081851080613ca257508185148015613ca257508288145b1515613caa57fe5b50600160a060020a0388166000908152600b602052604090206001810154640100000000900460ff1615613ce7578054613ce49086613ef6565b81555b6002546040805160e060020a63a24835d1028152336004820152602481018b90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b158015613d3d57600080fd5b505af1158015613d51573d6000803e3d6000fd5b5050604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d16935063a9059cbb925060448083019260209291908290030181600087803b158015613dbd57600080fd5b505af1158015613dd1573d6000803e3d6000fd5b505050506040513d6020811015613de757600080fd5b50511515613df157fe5b600254613e0a90600160a060020a03168a8a8888613f08565b88600160a060020a0316600080516020614173833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613e7657600080fd5b505af1158015613e8a573d6000803e3d6000fd5b505050506040513d6020811015613ea057600080fd5b5051613eab8c61335f565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a25092979650505050505050565b600082820183811015613eef57fe5b9392505050565b600081831015613f0257fe5b50900390565b7f8000000000000000000000000000000000000000000000000000000000000000811115613f3257fe5b604080518481526020810184905280820183905290513391600160a060020a0387811692908916917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb919081900360600190a45050505050565b6000828202831580613fa85750828482811515613fa557fe5b04145b1515613eef57fe5b600054600160a060020a03163314613fc757600080fd5b82600160a060020a0381161515613fdd57600080fd5b82600160a060020a0381161515613ff357600080fd5b83600160a060020a03811630141561400a57600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561406d57600080fd5b505af1158015614081573d6000803e3d6000fd5b505050506040513d602081101561409757600080fd5b505115156140a157fe5b505050505050565b8280548282559060005260206000209081019282156140fe579160200282015b828111156140fe5782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906140c9565b5061410a92915061410e565b5090565b61234191905b8082111561410a578054600160a060020a0319168155600101614114560042616e636f72466f726d756c610000000000000000000000000000000000000042616e636f72436f6e76657274657255706772616465720000000000000000008a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788a165627a7a723058208adda2e9e204d9435c93c8e584b431ded1f8b39a256b071340f8827eb179f9c90029000000000000000000000000b7813b63600909e3a1df6dacf3bda76bd1c7d7bc00000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd400000000000000000000000000000000000000000000000000000000000027100000000000000000000000001f573d6fb3f13d689ff844b4ce37794d79a7ff1c00000000000000000000000000000000000000000000000000000000000186a0

Swarm Source

bzzr://8adda2e9e204d9435c93c8e584b431ded1f8b39a256b071340f8827eb179f9c9
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.