ETH Price: $2,447.01 (+1.19%)

Contract

0xCBc6a023eb975a1e2630223a7959988948E664f3
 
Transaction Hash
Method
Block
From
To
Quick Convert89698502019-11-20 18:18:331783 days ago1574273913IN
0xCBc6a023...948E664f3
0 ETH0.000093531
Quick Convert89647852019-11-19 22:03:181783 days ago1574200998IN
0xCBc6a023...948E664f3
0 ETH0.000233011
Quick Convert Pr...89153772019-11-11 16:19:331792 days ago1573489173IN
0xCBc6a023...948E664f3
1.1 ETH0.0015381620
Quick Convert Pr...89153772019-11-11 16:19:331792 days ago1573489173IN
0xCBc6a023...948E664f3
1.1 ETH0.0015381620
Quick Convert Pr...89153772019-11-11 16:19:331792 days ago1573489173IN
0xCBc6a023...948E664f3
1.1 ETH0.0015368820
Quick Convert Pr...89153772019-11-11 16:19:331792 days ago1573489173IN
0xCBc6a023...948E664f3
1.1 ETH0.0015381620
Quick Convert Pr...89153482019-11-11 16:11:511792 days ago1573488711IN
0xCBc6a023...948E664f3
0.92 ETH0.0015368820
Quick Convert Pr...89153382019-11-11 16:09:441792 days ago1573488584IN
0xCBc6a023...948E664f3
1.3 ETH0.0015399620
Quick Convert89144792019-11-11 12:44:331792 days ago1573476273IN
0xCBc6a023...948E664f3
0.76458483 ETH0.0053114918
Quick Convert89144792019-11-11 12:44:331792 days ago1573476273IN
0xCBc6a023...948E664f3
0.36771692 ETH0.0053089718
Quick Convert89144782019-11-11 12:44:011792 days ago1573476241IN
0xCBc6a023...948E664f3
0.49216886 ETH0.0053114918
Quick Convert89144782019-11-11 12:44:011792 days ago1573476241IN
0xCBc6a023...948E664f3
0.36706804 ETH0.0053089718
Quick Convert89144762019-11-11 12:43:471792 days ago1573476227IN
0xCBc6a023...948E664f3
0.63106843 ETH0.0053114918
Quick Convert89144762019-11-11 12:43:471792 days ago1573476227IN
0xCBc6a023...948E664f3
0.51776222 ETH0.0053089718
Quick Convert Pr...89144752019-11-11 12:43:431792 days ago1573476223IN
0xCBc6a023...948E664f3
1 ETH0.0085115420
Upgrade89144742019-11-11 12:42:151792 days ago1573476135IN
0xCBc6a023...948E664f3
0 ETH0.093967920
Quick Convert89144072019-11-11 12:25:481792 days ago1573475148IN
0xCBc6a023...948E664f3
0.9 ETH0.006913218
Quick Convert Pr...89142872019-11-11 11:59:481792 days ago1573473588IN
0xCBc6a023...948E664f3
0.01 ETH0.000076771
Quick Convert Pr...89142752019-11-11 11:58:281792 days ago1573473508IN
0xCBc6a023...948E664f3
0.7 ETH0.0068185620
Quick Convert Pr...89142602019-11-11 11:54:311792 days ago1573473271IN
0xCBc6a023...948E664f3
0.5131041 ETH0.006804820
Quick Convert Pr...89142232019-11-11 11:45:131792 days ago1573472713IN
0xCBc6a023...948E664f3
0.28378368 ETH0.006822420
Quick Convert Pr...89142012019-11-11 11:39:561792 days ago1573472396IN
0xCBc6a023...948E664f3
0.28270595 ETH0.0068211220
Accept Ownership89141982019-11-11 11:39:451792 days ago1573472385IN
0xCBc6a023...948E664f3
0 ETH0.0004827824
Quick Convert Pr...89141492019-11-11 11:28:501792 days ago1573471730IN
0xCBc6a023...948E664f3
0.06353 ETH0.006812720
Quick Convert Pr...89141292019-11-11 11:25:311792 days ago1573471531IN
0xCBc6a023...948E664f3
0.122593 ETH0.006812720
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
93604642020-01-26 23:30:131715 days ago1580081413
0xCBc6a023...948E664f3
137.645826 ETH
93604642020-01-26 23:30:131715 days ago1580081413
0xCBc6a023...948E664f3
137.645826 ETH
93583432020-01-26 15:43:211716 days ago1580053401
0xCBc6a023...948E664f3
135.9637399 ETH
93583432020-01-26 15:43:211716 days ago1580053401
0xCBc6a023...948E664f3
135.9637399 ETH
93416452020-01-24 1:59:561718 days ago1579831196
0xCBc6a023...948E664f3
61.19384729 ETH
93416452020-01-24 1:59:561718 days ago1579831196
0xCBc6a023...948E664f3
61.19384729 ETH
93355422020-01-23 3:46:461719 days ago1579751206
0xCBc6a023...948E664f3
13.3864674 ETH
93355422020-01-23 3:46:461719 days ago1579751206
0xCBc6a023...948E664f3
13.3864674 ETH
93343102020-01-22 23:17:101719 days ago1579735030
0xCBc6a023...948E664f3
66.72208163 ETH
93343102020-01-22 23:17:101719 days ago1579735030
0xCBc6a023...948E664f3
66.72208163 ETH
93327762020-01-22 17:33:231720 days ago1579714403
0xCBc6a023...948E664f3
13.26878952 ETH
93327762020-01-22 17:33:231720 days ago1579714403
0xCBc6a023...948E664f3
13.26878952 ETH
93277942020-01-21 23:07:331720 days ago1579648053
0xCBc6a023...948E664f3
13.08824305 ETH
93277942020-01-21 23:07:331720 days ago1579648053
0xCBc6a023...948E664f3
13.08824305 ETH
93277852020-01-21 23:05:551720 days ago1579647955
0xCBc6a023...948E664f3
13.05952016 ETH
93277852020-01-21 23:05:551720 days ago1579647955
0xCBc6a023...948E664f3
13.05952016 ETH
92918772020-01-16 11:13:551726 days ago1579173235
0xCBc6a023...948E664f3
0.06718074 ETH
92918772020-01-16 11:13:551726 days ago1579173235
0xCBc6a023...948E664f3
0.06718074 ETH
92083402020-01-03 16:13:281739 days ago1578068008
0xCBc6a023...948E664f3
0.00166266 ETH
92083402020-01-03 16:13:281739 days ago1578068008
0xCBc6a023...948E664f3
0.00166266 ETH
91480452019-12-22 23:49:251750 days ago1577058565
0xCBc6a023...948E664f3
0.00753938 ETH
91480452019-12-22 23:49:251750 days ago1577058565
0xCBc6a023...948E664f3
0.00753938 ETH
91479362019-12-22 23:22:281750 days ago1577056948
0xCBc6a023...948E664f3
0.00745987 ETH
91479362019-12-22 23:22:281750 days ago1577056948
0xCBc6a023...948E664f3
0.00745987 ETH
91439942019-12-22 4:30:021751 days ago1576989002
0xCBc6a023...948E664f3
0.495 ETH
View All Internal Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x804033Aa...D9C900c45
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
BancorConverter

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-01-27
*/

pragma solidity ^0.4.24;

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

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

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

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

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

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

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

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

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

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

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

// File: contracts/IBancorNetwork.sol

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

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

// File: contracts/ContractIds.sol

/**
    Id definitions for bancor contracts

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

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

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

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

// File: contracts/FeatureIds.sol

/**
    Id definitions for bancor contract features

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

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

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

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

// File: contracts/utility/Owned.sol

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

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

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

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

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

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

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

// File: contracts/utility/Managed.sol

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

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

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

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

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

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

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

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

// File: contracts/utility/Utils.sol

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

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

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

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

}

// File: contracts/utility/SafeMath.sol

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

        @param _x   value 1
        @param _y   value 2

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

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

        @param _x   minuend
        @param _y   subtrahend

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

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

        @param _x   factor 1
        @param _y   factor 2

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

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

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

        @param _x   dividend
        @param _y   divisor

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

        return c;
    }
}

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

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

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

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

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

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

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

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

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

// File: contracts/utility/TokenHolder.sol

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

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

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

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

// File: contracts/token/SmartTokenController.sol

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// File: contracts/converter/BancorConverter.sol

/*
    Bancor Converter v12

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

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

    The converter is upgradable (just like any SmartTokenController).

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

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

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

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

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

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

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

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

    /**
        @dev constructor

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

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

        maxConversionFee = _maxConversionFee;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        @param _connectorToken  connector token contract address

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        uint256 amount;
        uint256 feeAmount;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
        @dev helper, dispatches the Conversion event

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

Contract Security Audit

Contract ABI

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

Deployed Bytecode

0x6080604052600436106102e75763ffffffff60e060020a6000350416630c87355e81146102ec5780630ca78923146103135780630e53aae91461034757806319b640151461039c5780631d000b61146103d05780631e1401f8146103e557806320d7d3671461042857806321e6b53d146104515780632274256414610472578063228d2820146104da57806325f9bfef146104f45780632a2e2f0c1461050957806338a5e016146105365780633aa0145a1461054b5780633e8ff43f146105695780633f4d2fc2146105f3578063415f12401461062257806341a5b33d1461063a5780634290602914610664578063481c6a751461067957806349d10b641461068e5780634af80f0e146106a357806350057351146106c457806354fd4d5014610739578063579cd3ca146107655780635a46f06c146107935780635e35359e146107a85780635e5144eb146107d257806361cd756e146107ff57806362614ae6146108145780636d7bd3fc1461082957806371f52bf31461083e57806372b44b2c1461085357806375892cf11461087757806379ba5097146108a45780637b103999146108b957806383315b6e146108ce57806385d5e631146108e35780638b34839f146108fd5780638da5cb5b146109125780638e3047e0146109275780639232494e146109515780639249993a1461096657806392d1abb71461097b57806394c275ad146109905780639e568553146109a5578063a2c4c336146109cb578063ad374f5b146109ef578063b4a176d314610a09578063bf75455814610a1e578063c45d3d9214610a33578063c4a8598e14610a48578063c8c2fe6c14610a5d578063ca1d209d14610a72578063cc97b38f14610a8a578063d4ee1d9014610a9f578063d55ec69714610ab4578063d895951214610ac9578063e4edf85214610aea578063ecbca55d14610b0b578063f0843ba914610b29578063f2fde38b14610b7a578063fa1c594e14610b9b578063fc0c546a14610bb5578063fe417fa514610bca575b600080fd5b3480156102f857600080fd5b50610301610bee565b60408051918252519081900360200190f35b34801561031f57600080fd5b50610345600160a060020a036004351663ffffffff602435166044351515606435610c00565b005b34801561035357600080fd5b50610368600160a060020a0360043516610d13565b6040805195865263ffffffff9094166020860152911515848401521515606084015215156080830152519081900360a00190f35b3480156103a857600080fd5b506103b4600435610d59565b60408051600160a060020a039092168252519081900360200190f35b3480156103dc57600080fd5b50610301610d81565b3480156103f157600080fd5b5061040f600160a060020a0360043581169060243516604435610da5565b6040805192835260208301919091528051918290030190f35b34801561043457600080fd5b5061043d610e22565b604080519115158252519081900360200190f35b34801561045d57600080fd5b50610345600160a060020a0360043516610e2b565b6040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020830135926040810135925060ff606082013516915060808101359060a00135610ef5565b3480156104e657600080fd5b506103456004351515611257565b34801561050057600080fd5b50610301611316565b34801561051557600080fd5b50610301600160a060020a036004358116906024351660443560643561133a565b34801561054257600080fd5b50610345611816565b34801561055757600080fd5b5061030160043560ff6024351661189a565b34801561057557600080fd5b5061057e611904565b6040805160208082528351818301528351919283929083019185019080838360005b838110156105b85781810151838201526020016105a0565b50505050905090810190601f1680156105e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105ff57600080fd5b50610345600160a060020a036004351663ffffffff602435166044351515611992565b34801561062e57600080fd5b50610345600435611bdc565b34801561064657600080fd5b50610345600160a060020a0360043581169060243516604435611e89565b34801561067057600080fd5b506103b4611f2a565b34801561068557600080fd5b506103b4611f39565b34801561069a57600080fd5b50610345611f48565b3480156106af57600080fd5b50610345600160a060020a036004351661208f565b3480156106d057600080fd5b506040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020830135926040810135925060ff606082013516915060808101359060a001356120e0565b34801561074557600080fd5b5061074e612584565b6040805161ffff9092168252519081900360200190f35b34801561077157600080fd5b5061077a6125a6565b6040805163ffffffff9092168252519081900360200190f35b34801561079f57600080fd5b506103016125be565b3480156107b457600080fd5b50610345600160a060020a03600435811690602435166044356125e2565b3480156107de57600080fd5b50610301600160a060020a0360043581169060243516604435606435612763565b34801561080b57600080fd5b506103b461277a565b34801561082057600080fd5b5061030161278f565b34801561083557600080fd5b506103016127b3565b34801561084a57600080fd5b5061074e6127c5565b34801561085f57600080fd5b5061040f600160a060020a03600435166024356127cc565b34801561088357600080fd5b50610301600160a060020a0360043581169060243516604435606435612ab0565b3480156108b057600080fd5b50610345612b51565b3480156108c557600080fd5b506103b4612bcc565b3480156108da57600080fd5b50610301612bdb565b3480156108ef57600080fd5b506103456004351515612bff565b34801561090957600080fd5b5061043d612c98565b34801561091e57600080fd5b506103b4612ca6565b34801561093357600080fd5b5061040f600160a060020a0360043581169060243516604435612cb5565b34801561095d57600080fd5b50610301612f74565b34801561097257600080fd5b50610301612f86565b34801561098757600080fd5b50610301612faa565b34801561099c57600080fd5b5061077a612faf565b3480156109b157600080fd5b50610345600160a060020a03600435166024351515612fc3565b3480156109d757600080fd5b5061040f600160a060020a036004351660243561304b565b3480156109fb57600080fd5b5061034560043515156132fc565b348015610a1557600080fd5b5061034561332d565b348015610a2a57600080fd5b5061043d613387565b348015610a3f57600080fd5b506103b46133a0565b348015610a5457600080fd5b506103016133af565b348015610a6957600080fd5b506103456133d3565b348015610a7e57600080fd5b50610345600435613450565b348015610a9657600080fd5b5061030161370a565b348015610aab57600080fd5b506103b461372e565b348015610ac057600080fd5b5061034561373d565b348015610ad557600080fd5b50610301600160a060020a036004351661386b565b348015610af657600080fd5b50610345600160a060020a036004351661396f565b348015610b1757600080fd5b5061034563ffffffff600435166139da565b6040805160206004803580820135838102808601850190965280855261030195369593946024949385019291829185019084908082843750949750508435955050506020909201359150613ac19050565b348015610b8657600080fd5b50610345600160a060020a0360043516613ad2565b348015610ba757600080fd5b506103456004351515613b26565b348015610bc157600080fd5b506103b4613b66565b348015610bd657600080fd5b50610345600160a060020a0360043516602435613b75565b60008051602061466383398151915281565b60008054600160a060020a03163314610c1857600080fd5b600160a060020a0385166000908152600a602052604090206001015485906601000000000000900460ff161515610c4e57600080fd5b8460008163ffffffff16118015610c6e5750620f424063ffffffff821611155b1515610c7957600080fd5b600160a060020a0387166000908152600a602052604090206001810154600b54919450620f424063ffffffff918216928216929092038801161115610cbd57600080fd5b5050600181018054600b805463ffffffff928316818416038801831663ffffffff199182161790915582549515156401000000000264ff0000000019929097169516949094179390931693909317909155905550565b600a602052600090815260409020805460019091015463ffffffff81169060ff640100000000820481169165010000000000810482169166010000000000009091041685565b6009805482908110610d6757fe5b600091825260209091200154600160a060020a0316905081565b7f424e54546f6b656e00000000000000000000000000000000000000000000000081565b600080600160a060020a038581169085161415610dc157600080fd5b600254600160a060020a0385811691161415610dea57610de1858461304b565b91509150610e1a565b600254600160a060020a0386811691161415610e0a57610de184846127cc565b610e15858585612cb5565b915091505b935093915050565b60065460ff1681565b600054600160a060020a03163314610e4257600080fd5b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050506040513d6020811015610ec957600080fd5b5051600054909150600160a060020a03808316911614610ee857600080fd5b610ef182613d07565b5050565b6000806000896000815181101515610f0957fe5b60209081029091018101516007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051929550600160a060020a039091169263bb34534c926024808401938290030181600087803b158015610f6f57600080fd5b505af1158015610f83573d6000803e3d6000fd5b505050506040513d6020811015610f9957600080fd5b5051905034151561112d57600254600160a060020a038381169116141561109d576002546040805160e060020a63a24835d1028152336004820152602481018c90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b15801561101057600080fd5b505af1158015611024573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152600160a060020a038681166004830152602482018f9052915191909216935063867904b49250604480830192600092919082900301818387803b15801561108057600080fd5b505af1158015611094573d6000803e3d6000fd5b5050505061112d565b6040805160e060020a6323b872dd028152336004820152600160a060020a038381166024830152604482018c90529151918416916323b872dd916064808201926020929091908290030181600087803b1580156110f957600080fd5b505af115801561110d573d6000803e3d6000fd5b505050506040513d602081101561112357600080fd5b5051151561112d57fe5b80600160a060020a031663b406d386348c8c8c338f8e8e8e8e6040518b63ffffffff1660e060020a02815260040180806020018a815260200189815260200188600160a060020a0316600160a060020a031681526020018781526020018681526020018560ff1660ff1681526020018460001916600019168152602001836000191660001916815260200182810382528b818151815260200191508051906020019060200280838360005b838110156111f05781810151838201526020016111d8565b505050509050019a50505050505050505050506020604051808303818588803b15801561121c57600080fd5b505af1158015611230573d6000803e3d6000fd5b50505050506040513d602081101561124757600080fd5b50519a9950505050505050505050565b600054600160a060020a031633148061127a5750600354600160a060020a031633145b151561128557600080fd5b600b5460ff6c01000000000000000000000000909104161515811515141561131357600b80546c01000000000000000000000000831581026cff000000000000000000000000199092169190911791829055604080519190920460ff161515815290517fb8e670608a57255ce4f35952b324cba70211a4200a91ce81d26e06d488c1f66b9181900360200190a15b50565b7f436f6e747261637452656769737472790000000000000000000000000000000081565b6007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051600092839283928392839283928392600160a060020a03169163bb34534c91602480830192602092919082900301818787803b1580156113a357600080fd5b505af11580156113b7573d6000803e3d6000fd5b505050506040513d60208110156113cd57600080fd5b5051905033600160a060020a038216146113e657600080fd5b600b546c01000000000000000000000000900460ff16151561140457fe5b876000811161141257600080fd5b600160a060020a038c8116908c16141561142b57600080fd5b600254600160a060020a038c8116911614156114535761144c8c8b8b613d85565b9750611807565b600254600160a060020a038d8116911614156114745761144c8b8b8b613fdf565b61147f8c8c8c612cb5565b909750955086158015906114935750888710155b151561149e57600080fd5b600160a060020a038c166000908152600a602052604090206001810154909550640100000000900460ff16156114e35784546114e0908b63ffffffff61439916565b85555b600160a060020a038b166000908152600a602052604090206001810154909450640100000000900460ff1615611528578354611525908863ffffffff6143b616565b84555b6115318b61386b565b925082871061153c57fe5b6040805160e060020a6323b872dd028152336004820152306024820152604481018c90529051600160a060020a038e16916323b872dd9160648083019260209291908290030181600087803b15801561159457600080fd5b505af11580156115a8573d6000803e3d6000fd5b505050506040513d60208110156115be57600080fd5b505115156115c857fe5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d169163a9059cbb9160448083019260209291908290030181600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b505050506040513d602081101561165a57600080fd5b5051151561166457fe5b6116718c8c8c8a8a6143cb565b8b600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156116dd57600080fd5b505af11580156116f1573d6000803e3d6000fd5b505050506040513d602081101561170757600080fd5b50516117128f61386b565b600189015460408051938452602084019290925263ffffffff1682820152519081900360600190a28a600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b505050506040513d60208110156117d057600080fd5b50516117db8e61386b565b600188015460408051938452602084019290925263ffffffff1682820152519081900360600190a28697505b50505050505050949350505050565b600054600160a060020a0316331461182d57600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166379ba50976040518163ffffffff1660e060020a028152600401600060405180830381600087803b15801561188057600080fd5b505af1158015611894573d6000803e3d6000fd5b50505050565b60006118fd8260ff16620f42400a67ffffffffffffffff166118f18460ff16600b60089054906101000a900463ffffffff1663ffffffff16620f4240030a67ffffffffffffffff168661444f90919063ffffffff16565b9063ffffffff61447d16565b9392505050565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561198a5780601f1061195f5761010080835404028352916020019161198a565b820191906000526020600020905b81548152906001019060200180831161196d57829003601f168201915b505050505081565b600054600160a060020a031633146119a957600080fd5b600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b158015611a0857600080fd5b505af1158015611a1c573d6000803e3d6000fd5b505050506040513d6020811015611a3257600080fd5b5051600160a060020a03161415611a4857600080fd5b82600160a060020a0381161515611a5e57600080fd5b83600160a060020a038116301415611a7557600080fd5b8360008163ffffffff16118015611a955750620f424063ffffffff821611155b1515611aa057600080fd5b600254600160a060020a03878116911614801590611ae45750600160a060020a0386166000908152600a60205260409020600101546601000000000000900460ff16155b8015611b025750600b54620f424063ffffffff918216870190911611155b1515611b0d57600080fd5b505050600160a060020a039092166000818152600a602052604081208181556001908101805466ff0000000000001965ff0000000000199715156401000000000264ff000000001963ffffffff808a1663ffffffff19958616179190911691909117989098166501000000000017166601000000000000179091556009805492830181559092527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018054600160a060020a031916909217909155600b80548085169093019093169116179055565b600b546000908190819081908190819063ffffffff16620f424014611c0057600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c5357600080fd5b505af1158015611c67573d6000803e3d6000fd5b505050506040513d6020811015611c7d57600080fd5b50516002546040805160e060020a63a24835d1028152336004820152602481018b90529051929850600160a060020a039091169163a24835d19160448082019260009290919082900301818387803b158015611cd857600080fd5b505af1158015611cec573d6000803e3d6000fd5b50505050600091505b60095461ffff83161015611e80576009805461ffff8416908110611d1557fe5b600091825260209091200154600160a060020a03169450611d358561386b565b9350611d4b866118f1898763ffffffff61444f16565b600160a060020a0386166000908152600a6020526040902060018101549194509150640100000000900460ff1615611d92578054611d8f908463ffffffff6143b616565b81555b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018590529051600160a060020a0387169163a9059cbb9160448083019260209291908290030181600087803b158015611dfa57600080fd5b505af1158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b50511515611e2e57fe5b6001810154604080518989038152858703602082015263ffffffff9092168282015251600160a060020a03871691600080516020614683833981519152919081900360600190a2600190910190611cf5565b50505050505050565b600054600160a060020a03163314611ea057600080fd5b600254604080517f5e35359e000000000000000000000000000000000000000000000000000000008152600160a060020a03868116600483015285811660248301526044820185905291519190921691635e35359e91606480830192600092919082900301818387803b158015611f1657600080fd5b505af1158015611e80573d6000803e3d6000fd5b600454600160a060020a031681565b600354600160a060020a031681565b60065460009060ff1680611f665750600054600160a060020a031633145b1515611f7157600080fd5b6007546040805160e260020a632ecd14d30281527f436f6e747261637452656769737472790000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015611fe157600080fd5b505af1158015611ff5573d6000803e3d6000fd5b505050506040513d602081101561200b57600080fd5b5051600754909150600160a060020a038083169116148015906120365750600160a060020a03811615155b151561204157600080fd5b600780546006805475ffffffffffffffffffffffffffffffffffffffff00001916600160a060020a03808416620100000291909117909155600160a060020a03199091169216919091179055565b600054600160a060020a031633146120a657600080fd5b80600160a060020a0381163014156120bd57600080fd5b5060088054600160a060020a031916600160a060020a0392909216919091179055565b6007546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051600092839283928392600160a060020a03169163bb34534c91602480830192602092919082900301818787803b15801561215557600080fd5b505af1158015612169573d6000803e3d6000fd5b505050506040513d602081101561217f57600080fd5b50516007546040805160e260020a632ecd14d302815260008051602061464383398151915260048201529051929550600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b1580156121e257600080fd5b505af11580156121f6573d6000803e3d6000fd5b505050506040513d602081101561220c57600080fd5b50516007546040805160e260020a632ecd14d30281527f424e54546f6b656e00000000000000000000000000000000000000000000000060048201529051929450600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b15801561228157600080fd5b505af1158015612295573d6000803e3d6000fd5b505050506040513d60208110156122ab57600080fd5b50518b51600160a060020a03909116908c9060009081106122c857fe5b60209081029091010151600160a060020a0316146122e557600080fd5b604080517faafd6b76000000000000000000000000000000000000000000000000000000008152600481018b90523360248201529051600160a060020a0385169163aafd6b769160448083019260209291908290030181600087803b15801561234d57600080fd5b505af1158015612361573d6000803e3d6000fd5b505050506040513d602081101561237757600080fd5b50516002546040805160e060020a63a24835d1028152336004820152602481018490529051929350600160a060020a039091169163a24835d19160448082019260009290919082900301818387803b1580156123d257600080fd5b505af11580156123e6573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152600160a060020a03878116600483015260248201879052915191909216935063867904b49250604480830192600092919082900301818387803b15801561244257600080fd5b505af1158015612456573d6000803e3d6000fd5b5050505081600160a060020a031663b406d3868c838d338e8e8e8e8e6040518a63ffffffff1660e060020a02815260040180806020018a815260200189815260200188600160a060020a0316600160a060020a031681526020018781526020018681526020018560ff1660ff1681526020018460001916600019168152602001836000191660001916815260200182810382528b818151815260200191508051906020019060200280838360005b8381101561251c578181015183820152602001612504565b505050509050019a5050505050505050505050602060405180830381600087803b15801561254957600080fd5b505af115801561255d573d6000803e3d6000fd5b505050506040513d602081101561257357600080fd5b50519b9a5050505050505050505050565b60045474010000000000000000000000000000000000000000900461ffff1681565b600b5468010000000000000000900463ffffffff1681565b7f42616e636f72436f6e766572746572466163746f72790000000000000000000081565b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600092600160a060020a03169163bb34534c91602480830192602092919082900301818787803b15801561263f57600080fd5b505af1158015612653573d6000803e3d6000fd5b505050506040513d602081101561266957600080fd5b5051600160a060020a0385166000908152600a60205260409020600101549091506601000000000000900460ff1615806127355750600254604080517f8da5cb5b00000000000000000000000000000000000000000000000000000000815290513092600160a060020a031691638da5cb5b9160048083019260209291908290030181600087803b1580156126fd57600080fd5b505af1158015612711573d6000803e3d6000fd5b505050506040513d602081101561272757600080fd5b5051600160a060020a031614155b8061274d5750600054600160a060020a038281169116145b151561275857600080fd5b6118948484846144a0565b60006127718585858561133a565b95945050505050565b600654620100009004600160a060020a031681565b7f424e54436f6e766572746572000000000000000000000000000000000000000081565b60008051602061462383398151915281565b6009545b90565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561283557600080fd5b505af1158015612849573d6000803e3d6000fd5b505050506040513d602081101561285f57600080fd5b5051600160a060020a03161461287457600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff1615156128aa57600080fd5b600160a060020a03808c166000908152600a6020908152604080832060025482517f18160ddd0000000000000000000000000000000000000000000000000000000081529251919c50909416936318160ddd93600480840194938390030190829087803b15801561291a57600080fd5b505af115801561292e573d6000803e3d6000fd5b505050506040513d602081101561294457600080fd5b505195506129518b61386b565b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b1580156129b257600080fd5b505af11580156129c6573d6000803e3d6000fd5b505050506040513d60208110156129dc57600080fd5b50516001880154604080517f49f9b0f7000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916349f9b0f7916084808201926020929091908290030181600087803b158015612a6357600080fd5b505af1158015612a77573d6000803e3d6000fd5b505050506040513d6020811015612a8d57600080fd5b50519250612a9c83600161189a565b9b928c90039a509198505050505050505050565b60408051606081018252600160a060020a03808716825260025481166020830152851691810191909152600090612aeb90600c906003614599565b50612771600c805480602002602001604051908101604052809291908181526020018280548015612b4557602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311612b27575b50505050508484613ac1565b600154600160a060020a03163314612b6857600080fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a36001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600754600160a060020a031681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b600054600160a060020a03163314612c1657600080fd5b600254604080517f1608f18f00000000000000000000000000000000000000000000000000000000815283151560048201529051600160a060020a0390921691631608f18f9160248082019260009290919082900301818387803b158015612c7d57600080fd5b505af1158015612c91573d6000803e3d6000fd5b5050505050565b600654610100900460ff1681565b600054600160a060020a031681565b600080600080600080600030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612d1d57600080fd5b505af1158015612d31573d6000803e3d6000fd5b505050506040513d6020811015612d4757600080fd5b5051600160a060020a031614612d5c57600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff161515612d9257600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff161515612dc857600080fd5b600160a060020a038c81166000908152600a6020526040808220928e16825290206001820154919850965065010000000000900460ff161515612e0a57600080fd5b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015612e6857600080fd5b505af1158015612e7c573d6000803e3d6000fd5b505050506040513d6020811015612e9257600080fd5b50519450600160a060020a0385166365098bb3612eae8e61386b565b60018a015463ffffffff16612ec28f61386b565b60018b01546040805163ffffffff87811660e060020a028252600482019690965293851660248501526044840192909252929092166064820152608481018e9052905160a48083019260209291908290030181600087803b158015612f2657600080fd5b505af1158015612f3a573d6000803e3d6000fd5b505050506040513d6020811015612f5057600080fd5b50519350612f5f84600261189a565b9c938d90039b50929950505050505050505050565b60008051602061464383398151915281565b7f42616e636f7247617350726963654c696d69740000000000000000000000000081565b600181565b600b54640100000000900463ffffffff1681565b600054600160a060020a03163314612fda57600080fd5b600160a060020a0382166000908152600a602052604090206001015482906601000000000000900460ff16151561301057600080fd5b50600160a060020a03919091166000908152600a60205260409020600101805465ff0000000000191691156501000000000002919091179055565b60008060008060008060008030600160a060020a0316600260009054906101000a9004600160a060020a0316600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156130b457600080fd5b505af11580156130c8573d6000803e3d6000fd5b505050506040513d60208110156130de57600080fd5b5051600160a060020a0316146130f357600080fd5b600160a060020a038a166000908152600a60205260409020600101548a906601000000000000900460ff16151561312957600080fd5b600160a060020a038b166000908152600a60205260409020600181015490975065010000000000900460ff16151561316057600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156131b357600080fd5b505af11580156131c7573d6000803e3d6000fd5b505050506040513d60208110156131dd57600080fd5b505195506131ea8b61386b565b6007546040805160e260020a632ecd14d302815260008051602061462383398151915260048201529051929750600160a060020a039091169163bb34534c916024808201926020929091908290030181600087803b15801561324b57600080fd5b505af115801561325f573d6000803e3d6000fd5b505050506040513d602081101561327557600080fd5b50516001880154604080517f29a00e7c000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905263ffffffff9092166044830152606482018d905251919550600160a060020a038616916329a00e7c916084808201926020929091908290030181600087803b158015612a6357600080fd5b600054600160a060020a0316331461331357600080fd5b600680549115156101000261ff0019909216919091179055565b600054600160a060020a03163314806133505750600354600160a060020a031633145b151561335b57600080fd5b6006805460078054600160a060020a031916600160a060020a036201000084041617905560ff19169055565b600b546c01000000000000000000000000900460ff1681565b600854600160a060020a031681565b7f42616e636f72580000000000000000000000000000000000000000000000000081565b600454600160a060020a031633146133ea57600080fd5b600454600354604051600160a060020a0392831692909116907fbe4cc281795971a471c980e842627a7f1ea3892ddfce8c5b6357cd2611c1973290600090a36004805460038054600160a060020a0319908116600160a060020a03841617909155169055565b600b546000908190819081908190819063ffffffff16620f42401461347457600080fd5b600b546c01000000000000000000000000900460ff16151561349257fe5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156134e557600080fd5b505af11580156134f9573d6000803e3d6000fd5b505050506040513d602081101561350f57600080fd5b50519550600091505b60095461ffff83161015613693576009805461ffff841690811061353857fe5b600091825260209091200154600160a060020a031694506135588561386b565b935061356e866118f1898763ffffffff61444f16565b600160a060020a0386166000908152600a6020526040902060018101549194509150640100000000900460ff16156135b55780546135b2908463ffffffff61439916565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018590529051600160a060020a038716916323b872dd9160648083019260209291908290030181600087803b15801561360d57600080fd5b505af1158015613621573d6000803e3d6000fd5b505050506040513d602081101561363757600080fd5b5051151561364157fe5b600181015460408051888a018152868601602082015263ffffffff9092168282015251600160a060020a03871691600080516020614683833981519152919081900360600190a2600190910190613518565b6002546040805160e260020a63219e412d028152336004820152602481018a90529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b1580156136e957600080fd5b505af11580156136fd573d6000803e3d6000fd5b5050505050505050505050565b7f42616e636f72585570677261646572000000000000000000000000000000000081565b600154600160a060020a031681565b60008054600160a060020a0316331461375557600080fd5b6007546040805160e260020a632ecd14d302815260008051602061466383398151915260048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b1580156137b357600080fd5b505af11580156137c7573d6000803e3d6000fd5b505050506040513d60208110156137dd57600080fd5b505190506137ea81613ad2565b80600160a060020a03166390f58c96600460149054906101000a900461ffff166040518263ffffffff1660e060020a028152600401808261ffff1661ffff168152602001915050600060405180830381600087803b15801561384b57600080fd5b505af115801561385f573d6000803e3d6000fd5b50505050611313612b51565b600160a060020a0381166000908152600a6020526040812060010154819083906601000000000000900460ff1615156138a357600080fd5b600160a060020a0384166000908152600a602052604090206001810154909250640100000000900460ff1661396457604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038616916370a082319160248083019260209291908290030181600087803b15801561393357600080fd5b505af1158015613947573d6000803e3d6000fd5b505050506040513d602081101561395d57600080fd5b5051613967565b81545b949350505050565b600054600160a060020a03163314806139925750600354600160a060020a031633145b151561399d57600080fd5b600354600160a060020a03828116911614156139b857600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314806139fd5750600354600160a060020a031633145b1515613a0857600080fd5b8060008163ffffffff1610158015613a345750600b5463ffffffff640100000000909104811690821611155b1515613a3f57600080fd5b600b546040805163ffffffff6801000000000000000090930483168152918416602083015280517f81cd2ffb37dd237c0e4e2a3de5265fcf9deb43d3e7801e80db9f1ccfba7ee6009281900390910190a150600b805463ffffffff90921668010000000000000000026bffffffff000000000000000019909216919091179055565b600061396784848484808080610ef5565b600054600160a060020a03163314613ae957600080fd5b600054600160a060020a0382811691161415613b0457600080fd5b60018054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a0316331480613b495750600354600160a060020a031633145b1515613b5457600080fd5b6006805460ff19169115919091179055565b600254600160a060020a031681565b600654600090610100900460ff161515613b8e57600080fd5b6007546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b158015613bfe57600080fd5b505af1158015613c12573d6000803e3d6000fd5b505050506040513d6020811015613c2857600080fd5b5051905033600160a060020a03821614613c4157600080fd5b6002546040805160e060020a63a24835d1028152600160a060020a038681166004830152602482018690529151919092169163a24835d191604480830192600092919082900301818387803b158015613c9957600080fd5b505af1158015613cad573d6000803e3d6000fd5b50506002546040805160e260020a63219e412d028152336004820152602481018790529051600160a060020a03909216935063867904b4925060448082019260009290919082900301818387803b158015611f1657600080fd5b600054600160a060020a03163314613d1e57600080fd5b600254604080517ff2fde38b000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151919092169163f2fde38b91602480830192600092919082900301818387803b158015612c7d57600080fd5b600080600080613d95878761304b565b90935091508215801590613da95750848310155b1515613db457600080fd5b50600160a060020a0386166000908152600a602052604090206001810154640100000000900460ff1615613df7578054613df4908763ffffffff61439916565b81555b6040805160e060020a6323b872dd028152336004820152306024820152604481018890529051600160a060020a038916916323b872dd9160648083019260209291908290030181600087803b158015613e4f57600080fd5b505af1158015613e63573d6000803e3d6000fd5b505050506040513d6020811015613e7957600080fd5b50511515613e8357fe5b6002546040805160e260020a63219e412d028152336004820152602481018690529051600160a060020a039092169163867904b49160448082019260009290919082900301818387803b158015613ed957600080fd5b505af1158015613eed573d6000803e3d6000fd5b5050600254613f0b9250899150600160a060020a03168886866143cb565b86600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613f7757600080fd5b505af1158015613f8b573d6000803e3d6000fd5b505050506040513d6020811015613fa157600080fd5b5051613fac8a61386b565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a2509095945050505050565b600254604080517f70a08231000000000000000000000000000000000000000000000000000000008152336004820152905160009283928392839283928392600160a060020a03909216916370a082319160248082019260209290919082900301818787803b15801561405157600080fd5b505af1158015614065573d6000803e3d6000fd5b505050506040513d602081101561407b57600080fd5b505188111561408957600080fd5b61409389896127cc565b909550935084158015906140a75750868510155b15156140b257600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561410557600080fd5b505af1158015614119573d6000803e3d6000fd5b505050506040513d602081101561412f57600080fd5b5051925061413c8961386b565b9150818510806141555750818514801561415557508288145b151561415d57fe5b50600160a060020a0388166000908152600a602052604090206001810154640100000000900460ff16156141a057805461419d908663ffffffff6143b616565b81555b6002546040805160e060020a63a24835d1028152336004820152602481018b90529051600160a060020a039092169163a24835d19160448082019260009290919082900301818387803b1580156141f657600080fd5b505af115801561420a573d6000803e3d6000fd5b5050604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018990529051600160a060020a038d16935063a9059cbb925060448083019260209291908290030181600087803b15801561427657600080fd5b505af115801561428a573d6000803e3d6000fd5b505050506040513d60208110156142a057600080fd5b505115156142aa57fe5b6002546142c390600160a060020a03168a8a88886143cb565b88600160a060020a0316600080516020614683833981519152600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561432f57600080fd5b505af1158015614343573d6000803e3d6000fd5b505050506040513d602081101561435957600080fd5b50516143648c61386b565b600185015460408051938452602084019290925263ffffffff1682820152519081900360600190a25092979650505050505050565b6000828201838110156143ab57600080fd5b8091505b5092915050565b6000818310156143c557600080fd5b50900390565b7f80000000000000000000000000000000000000000000000000000000000000008111156143f557fe5b604080518481526020810184905280820183905290513391600160a060020a0387811692908916917f276856b36cbc45526a0ba64f44611557a2a8b68662c5388e9fe6d72e86e1c8cb919081900360600190a45050505050565b60008083151561446257600091506143af565b5082820282848281151561447257fe5b04146143ab57600080fd5b60008080831161448c57600080fd5b828481151561449757fe5b04949350505050565b600054600160a060020a031633146144b757600080fd5b82600160a060020a03811615156144cd57600080fd5b82600160a060020a03811615156144e357600080fd5b83600160a060020a0381163014156144fa57600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561455d57600080fd5b505af1158015614571573d6000803e3d6000fd5b505050506040513d602081101561458757600080fd5b5051151561459157fe5b505050505050565b8280548282559060005260206000209081019282156145ee579160200282015b828111156145ee5782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906145b9565b506145fa9291506145fe565b5090565b6127c991905b808211156145fa578054600160a060020a0319168155600101614604560042616e636f72466f726d756c610000000000000000000000000000000000000042616e636f724e6574776f726b0000000000000000000000000000000000000042616e636f72436f6e76657274657255706772616465720000000000000000008a6a7f53b3c8fa1dc4b83e3f1be668c1b251ff8d44cdcb83eb3acec3fec6a788a165627a7a72305820e93622f34bf989ef0685ad017400ad7bfa2ba06cf1843cf9e545980baf2290e40029

Swarm Source

bzzr://e93622f34bf989ef0685ad017400ad7bfa2ba06cf1843cf9e545980baf2290e4

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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