Source Code
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 7145435 | 2604 days ago | 1.74042112 ETH | ||||
| - | 7145435 | 2604 days ago | 1.74042112 ETH | ||||
| - | 7144702 | 2604 days ago | 2.55 ETH | ||||
| - | 7144702 | 2604 days ago | 2.55 ETH | ||||
| - | 7144702 | 2604 days ago | 2.42899803 ETH | ||||
| - | 7144702 | 2604 days ago | 2.42899803 ETH | ||||
| - | 7144696 | 2604 days ago | 1 ETH | ||||
| - | 7144696 | 2604 days ago | 1 ETH | ||||
| - | 7144690 | 2604 days ago | 3.24498409 ETH | ||||
| - | 7144690 | 2604 days ago | 3.24498409 ETH | ||||
| - | 7144690 | 2604 days ago | 1 ETH | ||||
| - | 7144690 | 2604 days ago | 1 ETH | ||||
| - | 7144686 | 2604 days ago | 1 ETH | ||||
| - | 7144686 | 2604 days ago | 1 ETH | ||||
| - | 7144684 | 2604 days ago | 2.7 ETH | ||||
| - | 7144684 | 2604 days ago | 2.7 ETH | ||||
| - | 7144682 | 2604 days ago | 8.54133189 ETH | ||||
| - | 7144682 | 2604 days ago | 8.54133189 ETH | ||||
| - | 7144682 | 2604 days ago | 6.56044998 ETH | ||||
| - | 7144682 | 2604 days ago | 6.56044998 ETH | ||||
| - | 7144682 | 2604 days ago | 5.9 ETH | ||||
| - | 7144682 | 2604 days ago | 5.9 ETH | ||||
| - | 7144673 | 2604 days ago | 5.58083327 ETH | ||||
| - | 7144673 | 2604 days ago | 5.58083327 ETH | ||||
| - | 7144673 | 2604 days ago | 1.0998965 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BancorNetwork
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/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/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/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/converter/interfaces/IBancorGasPriceLimit.sol
/*
Bancor Gas Price Limit interface
*/
contract IBancorGasPriceLimit {
function gasPrice() public view returns (uint256) {}
function validateGasPrice(uint256) public view;
}
// 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/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/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/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/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/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/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/BancorNetwork.sol
/*
The BancorNetwork contract is the main entry point for bancor token conversions.
It also allows converting between any token in the bancor network to any other token
in a single transaction by providing a conversion path.
A note on conversion path -
Conversion path is a data structure that's used when converting a token to another token in the bancor network
when the conversion cannot necessarily be done by single converter and might require multiple 'hops'.
The path defines which converters should be used and what kind of conversion should be done in each step.
The path format doesn't include complex structure and instead, it is represented by a single array
in which each 'hop' is represented by a 2-tuple - smart token & to token.
In addition, the first element is always the source token.
The smart token is only used as a pointer to a converter (since converter addresses are more likely to change).
Format:
[source token, smart token, to token, smart token, to token...]
*/
contract BancorNetwork is IBancorNetwork, TokenHolder, ContractIds, FeatureIds {
using SafeMath for uint256;
uint64 private constant MAX_CONVERSION_FEE = 1000000;
address public signerAddress = 0x0; // verified address that allows conversions with higher gas price
IContractRegistry public registry; // contract registry contract address
mapping (address => bool) public etherTokens; // list of all supported ether tokens
mapping (bytes32 => bool) public conversionHashes; // list of conversion hashes, to prevent re-use of the same hash
/**
@dev constructor
@param _registry address of a contract registry contract
*/
constructor(IContractRegistry _registry) public validAddress(_registry) {
registry = _registry;
}
// 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);
_;
}
/*
@dev allows the owner to update the contract registry contract address
@param _registry address of a contract registry contract
*/
function setRegistry(IContractRegistry _registry)
public
ownerOnly
validAddress(_registry)
notThis(_registry)
{
registry = _registry;
}
/*
@dev allows the owner to update the signer address
@param _signerAddress new signer address
*/
function setSignerAddress(address _signerAddress)
public
ownerOnly
validAddress(_signerAddress)
notThis(_signerAddress)
{
signerAddress = _signerAddress;
}
/**
@dev allows the owner to register/unregister ether tokens
@param _token ether token contract address
@param _register true to register, false to unregister
*/
function registerEtherToken(IEtherToken _token, bool _register)
public
ownerOnly
validAddress(_token)
notThis(_token)
{
etherTokens[_token] = _register;
}
/**
@dev verifies that the signer address is trusted by recovering
the address associated with the public key from elliptic
curve signature, returns zero on error.
notice that the signature is valid only for one conversion
and expires after the give block.
@return true if the signer is verified
*/
function verifyTrustedSender(IERC20Token[] _path, uint256 _customVal, uint256 _block, address _addr, uint8 _v, bytes32 _r, bytes32 _s) private returns(bool) {
bytes32 hash = keccak256(_block, tx.gasprice, _addr, msg.sender, _customVal, _path);
// checking that it is the first conversion with the given signature
// and that the current block number doesn't exceeded the maximum block
// number that's allowed with the current signature
require(!conversionHashes[hash] && block.number <= _block);
// recovering the signing address and comparing it to the trusted signer
// address that was set in the contract
bytes32 prefixedHash = keccak256("\x19Ethereum Signed Message:\n32", hash);
bool verified = ecrecover(prefixedHash, _v, _r, _s) == signerAddress;
// if the signer is the trusted signer - mark the hash so that it can't
// be used multiple times
if (verified)
conversionHashes[hash] = true;
return verified;
}
/**
@dev validates xConvert call by verifying the path format, claiming the callers tokens (if not ETH),
and verifying the gas price limit
@param _path conversion path, see conversion path format above
@param _amount amount to convert from (in the initial source token)
@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
*/
function validateXConversion(
IERC20Token[] _path,
uint256 _amount,
uint256 _block,
uint8 _v,
bytes32 _r,
bytes32 _s
)
private
validConversionPath(_path)
{
// if ETH is provided, ensure that the amount is identical to _amount and verify that the source token is an ether token
IERC20Token fromToken = _path[0];
require(msg.value == 0 || (_amount == msg.value && etherTokens[fromToken]));
// require that the dest token is BNT
require(_path[_path.length - 1] == registry.addressOf(ContractIds.BNT_TOKEN));
// if ETH was sent with the call, the source is an ether token - deposit the ETH in it
// otherwise, we claim the tokens from the sender
if (msg.value > 0) {
IEtherToken(fromToken).deposit.value(msg.value)();
} else {
assert(fromToken.transferFrom(msg.sender, this, _amount));
}
// verify gas price limit
if (_v == 0x0 && _r == 0x0 && _s == 0x0) {
IBancorGasPriceLimit gasPriceLimit = IBancorGasPriceLimit(registry.addressOf(ContractIds.BANCOR_GAS_PRICE_LIMIT));
gasPriceLimit.validateGasPrice(tx.gasprice);
} else {
require(verifyTrustedSender(_path, _amount, _block, msg.sender, _v, _r, _s));
}
}
/**
@dev converts the token to any other token in the bancor network by following
a predefined conversion path and transfers the result tokens to a target account
note that the converter should already own the source tokens
@param _path conversion path, see conversion path format above
@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 _for account that will receive the conversion result
@return tokens issued in return
*/
function convertFor(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for) public payable returns (uint256) {
return convertForPrioritized3(_path, _amount, _minReturn, _for, _amount, 0x0, 0x0, 0x0, 0x0);
}
/**
@dev converts the token to any other token in the bancor network
by following a predefined conversion path and transfers the result
tokens to a target account.
this version of the function also allows the verified signer
to bypass the universal gas price limit.
note that the converter should already own the source tokens
@param _path conversion path, see conversion path format above
@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 _for account that will receive the conversion result
@param _customVal custom value that was signed for prioritized conversion
@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 convertForPrioritized3(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
uint256 _customVal,
uint256 _block,
uint8 _v,
bytes32 _r,
bytes32 _s
)
public
payable
returns (uint256)
{
// if ETH is provided, ensure that the amount is identical to _amount and verify that the source token is an ether token
IERC20Token fromToken = _path[0];
require(msg.value == 0 || (_amount == msg.value && etherTokens[fromToken]));
// if ETH was sent with the call, the source is an ether token - deposit the ETH in it
// otherwise, we assume we already have the tokens
if (msg.value > 0)
IEtherToken(fromToken).deposit.value(msg.value)();
return convertForInternal(_path, _amount, _minReturn, _for, _customVal, _block, _v, _r, _s);
}
/**
@dev converts any other token to BNT in the bancor network
by following a predefined conversion path and transfers the resulting
tokens to BancorX.
note that the network should already have been given allowance of the source token (if not ETH)
@param _path conversion path, see conversion path format above
@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 _toBlockchain blockchain BNT will be issued on
@param _to address/account on _toBlockchain to send the BNT to
@param _conversionId pre-determined unique (if non zero) id which refers to this transaction
@return the amount of BNT received from this conversion
*/
function xConvert(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
bytes32 _toBlockchain,
bytes32 _to,
uint256 _conversionId
)
public
payable
returns (uint256)
{
return xConvertPrioritized(_path, _amount, _minReturn, _toBlockchain, _to, _conversionId, 0x0, 0x0, 0x0, 0x0);
}
/**
@dev converts any other token to BNT in the bancor network
by following a predefined conversion path and transfers the resulting
tokens to BancorX.
this version of the function also allows the verified signer
to bypass the universal gas price limit.
note that the network should already have been given allowance of the source token (if not ETH)
@param _path conversion path, see conversion path format above
@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 _toBlockchain blockchain BNT will be issued on
@param _to address/account on _toBlockchain to send the BNT to
@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 the amount of BNT received from this conversion
*/
function xConvertPrioritized(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
bytes32 _toBlockchain,
bytes32 _to,
uint256 _conversionId,
uint256 _block,
uint8 _v,
bytes32 _r,
bytes32 _s
)
public
payable
returns (uint256)
{
// do a lot of validation and transfers in separate function to work around 16 variable limit
validateXConversion(_path, _amount, _block, _v, _r, _s);
// convert to BNT and get the resulting amount
(, uint256 retAmount) = convertByPath(_path, _amount, _minReturn, _path[0], this);
// transfer the resulting amount to BancorX, and return the amount
IBancorX(registry.addressOf(ContractIds.BANCOR_X)).xTransfer(_toBlockchain, _to, retAmount, _conversionId);
return retAmount;
}
/**
@dev converts token to any other token in the bancor network
by following the predefined conversion paths and transfers the result
tokens to a targeted account.
this version of the function also allows multiple conversions
in a single atomic transaction.
note that the converter should already own the source tokens
@param _paths merged conversion paths, i.e. [path1, path2, ...]. see conversion path format above
@param _pathStartIndex each item in the array is the start index of the nth path in _paths
@param _amounts amount to convert from (in the initial source token) for each path
@param _minReturns minimum return for each path. if the conversion results in an amount
smaller than the minimum return - it is cancelled, must be nonzero
@param _for account that will receive the conversions result
@return amount of conversion result for each path
*/
function convertForMultiple(IERC20Token[] _paths, uint256[] _pathStartIndex, uint256[] _amounts, uint256[] _minReturns, address _for)
public
payable
returns (uint256[])
{
// if ETH is provided, ensure that the total amount was converted into other tokens
uint256 convertedValue = 0;
uint256 pathEndIndex;
// iterate over the conversion paths
for (uint256 i = 0; i < _pathStartIndex.length; i += 1) {
pathEndIndex = i == (_pathStartIndex.length - 1) ? _paths.length : _pathStartIndex[i + 1];
// copy a single path from _paths into an array
IERC20Token[] memory path = new IERC20Token[](pathEndIndex - _pathStartIndex[i]);
for (uint256 j = _pathStartIndex[i]; j < pathEndIndex; j += 1) {
path[j - _pathStartIndex[i]] = _paths[j];
}
// if ETH is provided, ensure that the amount is lower than the path amount and
// verify that the source token is an ether token. otherwise ensure that
// the source is not an ether token
IERC20Token fromToken = path[0];
require(msg.value == 0 || (_amounts[i] <= msg.value && etherTokens[fromToken]) || !etherTokens[fromToken]);
// if ETH was sent with the call, the source is an ether token - deposit the ETH path amount in it.
// otherwise, we assume we already have the tokens
if (msg.value > 0 && etherTokens[fromToken]) {
IEtherToken(fromToken).deposit.value(_amounts[i])();
convertedValue += _amounts[i];
}
_amounts[i] = convertForInternal(path, _amounts[i], _minReturns[i], _for, 0x0, 0x0, 0x0, 0x0, 0x0);
}
// if ETH was provided, ensure that the full amount was converted
require(convertedValue == msg.value);
return _amounts;
}
/**
@dev converts token to any other token in the bancor network
by following a predefined conversion paths and transfers the result
tokens to a target account.
@param _path conversion path, see conversion path format above
@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 _for account that will receive the conversion result
@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 convertForInternal(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
address _for,
uint256 _customVal,
uint256 _block,
uint8 _v,
bytes32 _r,
bytes32 _s
)
private
validConversionPath(_path)
returns (uint256)
{
if (_v == 0x0 && _r == 0x0 && _s == 0x0) {
IBancorGasPriceLimit gasPriceLimit = IBancorGasPriceLimit(registry.addressOf(ContractIds.BANCOR_GAS_PRICE_LIMIT));
gasPriceLimit.validateGasPrice(tx.gasprice);
}
else {
require(verifyTrustedSender(_path, _customVal, _block, _for, _v, _r, _s));
}
// if ETH is provided, ensure that the amount is identical to _amount and verify that the source token is an ether token
IERC20Token fromToken = _path[0];
IERC20Token toToken;
(toToken, _amount) = convertByPath(_path, _amount, _minReturn, fromToken, _for);
// finished the conversion, transfer the funds to the target account
// if the target token is an ether token, withdraw the tokens and send them as ETH
// otherwise, transfer the tokens as is
if (etherTokens[toToken])
IEtherToken(toToken).withdrawTo(_for, _amount);
else
assert(toToken.transfer(_for, _amount));
return _amount;
}
/**
@dev executes the actual conversion by following the conversion path
@param _path conversion path, see conversion path format above
@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 _fromToken ERC20 token to convert from (the first element in the path)
@param _for account that will receive the conversion result
@return ERC20 token to convert to (the last element in the path) & tokens issued in return
*/
function convertByPath(
IERC20Token[] _path,
uint256 _amount,
uint256 _minReturn,
IERC20Token _fromToken,
address _for
) private returns (IERC20Token, uint256) {
ISmartToken smartToken;
IERC20Token toToken;
IBancorConverter converter;
// get the contract features address from the registry
IContractFeatures features = IContractFeatures(registry.addressOf(ContractIds.CONTRACT_FEATURES));
// iterate over the conversion path
uint256 pathLength = _path.length;
for (uint256 i = 1; i < pathLength; i += 2) {
smartToken = ISmartToken(_path[i]);
toToken = _path[i + 1];
converter = IBancorConverter(smartToken.owner());
checkWhitelist(converter, _for, features);
// if the smart token isn't the source (from token), the converter doesn't have control over it and thus we need to approve the request
if (smartToken != _fromToken)
ensureAllowance(_fromToken, converter, _amount);
// make the conversion - if it's the last one, also provide the minimum return value
_amount = converter.change(_fromToken, toToken, _amount, i == pathLength - 2 ? _minReturn : 1);
_fromToken = toToken;
}
return (toToken, _amount);
}
/**
@dev returns the expected return amount for converting a specific amount by following
a given conversion path.
notice that there is no support for circular paths.
@param _path conversion path, see conversion path format above
@param _amount amount to convert from (in the initial source token)
@return expected conversion return amount and conversion fee
*/
function getReturnByPath(IERC20Token[] _path, uint256 _amount) public view returns (uint256, uint256) {
IERC20Token fromToken;
ISmartToken smartToken;
IERC20Token toToken;
IBancorConverter converter;
uint256 amount;
uint256 fee;
uint256 supply;
uint256 balance;
uint32 weight;
ISmartToken prevSmartToken;
IBancorFormula formula = IBancorFormula(registry.getAddress(ContractIds.BANCOR_FORMULA));
amount = _amount;
fromToken = _path[0];
// iterate over the conversion path
for (uint256 i = 1; i < _path.length; i += 2) {
smartToken = ISmartToken(_path[i]);
toToken = _path[i + 1];
converter = IBancorConverter(smartToken.owner());
if (toToken == smartToken) { // buy the smart token
// check if the current smart token supply was changed in the previous iteration
supply = smartToken == prevSmartToken ? supply : smartToken.totalSupply();
// validate input
require(getConnectorSaleEnabled(converter, fromToken));
// calculate the amount & the conversion fee
balance = converter.getConnectorBalance(fromToken);
weight = getConnectorWeight(converter, fromToken);
amount = formula.calculatePurchaseReturn(supply, balance, weight, amount);
fee = amount.mul(converter.conversionFee()).div(MAX_CONVERSION_FEE);
amount -= fee;
// update the smart token supply for the next iteration
supply = smartToken.totalSupply() + amount;
}
else if (fromToken == smartToken) { // sell the smart token
// check if the current smart token supply was changed in the previous iteration
supply = smartToken == prevSmartToken ? supply : smartToken.totalSupply();
// calculate the amount & the conversion fee
balance = converter.getConnectorBalance(toToken);
weight = getConnectorWeight(converter, toToken);
amount = formula.calculateSaleReturn(supply, balance, weight, amount);
fee = amount.mul(converter.conversionFee()).div(MAX_CONVERSION_FEE);
amount -= fee;
// update the smart token supply for the next iteration
supply = smartToken.totalSupply() - amount;
}
else { // cross connector conversion
(amount, fee) = converter.getReturn(fromToken, toToken, amount);
}
prevSmartToken = smartToken;
fromToken = toToken;
}
return (amount, fee);
}
/**
@dev checks whether the given converter supports a whitelist and if so, ensures that
the account that should receive the conversion result is actually whitelisted
@param _converter converter to check for whitelist
@param _for account that will receive the conversion result
@param _features contract features contract address
*/
function checkWhitelist(IBancorConverter _converter, address _for, IContractFeatures _features) private view {
IWhitelist whitelist;
// check if the converter supports the conversion whitelist feature
if (!_features.isSupported(_converter, FeatureIds.CONVERTER_CONVERSION_WHITELIST))
return;
// get the whitelist contract from the converter
whitelist = _converter.conversionWhitelist();
if (whitelist == address(0))
return;
// check if the account that should receive the conversion result is actually whitelisted
require(whitelist.isWhitelisted(_for));
}
/**
@dev claims the caller's tokens, converts them to any other token in the bancor network
by following a predefined conversion path and transfers the result tokens to a target account
note that allowance must be set beforehand
@param _path conversion path, see conversion path format above
@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 _for account that will receive the conversion result
@return tokens issued in return
*/
function claimAndConvertFor(IERC20Token[] _path, uint256 _amount, uint256 _minReturn, address _for) public returns (uint256) {
// we need to transfer the tokens from the caller to the converter before we follow
// the conversion path, to allow it to execute the conversion on behalf of the caller
// note: we assume we already have allowance
IERC20Token fromToken = _path[0];
assert(fromToken.transferFrom(msg.sender, this, _amount));
return convertFor(_path, _amount, _minReturn, _for);
}
/**
@dev converts the token to any other token in the bancor network by following
a predefined conversion path and transfers the result tokens back to the sender
note that the converter should already own the source tokens
@param _path conversion path, see conversion path format above
@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 convert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public payable returns (uint256) {
return convertFor(_path, _amount, _minReturn, msg.sender);
}
/**
@dev claims the caller's tokens, converts them to any other token in the bancor network
by following a predefined conversion path and transfers the result tokens back to the sender
note that allowance must be set beforehand
@param _path conversion path, see conversion path format above
@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 claimAndConvert(IERC20Token[] _path, uint256 _amount, uint256 _minReturn) public returns (uint256) {
return claimAndConvertFor(_path, _amount, _minReturn, msg.sender);
}
/**
@dev utility, checks whether allowance for the given spender exists and approves one if it doesn't
@param _token token to check the allowance in
@param _spender approved address
@param _value allowance amount
*/
function ensureAllowance(IERC20Token _token, address _spender, uint256 _value) private {
// check if allowance for the given amount already exists
if (_token.allowance(this, _spender) >= _value)
return;
// if the allowance is nonzero, must reset it to 0 first
if (_token.allowance(this, _spender) != 0)
assert(_token.approve(_spender, 0));
// approve the new allowance
assert(_token.approve(_spender, _value));
}
/**
@dev returns the connector weight
@param _converter converter contract address
@param _connector connector's address to read from
@return connector's weight
*/
function getConnectorWeight(IBancorConverter _converter, IERC20Token _connector)
private
view
returns(uint32)
{
uint256 virtualBalance;
uint32 weight;
bool isVirtualBalanceEnabled;
bool isSaleEnabled;
bool isSet;
(virtualBalance, weight, isVirtualBalanceEnabled, isSaleEnabled, isSet) = _converter.connectors(_connector);
return weight;
}
/**
@dev returns true if connector sale is enabled
@param _converter converter contract address
@param _connector connector's address to read from
@return true if connector sale is enabled, otherwise - false
*/
function getConnectorSaleEnabled(IBancorConverter _converter, IERC20Token _connector)
private
view
returns(bool)
{
uint256 virtualBalance;
uint32 weight;
bool isVirtualBalanceEnabled;
bool isSaleEnabled;
bool isSet;
(virtualBalance, weight, isVirtualBalanceEnabled, isSaleEnabled, isSet) = _converter.connectors(_connector);
return isSaleEnabled;
}
// 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)
{
return convertForPrioritized3(_path, _amount, _minReturn, _for, _amount, _block, _v, _r, _s);
}
// 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)
{
_nonce;
return convertForPrioritized3(_path, _amount, _minReturn, _for, _amount, _block, _v, _r, _s);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_register","type":"bool"}],"name":"registerEtherToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_signerAddress","type":"address"}],"name":"setSignerAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"}],"name":"getReturnByPath","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_CONVERTER_UPGRADER","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_for","type":"address"},{"name":"_block","type":"uint256"},{"name":"_nonce","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"convertForPrioritized","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"BNT_TOKEN","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_REGISTRY","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_CONVERTER_FACTORY","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"signerAddress","outputs":[{"name":"","type":"address"}],"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":true,"inputs":[],"name":"BNT_CONVERTER","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_toBlockchain","type":"bytes32"},{"name":"_to","type":"bytes32"},{"name":"_conversionId","type":"uint256"},{"name":"_block","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"xConvertPrioritized","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_for","type":"address"},{"name":"_block","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"convertForPrioritized2","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_FORMULA","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","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":"","type":"address"}],"name":"etherTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_FEATURES","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"conversionHashes","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":"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":false,"inputs":[{"name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_for","type":"address"}],"name":"claimAndConvertFor","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_for","type":"address"},{"name":"_customVal","type":"uint256"},{"name":"_block","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"convertForPrioritized3","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_paths","type":"address[]"},{"name":"_pathStartIndex","type":"uint256[]"},{"name":"_amounts","type":"uint256[]"},{"name":"_minReturns","type":"uint256[]"},{"name":"_for","type":"address"}],"name":"convertForMultiple","outputs":[{"name":"","type":"uint256[]"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"BANCOR_X","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_toBlockchain","type":"bytes32"},{"name":"_to","type":"bytes32"},{"name":"_conversionId","type":"uint256"}],"name":"xConvert","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"claimAndConvert","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"},{"name":"_for","type":"address"}],"name":"convertFor","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","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":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_path","type":"address[]"},{"name":"_amount","type":"uint256"},{"name":"_minReturn","type":"uint256"}],"name":"convert","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[{"name":"_registry","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_prevOwner","type":"address"},{"indexed":true,"name":"_newOwner","type":"address"}],"name":"OwnerUpdate","type":"event"}]Contract Creation Code
608060405260028054600160a060020a031916905534801561002057600080fd5b50604051602080612f67833981016040525160008054600160a060020a0319163317905580600160a060020a038116151561005a57600080fd5b5060038054600160a060020a031916600160a060020a0392909216919091179055612edd8061008a6000396000f30060806040526004361061019d5763ffffffff60e060020a60003504166302ef521e81146101a2578063046dc166146101ca5780630c8496cc146101eb5780630c87355e1461025b5780631134269a146102825780631d000b61146102ff57806325f9bfef146103145780635a46f06c146103295780635b7633d01461033e5780635e35359e1461036f57806362614ae6146103995780636896b999146103ae5780636b08f2ef146104295780636d7bd3fc146104a057806379ba5097146104b55780637b103999146104ca5780638077ccf7146104df57806383315b6e1461051457806389e63a60146105295780638da5cb5b146105415780639232494e146105565780639249993a1461056b57806392d1abb714610580578063a91ee0dc14610595578063b1e9932b146105b6578063b406d38614610621578063b5cadc911461069e578063c4a8598e146107ec578063c52173de14610801578063c7ba24bc14610860578063c98fefed146108be578063cc97b38f1461091c578063d4ee1d9014610931578063f2fde38b14610946578063f3898a9714610967575b600080fd5b3480156101ae57600080fd5b506101c8600160a060020a036004351660243515156109b8565b005b3480156101d657600080fd5b506101c8600160a060020a0360043516610a29565b3480156101f757600080fd5b5060408051602060048035808201358381028086018501909652808552610242953695939460249493850192918291850190849080828437509497505093359450610a9e9350505050565b6040805192835260208301919091528051918290030190f35b34801561026757600080fd5b506102706112ff565b60408051918252519081900360200190f35b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060808101359060ff60a0820135169060c08101359060e00135611323565b34801561030b57600080fd5b50610270611344565b34801561032057600080fd5b50610270611368565b34801561033557600080fd5b5061027061138c565b34801561034a57600080fd5b506103536113b0565b60408051600160a060020a039092168252519081900360200190f35b34801561037b57600080fd5b506101c8600160a060020a03600435811690602435166044356113bf565b3480156103a557600080fd5b506102706114b8565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592604081013592506060810135915060808101359060a08101359060ff60c0820135169060e08101359061010001356114dc565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060ff6080820135169060a08101359060c00135611651565b3480156104ac57600080fd5b50610270611671565b3480156104c157600080fd5b506101c8611695565b3480156104d657600080fd5b5061035361171d565b3480156104eb57600080fd5b50610500600160a060020a036004351661172c565b604080519115158252519081900360200190f35b34801561052057600080fd5b50610270611741565b34801561053557600080fd5b50610500600435611765565b34801561054d57600080fd5b5061035361177a565b34801561056257600080fd5b50610270611789565b34801561057757600080fd5b506102706117ad565b34801561058c57600080fd5b506102706117d1565b3480156105a157600080fd5b506101c8600160a060020a03600435166117d6565b3480156105c257600080fd5b5060408051602060048035808201358381028086018501909652808552610270953695939460249493850192918291850190849080828437509497505084359550505060208301359260400135600160a060020a0316915061184b9050565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060808101359060ff60a0820135169060c08101359060e0013561191e565b6040805160206004803580820135838102808601850190965280855261079c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975050509235600160a060020a031693506119f992505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156107d85781810151838201526020016107c0565b505050509050019250505060405180910390f35b3480156107f857600080fd5b50610270611cd2565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592604081013592506060810135915060800135611cf6565b34801561086c57600080fd5b506040805160206004803580820135838102808601850190965280855261027095369593946024949385019291829185019084908082843750949750508435955050506020909201359150611d159050565b60408051602060048035808201358381028086018501909652808552610270953695939460249493850192918291850190849080828437509497505084359550505060208301359260400135600160a060020a03169150611d2b9050565b34801561092857600080fd5b50610270611d47565b34801561093d57600080fd5b50610353611d6b565b34801561095257600080fd5b506101c8600160a060020a0360043516611d7a565b6040805160206004803580820135838102808601850190965280855261027095369593946024949385019291829185019084908082843750949750508435955050506020909201359150611ddb9050565b600054600160a060020a031633146109cf57600080fd5b81600160a060020a03811615156109e557600080fd5b82600160a060020a0381163014156109fc57600080fd5b5050600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b600054600160a060020a03163314610a4057600080fd5b80600160a060020a0381161515610a5657600080fd5b81600160a060020a038116301415610a6d57600080fd5b50506002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600080600080600080600080600080600080600360009054906101000a9004600160a060020a0316600160a060020a03166321f8a7217f42616e636f72466f726d756c61000000000000000000000000000000000000006040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050602060405180830381600087803b158015610b3957600080fd5b505af1158015610b4d573d6000803e3d6000fd5b505050506040513d6020811015610b6357600080fd5b810190808051906020019092919050505091508e97508f6000815181101515610b8857fe5b906020019060200201519b50600190505b8f518110156112e9578f81815181101515610bb057fe5b906020019060200201519a508f81600101815181101515610bcd57fe5b9060200190602002015199508a600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610c1757600080fd5b505af1158015610c2b573d6000803e3d6000fd5b505050506040513d6020811015610c4157600080fd5b50519850600160a060020a038a8116908c161415610f675782600160a060020a03168b600160a060020a031614610ce1578a600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610cb057600080fd5b505af1158015610cc4573d6000803e3d6000fd5b505050506040513d6020811015610cda57600080fd5b5051610ce3565b855b9550610cef898d611de9565b1515610cfa57600080fd5b88600160a060020a031663d89595128d6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610d5557600080fd5b505af1158015610d69573d6000803e3d6000fd5b505050506040513d6020811015610d7f57600080fd5b50519450610d8d898d611e88565b604080517f29a00e7c000000000000000000000000000000000000000000000000000000008152600481018990526024810188905263ffffffff83166044820152606481018b90529051919550600160a060020a038416916329a00e7c916084808201926020929091908290030181600087803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b505050506040513d6020811015610e3757600080fd5b5051604080517f579cd3ca0000000000000000000000000000000000000000000000000000000081529051919950610eed91620f424091610ee191600160a060020a038e169163579cd3ca9160048083019260209291908290030181600087803b158015610ea457600080fd5b505af1158015610eb8573d6000803e3d6000fd5b505050506040513d6020811015610ece57600080fd5b50518b9063ffffffff90811690611f2716565b9063ffffffff611f6016565b96508688039750878b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610f3357600080fd5b505af1158015610f47573d6000803e3d6000fd5b505050506040513d6020811015610f5d57600080fd5b50510195506112d9565b8a600160a060020a03168c600160a060020a031614156112315782600160a060020a03168b600160a060020a031614611009578a600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610fd857600080fd5b505af1158015610fec573d6000803e3d6000fd5b505050506040513d602081101561100257600080fd5b505161100b565b855b955088600160a060020a031663d89595128b6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561106857600080fd5b505af115801561107c573d6000803e3d6000fd5b505050506040513d602081101561109257600080fd5b505194506110a0898b611e88565b604080517f49f9b0f7000000000000000000000000000000000000000000000000000000008152600481018990526024810188905263ffffffff83166044820152606481018b90529051919550600160a060020a038416916349f9b0f7916084808201926020929091908290030181600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050506040513d602081101561114a57600080fd5b5051604080517f579cd3ca00000000000000000000000000000000000000000000000000000000815290519199506111b791620f424091610ee191600160a060020a038e169163579cd3ca9160048083019260209291908290030181600087803b158015610ea457600080fd5b96508688039750878b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156111fd57600080fd5b505af1158015611211573d6000803e3d6000fd5b505050506040513d602081101561122757600080fd5b50510395506112d9565b604080517f1e1401f8000000000000000000000000000000000000000000000000000000008152600160a060020a038e811660048301528c81166024830152604482018b90528251908c1692631e1401f892606480820193918290030181600087803b1580156112a057600080fd5b505af11580156112b4573d6000803e3d6000fd5b505050506040513d60408110156112ca57600080fd5b50805160209091015190985096505b989a508a988a9250600201610b99565b50959e949d50939b505050505050505050505050565b7f42616e636f72436f6e766572746572557067726164657200000000000000000081565b60006113368a8a8a8a8d8b8a8a8a61191e565b9a9950505050505050505050565b7f424e54546f6b656e00000000000000000000000000000000000000000000000081565b7f436f6e747261637452656769737472790000000000000000000000000000000081565b7f42616e636f72436f6e766572746572466163746f72790000000000000000000081565b600254600160a060020a031681565b600054600160a060020a031633146113d657600080fd5b82600160a060020a03811615156113ec57600080fd5b82600160a060020a038116151561140257600080fd5b83600160a060020a03811630141561141957600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561147c57600080fd5b505af1158015611490573d6000803e3d6000fd5b505050506040513d60208110156114a657600080fd5b505115156114b057fe5b505050505050565b7f424e54436f6e766572746572000000000000000000000000000000000000000081565b6000806114ed8c8c88888888611f83565b6115128c8c8c8f600081518110151561150257fe5b906020019060200201513061234b565b6003546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051929450600160a060020a03909116925063bb34534c9160248083019260209291908290030181600087803b15801561158557600080fd5b505af1158015611599573d6000803e3d6000fd5b505050506040513d60208110156115af57600080fd5b5051604080517f427c0374000000000000000000000000000000000000000000000000000000008152600481018c9052602481018b905260448101849052606481018a90529051600160a060020a039092169163427c03749160848082019260009290919082900301818387803b15801561162957600080fd5b505af115801561163d573d6000803e3d6000fd5b50929e9d5050505050505050505050505050565b6000611664898989898c8a8a8a8a61191e565b9998505050505050505050565b7f42616e636f72466f726d756c610000000000000000000000000000000000000081565b600154600160a060020a031633146116ac57600080fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600354600160a060020a031681565b60046020526000908152604090205460ff1681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b60056020526000908152604090205460ff1681565b600054600160a060020a031681565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b7f42616e636f7247617350726963654c696d69740000000000000000000000000081565b600181565b600054600160a060020a031633146117ed57600080fd5b80600160a060020a038116151561180357600080fd5b81600160a060020a03811630141561181a57600080fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008085600081518110151561185d57fe5b6020908102909101810151604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018990529051919350600160a060020a038416926323b872dd926064808401938290030181600087803b1580156118d457600080fd5b505af11580156118e8573d6000803e3d6000fd5b505050506040513d60208110156118fe57600080fd5b5051151561190857fe5b61191486868686611d2b565b9695505050505050565b6000808a600081518110151561193057fe5b906020019060200201519050346000148061196d5750348a14801561196d5750600160a060020a03811660009081526004602052604090205460ff165b151561197857600080fd5b60003411156119d95780600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b1580156119bf57600080fd5b505af11580156119d3573d6000803e3d6000fd5b50505050505b6119ea8b8b8b8b8b8b8b8b8b6125ba565b9b9a5050505050505050505050565b6060600080808381805b8a51841015611cb65760018b51038414611a37578a84600101815181101515611a2857fe5b90602001906020020151611a3a565b8b515b94508a84815181101515611a4a57fe5b906020019060200201518503604051908082528060200260200182016040528015611a7f578160200160208202803883390190505b5092508a84815181101515611a9057fe5b9060200190602002015191505b84821015611b07578b82815181101515611ab357fe5b90602001906020020151838c86815181101515611acc57fe5b906020019060200201518403815181101515611ae457fe5b600160a060020a0390921660209283029091019091015260019190910190611a9d565b826000815181101515611b1657fe5b9060200190602002015190503460001480611b6b5750348a85815181101515611b3b57fe5b9060200190602002015111158015611b6b5750600160a060020a03811660009081526004602052604090205460ff165b80611b8f5750600160a060020a03811660009081526004602052604090205460ff16155b1515611b9a57600080fd5b600034118015611bc25750600160a060020a03811660009081526004602052604090205460ff165b15611c525780600160a060020a031663d0e30db08b86815181101515611be457fe5b906020019060200201516040518263ffffffff1660e060020a0281526004016000604051808303818588803b158015611c1c57600080fd5b505af1158015611c30573d6000803e3d6000fd5b50505050508984815181101515611c4357fe5b90602001906020020151860195505b611c92838b86815181101515611c6457fe5b906020019060200201518b87815181101515611c7c57fe5b602090810290910101518b6000808080806125ba565b8a85815181101515611ca057fe5b6020908102909101015260019390930192611a03565b348614611cc257600080fd5b50979a9950505050505050505050565b7f42616e636f72580000000000000000000000000000000000000000000000000081565b6000611d0a878787878787878080806114dc565b979650505050505050565b6000611d238484843361184b565b949350505050565b6000611d3e85858585828680808061191e565b95945050505050565b7f42616e636f72585570677261646572000000000000000000000000000000000081565b600154600160a060020a031681565b600054600160a060020a03163314611d9157600080fd5b600054600160a060020a0382811691161415611dac57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000611d2384848433611d2b565b60008060008060008087600160a060020a0316630e53aae9886040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060a060405180830381600087803b158015611e4d57600080fd5b505af1158015611e61573d6000803e3d6000fd5b505050506040513d60a0811015611e7757600080fd5b506060015198975050505050505050565b60008060008060008087600160a060020a0316630e53aae9886040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060a060405180830381600087803b158015611eec57600080fd5b505af1158015611f00573d6000803e3d6000fd5b505050506040513d60a0811015611f1657600080fd5b506020015198975050505050505050565b600080831515611f3a5760009150611f59565b50828202828482811515611f4a57fe5b0414611f5557600080fd5b8091505b5092915050565b600080808311611f6f57600080fd5b8284811515611f7a57fe5b04949350505050565b6000808760028151118015611f9a57506015815111155b8015611fab57508051600290066001145b1515611fb657600080fd5b886000815181101515611fc557fe5b9060200190602002015192503460001480612002575034881480156120025750600160a060020a03831660009081526004602052604090205460ff165b151561200d57600080fd5b6003546040805160e260020a632ecd14d30281527f424e54546f6b656e00000000000000000000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561207d57600080fd5b505af1158015612091573d6000803e3d6000fd5b505050506040513d60208110156120a757600080fd5b50518951600160a060020a03909116908a9060001981019081106120c757fe5b60209081029091010151600160a060020a0316146120e457600080fd5b60003411156121495782600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b15801561212b57600080fd5b505af115801561213f573d6000803e3d6000fd5b50505050506121eb565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018a90529051600160a060020a038516916323b872dd9160648083019260209291908290030181600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506040513d60208110156121e157600080fd5b505115156121eb57fe5b60ff86161580156121fa575084155b8015612204575083155b15612326576003546040805160e260020a632ecd14d30281527f42616e636f7247617350726963654c696d69740000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561227957600080fd5b505af115801561228d573d6000803e3d6000fd5b505050506040513d60208110156122a357600080fd5b5051604080517f6b4dff1f0000000000000000000000000000000000000000000000000000000081523a60048201529051919350600160a060020a03841691636b4dff1f9160248082019260009290919082900301818387803b15801561230957600080fd5b505af115801561231d573d6000803e3d6000fd5b50505050612340565b612335898989338a8a8a6128bd565b151561234057600080fd5b505050505050505050565b6003546040805160e260020a632ecd14d30281527f436f6e7472616374466561747572657300000000000000000000000000000000600482015290516000928392839283928392839283928392600160a060020a039091169163bb34534c9160248082019260209290919082900301818787803b1580156123cb57600080fd5b505af11580156123df573d6000803e3d6000fd5b505050506040513d60208110156123f557600080fd5b50518d519093509150600190505b818110156125a9578c8181518110151561241957fe5b9060200190602002015195508c8160010181518110151561243657fe5b90602001906020020151945085600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561248057600080fd5b505af1158015612494573d6000803e3d6000fd5b505050506040513d60208110156124aa57600080fd5b505193506124b9848a85612a84565b600160a060020a03868116908b16146124d7576124d78a858e612c40565b83600160a060020a0316635e5144eb8b878f6002870386146124fa5760016124fc565b8f5b6040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184600160a060020a0316600160a060020a03168152602001838152602001828152602001945050505050602060405180830381600087803b15801561256e57600080fd5b505af1158015612582573d6000803e3d6000fd5b505050506040513d602081101561259857600080fd5b50519b509398508893600201612403565b50929b999a50505050505050505050565b6000806000808c600281511180156125d457506015815111155b80156125e557508051600290066001145b15156125f057600080fd5b60ff88161580156125ff575086155b8015612609575085155b1561272b576003546040805160e260020a632ecd14d30281527f42616e636f7247617350726963654c696d69740000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561267e57600080fd5b505af1158015612692573d6000803e3d6000fd5b505050506040513d60208110156126a857600080fd5b5051604080517f6b4dff1f0000000000000000000000000000000000000000000000000000000081523a60048201529051919550600160a060020a03861691636b4dff1f9160248082019260009290919082900301818387803b15801561270e57600080fd5b505af1158015612722573d6000803e3d6000fd5b50505050612745565b61273a8e8b8b8e8c8c8c6128bd565b151561274557600080fd5b8d600081518110151561275457fe5b90602001906020020151925061276d8e8e8e868f61234b565b600160a060020a038216600090815260046020526040902054909e5090925060ff16156128145781600160a060020a031663205c28788c8f6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b1580156127f757600080fd5b505af115801561280b573d6000803e3d6000fd5b505050506128ab565b81600160a060020a031663a9059cbb8c8f6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561287757600080fd5b505af115801561288b573d6000803e3d6000fd5b505050506040513d60208110156128a157600080fd5b505115156128ab57fe5b509a9c9b505050505050505050505050565b600080600080883a89338d8f6040518087815260200186815260200185600160a060020a0316600160a060020a03166c0100000000000000000000000002815260140184600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401838152602001828051906020019060200280838360005b8381101561295657818101518382015260200161293e565b50506040805195909301859003909420600081815260056020529290922054919d505060ff161598505087159650612995955050505050505750884311155b15156129a057600080fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101859052815190819003603c0181206002546000808452602084810180875284905260ff8d1685870152606085018c9052608085018b90529451929650600160a060020a039091169360019360a0808201949293601f19840193928390039091019190865af1158015612a41573d6000803e3d6000fd5b50505060206040510351600160a060020a03161490508015611336576000838152600560205260409020805460ff191660011790559a9950505050505050505050565b604080517fa5fbf287000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015260016024830152915160009284169163a5fbf28791604480830192602092919082900301818787803b158015612af057600080fd5b505af1158015612b04573d6000803e3d6000fd5b505050506040513d6020811015612b1a57600080fd5b50511515612b2757612c3a565b83600160a060020a031663c45d3d926040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612b6557600080fd5b505af1158015612b79573d6000803e3d6000fd5b505050506040513d6020811015612b8f57600080fd5b50519050600160a060020a0381161515612ba857612c3a565b80600160a060020a0316633af32abf846040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015612c0357600080fd5b505af1158015612c17573d6000803e3d6000fd5b505050506040513d6020811015612c2d57600080fd5b50511515612c3a57600080fd5b50505050565b604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152306004820152600160a060020a0384811660248301529151839286169163dd62ed3e9160448083019260209291908290030181600087803b158015612cab57600080fd5b505af1158015612cbf573d6000803e3d6000fd5b505050506040513d6020811015612cd557600080fd5b505110612ce157612eac565b604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152306004820152600160a060020a03848116602483015291519185169163dd62ed3e916044808201926020929091908290030181600087803b158015612d4c57600080fd5b505af1158015612d60573d6000803e3d6000fd5b505050506040513d6020811015612d7657600080fd5b505115612e155782600160a060020a031663095ea7b38360006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015612de157600080fd5b505af1158015612df5573d6000803e3d6000fd5b505050506040513d6020811015612e0b57600080fd5b50511515612e1557fe5b82600160a060020a031663095ea7b383836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015612e7857600080fd5b505af1158015612e8c573d6000803e3d6000fd5b505050506040513d6020811015612ea257600080fd5b50511515612eac57fe5b5050505600a165627a7a7230582061186cca32c3e2a6034d0833a2ab4e5b30759f22b0c2f3a572f7abbe027e96b0002900000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd4
Deployed Bytecode
0x60806040526004361061019d5763ffffffff60e060020a60003504166302ef521e81146101a2578063046dc166146101ca5780630c8496cc146101eb5780630c87355e1461025b5780631134269a146102825780631d000b61146102ff57806325f9bfef146103145780635a46f06c146103295780635b7633d01461033e5780635e35359e1461036f57806362614ae6146103995780636896b999146103ae5780636b08f2ef146104295780636d7bd3fc146104a057806379ba5097146104b55780637b103999146104ca5780638077ccf7146104df57806383315b6e1461051457806389e63a60146105295780638da5cb5b146105415780639232494e146105565780639249993a1461056b57806392d1abb714610580578063a91ee0dc14610595578063b1e9932b146105b6578063b406d38614610621578063b5cadc911461069e578063c4a8598e146107ec578063c52173de14610801578063c7ba24bc14610860578063c98fefed146108be578063cc97b38f1461091c578063d4ee1d9014610931578063f2fde38b14610946578063f3898a9714610967575b600080fd5b3480156101ae57600080fd5b506101c8600160a060020a036004351660243515156109b8565b005b3480156101d657600080fd5b506101c8600160a060020a0360043516610a29565b3480156101f757600080fd5b5060408051602060048035808201358381028086018501909652808552610242953695939460249493850192918291850190849080828437509497505093359450610a9e9350505050565b6040805192835260208301919091528051918290030190f35b34801561026757600080fd5b506102706112ff565b60408051918252519081900360200190f35b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060808101359060ff60a0820135169060c08101359060e00135611323565b34801561030b57600080fd5b50610270611344565b34801561032057600080fd5b50610270611368565b34801561033557600080fd5b5061027061138c565b34801561034a57600080fd5b506103536113b0565b60408051600160a060020a039092168252519081900360200190f35b34801561037b57600080fd5b506101c8600160a060020a03600435811690602435166044356113bf565b3480156103a557600080fd5b506102706114b8565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592604081013592506060810135915060808101359060a08101359060ff60c0820135169060e08101359061010001356114dc565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060ff6080820135169060a08101359060c00135611651565b3480156104ac57600080fd5b50610270611671565b3480156104c157600080fd5b506101c8611695565b3480156104d657600080fd5b5061035361171d565b3480156104eb57600080fd5b50610500600160a060020a036004351661172c565b604080519115158252519081900360200190f35b34801561052057600080fd5b50610270611741565b34801561053557600080fd5b50610500600435611765565b34801561054d57600080fd5b5061035361177a565b34801561056257600080fd5b50610270611789565b34801561057757600080fd5b506102706117ad565b34801561058c57600080fd5b506102706117d1565b3480156105a157600080fd5b506101c8600160a060020a03600435166117d6565b3480156105c257600080fd5b5060408051602060048035808201358381028086018501909652808552610270953695939460249493850192918291850190849080828437509497505084359550505060208301359260400135600160a060020a0316915061184b9050565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592600160a060020a0360408201351692506060810135915060808101359060ff60a0820135169060c08101359060e0013561191e565b6040805160206004803580820135838102808601850190965280855261079c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975050509235600160a060020a031693506119f992505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156107d85781810151838201526020016107c0565b505050509050019250505060405180910390f35b3480156107f857600080fd5b50610270611cd2565b604080516020600480358082013583810280860185019096528085526102709536959394602494938501929182918501908490808284375094975050843595505050602083013592604081013592506060810135915060800135611cf6565b34801561086c57600080fd5b506040805160206004803580820135838102808601850190965280855261027095369593946024949385019291829185019084908082843750949750508435955050506020909201359150611d159050565b60408051602060048035808201358381028086018501909652808552610270953695939460249493850192918291850190849080828437509497505084359550505060208301359260400135600160a060020a03169150611d2b9050565b34801561092857600080fd5b50610270611d47565b34801561093d57600080fd5b50610353611d6b565b34801561095257600080fd5b506101c8600160a060020a0360043516611d7a565b6040805160206004803580820135838102808601850190965280855261027095369593946024949385019291829185019084908082843750949750508435955050506020909201359150611ddb9050565b600054600160a060020a031633146109cf57600080fd5b81600160a060020a03811615156109e557600080fd5b82600160a060020a0381163014156109fc57600080fd5b5050600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b600054600160a060020a03163314610a4057600080fd5b80600160a060020a0381161515610a5657600080fd5b81600160a060020a038116301415610a6d57600080fd5b50506002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600080600080600080600080600080600080600360009054906101000a9004600160a060020a0316600160a060020a03166321f8a7217f42616e636f72466f726d756c61000000000000000000000000000000000000006040518263ffffffff1660e060020a028152600401808260001916600019168152602001915050602060405180830381600087803b158015610b3957600080fd5b505af1158015610b4d573d6000803e3d6000fd5b505050506040513d6020811015610b6357600080fd5b810190808051906020019092919050505091508e97508f6000815181101515610b8857fe5b906020019060200201519b50600190505b8f518110156112e9578f81815181101515610bb057fe5b906020019060200201519a508f81600101815181101515610bcd57fe5b9060200190602002015199508a600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610c1757600080fd5b505af1158015610c2b573d6000803e3d6000fd5b505050506040513d6020811015610c4157600080fd5b50519850600160a060020a038a8116908c161415610f675782600160a060020a03168b600160a060020a031614610ce1578a600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610cb057600080fd5b505af1158015610cc4573d6000803e3d6000fd5b505050506040513d6020811015610cda57600080fd5b5051610ce3565b855b9550610cef898d611de9565b1515610cfa57600080fd5b88600160a060020a031663d89595128d6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610d5557600080fd5b505af1158015610d69573d6000803e3d6000fd5b505050506040513d6020811015610d7f57600080fd5b50519450610d8d898d611e88565b604080517f29a00e7c000000000000000000000000000000000000000000000000000000008152600481018990526024810188905263ffffffff83166044820152606481018b90529051919550600160a060020a038416916329a00e7c916084808201926020929091908290030181600087803b158015610e0d57600080fd5b505af1158015610e21573d6000803e3d6000fd5b505050506040513d6020811015610e3757600080fd5b5051604080517f579cd3ca0000000000000000000000000000000000000000000000000000000081529051919950610eed91620f424091610ee191600160a060020a038e169163579cd3ca9160048083019260209291908290030181600087803b158015610ea457600080fd5b505af1158015610eb8573d6000803e3d6000fd5b505050506040513d6020811015610ece57600080fd5b50518b9063ffffffff90811690611f2716565b9063ffffffff611f6016565b96508688039750878b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610f3357600080fd5b505af1158015610f47573d6000803e3d6000fd5b505050506040513d6020811015610f5d57600080fd5b50510195506112d9565b8a600160a060020a03168c600160a060020a031614156112315782600160a060020a03168b600160a060020a031614611009578a600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610fd857600080fd5b505af1158015610fec573d6000803e3d6000fd5b505050506040513d602081101561100257600080fd5b505161100b565b855b955088600160a060020a031663d89595128b6040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561106857600080fd5b505af115801561107c573d6000803e3d6000fd5b505050506040513d602081101561109257600080fd5b505194506110a0898b611e88565b604080517f49f9b0f7000000000000000000000000000000000000000000000000000000008152600481018990526024810188905263ffffffff83166044820152606481018b90529051919550600160a060020a038416916349f9b0f7916084808201926020929091908290030181600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050506040513d602081101561114a57600080fd5b5051604080517f579cd3ca00000000000000000000000000000000000000000000000000000000815290519199506111b791620f424091610ee191600160a060020a038e169163579cd3ca9160048083019260209291908290030181600087803b158015610ea457600080fd5b96508688039750878b600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156111fd57600080fd5b505af1158015611211573d6000803e3d6000fd5b505050506040513d602081101561122757600080fd5b50510395506112d9565b604080517f1e1401f8000000000000000000000000000000000000000000000000000000008152600160a060020a038e811660048301528c81166024830152604482018b90528251908c1692631e1401f892606480820193918290030181600087803b1580156112a057600080fd5b505af11580156112b4573d6000803e3d6000fd5b505050506040513d60408110156112ca57600080fd5b50805160209091015190985096505b989a508a988a9250600201610b99565b50959e949d50939b505050505050505050505050565b7f42616e636f72436f6e766572746572557067726164657200000000000000000081565b60006113368a8a8a8a8d8b8a8a8a61191e565b9a9950505050505050505050565b7f424e54546f6b656e00000000000000000000000000000000000000000000000081565b7f436f6e747261637452656769737472790000000000000000000000000000000081565b7f42616e636f72436f6e766572746572466163746f72790000000000000000000081565b600254600160a060020a031681565b600054600160a060020a031633146113d657600080fd5b82600160a060020a03811615156113ec57600080fd5b82600160a060020a038116151561140257600080fd5b83600160a060020a03811630141561141957600080fd5b85600160a060020a031663a9059cbb86866040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561147c57600080fd5b505af1158015611490573d6000803e3d6000fd5b505050506040513d60208110156114a657600080fd5b505115156114b057fe5b505050505050565b7f424e54436f6e766572746572000000000000000000000000000000000000000081565b6000806114ed8c8c88888888611f83565b6115128c8c8c8f600081518110151561150257fe5b906020019060200201513061234b565b6003546040805160e260020a632ecd14d30281527f42616e636f72580000000000000000000000000000000000000000000000000060048201529051929450600160a060020a03909116925063bb34534c9160248083019260209291908290030181600087803b15801561158557600080fd5b505af1158015611599573d6000803e3d6000fd5b505050506040513d60208110156115af57600080fd5b5051604080517f427c0374000000000000000000000000000000000000000000000000000000008152600481018c9052602481018b905260448101849052606481018a90529051600160a060020a039092169163427c03749160848082019260009290919082900301818387803b15801561162957600080fd5b505af115801561163d573d6000803e3d6000fd5b50929e9d5050505050505050505050505050565b6000611664898989898c8a8a8a8a61191e565b9998505050505050505050565b7f42616e636f72466f726d756c610000000000000000000000000000000000000081565b600154600160a060020a031633146116ac57600080fd5b60015460008054604051600160a060020a0393841693909116917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600354600160a060020a031681565b60046020526000908152604090205460ff1681565b7f436f6e747261637446656174757265730000000000000000000000000000000081565b60056020526000908152604090205460ff1681565b600054600160a060020a031681565b7f42616e636f724e6574776f726b0000000000000000000000000000000000000081565b7f42616e636f7247617350726963654c696d69740000000000000000000000000081565b600181565b600054600160a060020a031633146117ed57600080fd5b80600160a060020a038116151561180357600080fd5b81600160a060020a03811630141561181a57600080fd5b50506003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008085600081518110151561185d57fe5b6020908102909101810151604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018990529051919350600160a060020a038416926323b872dd926064808401938290030181600087803b1580156118d457600080fd5b505af11580156118e8573d6000803e3d6000fd5b505050506040513d60208110156118fe57600080fd5b5051151561190857fe5b61191486868686611d2b565b9695505050505050565b6000808a600081518110151561193057fe5b906020019060200201519050346000148061196d5750348a14801561196d5750600160a060020a03811660009081526004602052604090205460ff165b151561197857600080fd5b60003411156119d95780600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b1580156119bf57600080fd5b505af11580156119d3573d6000803e3d6000fd5b50505050505b6119ea8b8b8b8b8b8b8b8b8b6125ba565b9b9a5050505050505050505050565b6060600080808381805b8a51841015611cb65760018b51038414611a37578a84600101815181101515611a2857fe5b90602001906020020151611a3a565b8b515b94508a84815181101515611a4a57fe5b906020019060200201518503604051908082528060200260200182016040528015611a7f578160200160208202803883390190505b5092508a84815181101515611a9057fe5b9060200190602002015191505b84821015611b07578b82815181101515611ab357fe5b90602001906020020151838c86815181101515611acc57fe5b906020019060200201518403815181101515611ae457fe5b600160a060020a0390921660209283029091019091015260019190910190611a9d565b826000815181101515611b1657fe5b9060200190602002015190503460001480611b6b5750348a85815181101515611b3b57fe5b9060200190602002015111158015611b6b5750600160a060020a03811660009081526004602052604090205460ff165b80611b8f5750600160a060020a03811660009081526004602052604090205460ff16155b1515611b9a57600080fd5b600034118015611bc25750600160a060020a03811660009081526004602052604090205460ff165b15611c525780600160a060020a031663d0e30db08b86815181101515611be457fe5b906020019060200201516040518263ffffffff1660e060020a0281526004016000604051808303818588803b158015611c1c57600080fd5b505af1158015611c30573d6000803e3d6000fd5b50505050508984815181101515611c4357fe5b90602001906020020151860195505b611c92838b86815181101515611c6457fe5b906020019060200201518b87815181101515611c7c57fe5b602090810290910101518b6000808080806125ba565b8a85815181101515611ca057fe5b6020908102909101015260019390930192611a03565b348614611cc257600080fd5b50979a9950505050505050505050565b7f42616e636f72580000000000000000000000000000000000000000000000000081565b6000611d0a878787878787878080806114dc565b979650505050505050565b6000611d238484843361184b565b949350505050565b6000611d3e85858585828680808061191e565b95945050505050565b7f42616e636f72585570677261646572000000000000000000000000000000000081565b600154600160a060020a031681565b600054600160a060020a03163314611d9157600080fd5b600054600160a060020a0382811691161415611dac57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000611d2384848433611d2b565b60008060008060008087600160a060020a0316630e53aae9886040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060a060405180830381600087803b158015611e4d57600080fd5b505af1158015611e61573d6000803e3d6000fd5b505050506040513d60a0811015611e7757600080fd5b506060015198975050505050505050565b60008060008060008087600160a060020a0316630e53aae9886040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060a060405180830381600087803b158015611eec57600080fd5b505af1158015611f00573d6000803e3d6000fd5b505050506040513d60a0811015611f1657600080fd5b506020015198975050505050505050565b600080831515611f3a5760009150611f59565b50828202828482811515611f4a57fe5b0414611f5557600080fd5b8091505b5092915050565b600080808311611f6f57600080fd5b8284811515611f7a57fe5b04949350505050565b6000808760028151118015611f9a57506015815111155b8015611fab57508051600290066001145b1515611fb657600080fd5b886000815181101515611fc557fe5b9060200190602002015192503460001480612002575034881480156120025750600160a060020a03831660009081526004602052604090205460ff165b151561200d57600080fd5b6003546040805160e260020a632ecd14d30281527f424e54546f6b656e00000000000000000000000000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561207d57600080fd5b505af1158015612091573d6000803e3d6000fd5b505050506040513d60208110156120a757600080fd5b50518951600160a060020a03909116908a9060001981019081106120c757fe5b60209081029091010151600160a060020a0316146120e457600080fd5b60003411156121495782600160a060020a031663d0e30db0346040518263ffffffff1660e060020a0281526004016000604051808303818588803b15801561212b57600080fd5b505af115801561213f573d6000803e3d6000fd5b50505050506121eb565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018a90529051600160a060020a038516916323b872dd9160648083019260209291908290030181600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506040513d60208110156121e157600080fd5b505115156121eb57fe5b60ff86161580156121fa575084155b8015612204575083155b15612326576003546040805160e260020a632ecd14d30281527f42616e636f7247617350726963654c696d69740000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561227957600080fd5b505af115801561228d573d6000803e3d6000fd5b505050506040513d60208110156122a357600080fd5b5051604080517f6b4dff1f0000000000000000000000000000000000000000000000000000000081523a60048201529051919350600160a060020a03841691636b4dff1f9160248082019260009290919082900301818387803b15801561230957600080fd5b505af115801561231d573d6000803e3d6000fd5b50505050612340565b612335898989338a8a8a6128bd565b151561234057600080fd5b505050505050505050565b6003546040805160e260020a632ecd14d30281527f436f6e7472616374466561747572657300000000000000000000000000000000600482015290516000928392839283928392839283928392600160a060020a039091169163bb34534c9160248082019260209290919082900301818787803b1580156123cb57600080fd5b505af11580156123df573d6000803e3d6000fd5b505050506040513d60208110156123f557600080fd5b50518d519093509150600190505b818110156125a9578c8181518110151561241957fe5b9060200190602002015195508c8160010181518110151561243657fe5b90602001906020020151945085600160a060020a0316638da5cb5b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561248057600080fd5b505af1158015612494573d6000803e3d6000fd5b505050506040513d60208110156124aa57600080fd5b505193506124b9848a85612a84565b600160a060020a03868116908b16146124d7576124d78a858e612c40565b83600160a060020a0316635e5144eb8b878f6002870386146124fa5760016124fc565b8f5b6040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184600160a060020a0316600160a060020a03168152602001838152602001828152602001945050505050602060405180830381600087803b15801561256e57600080fd5b505af1158015612582573d6000803e3d6000fd5b505050506040513d602081101561259857600080fd5b50519b509398508893600201612403565b50929b999a50505050505050505050565b6000806000808c600281511180156125d457506015815111155b80156125e557508051600290066001145b15156125f057600080fd5b60ff88161580156125ff575086155b8015612609575085155b1561272b576003546040805160e260020a632ecd14d30281527f42616e636f7247617350726963654c696d69740000000000000000000000000060048201529051600160a060020a039092169163bb34534c916024808201926020929091908290030181600087803b15801561267e57600080fd5b505af1158015612692573d6000803e3d6000fd5b505050506040513d60208110156126a857600080fd5b5051604080517f6b4dff1f0000000000000000000000000000000000000000000000000000000081523a60048201529051919550600160a060020a03861691636b4dff1f9160248082019260009290919082900301818387803b15801561270e57600080fd5b505af1158015612722573d6000803e3d6000fd5b50505050612745565b61273a8e8b8b8e8c8c8c6128bd565b151561274557600080fd5b8d600081518110151561275457fe5b90602001906020020151925061276d8e8e8e868f61234b565b600160a060020a038216600090815260046020526040902054909e5090925060ff16156128145781600160a060020a031663205c28788c8f6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050600060405180830381600087803b1580156127f757600080fd5b505af115801561280b573d6000803e3d6000fd5b505050506128ab565b81600160a060020a031663a9059cbb8c8f6040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561287757600080fd5b505af115801561288b573d6000803e3d6000fd5b505050506040513d60208110156128a157600080fd5b505115156128ab57fe5b509a9c9b505050505050505050505050565b600080600080883a89338d8f6040518087815260200186815260200185600160a060020a0316600160a060020a03166c0100000000000000000000000002815260140184600160a060020a0316600160a060020a03166c01000000000000000000000000028152601401838152602001828051906020019060200280838360005b8381101561295657818101518382015260200161293e565b50506040805195909301859003909420600081815260056020529290922054919d505060ff161598505087159650612995955050505050505750884311155b15156129a057600080fd5b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101859052815190819003603c0181206002546000808452602084810180875284905260ff8d1685870152606085018c9052608085018b90529451929650600160a060020a039091169360019360a0808201949293601f19840193928390039091019190865af1158015612a41573d6000803e3d6000fd5b50505060206040510351600160a060020a03161490508015611336576000838152600560205260409020805460ff191660011790559a9950505050505050505050565b604080517fa5fbf287000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015260016024830152915160009284169163a5fbf28791604480830192602092919082900301818787803b158015612af057600080fd5b505af1158015612b04573d6000803e3d6000fd5b505050506040513d6020811015612b1a57600080fd5b50511515612b2757612c3a565b83600160a060020a031663c45d3d926040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612b6557600080fd5b505af1158015612b79573d6000803e3d6000fd5b505050506040513d6020811015612b8f57600080fd5b50519050600160a060020a0381161515612ba857612c3a565b80600160a060020a0316633af32abf846040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015612c0357600080fd5b505af1158015612c17573d6000803e3d6000fd5b505050506040513d6020811015612c2d57600080fd5b50511515612c3a57600080fd5b50505050565b604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152306004820152600160a060020a0384811660248301529151839286169163dd62ed3e9160448083019260209291908290030181600087803b158015612cab57600080fd5b505af1158015612cbf573d6000803e3d6000fd5b505050506040513d6020811015612cd557600080fd5b505110612ce157612eac565b604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152306004820152600160a060020a03848116602483015291519185169163dd62ed3e916044808201926020929091908290030181600087803b158015612d4c57600080fd5b505af1158015612d60573d6000803e3d6000fd5b505050506040513d6020811015612d7657600080fd5b505115612e155782600160a060020a031663095ea7b38360006040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015612de157600080fd5b505af1158015612df5573d6000803e3d6000fd5b505050506040513d6020811015612e0b57600080fd5b50511515612e1557fe5b82600160a060020a031663095ea7b383836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015612e7857600080fd5b505af1158015612e8c573d6000803e3d6000fd5b505050506040513d6020811015612ea257600080fd5b50511515612eac57fe5b5050505600a165627a7a7230582061186cca32c3e2a6034d0833a2ab4e5b30759f22b0c2f3a572f7abbe027e96b00029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd4
-----Decoded View---------------
Arg [0] : _registry (address): 0x52Ae12ABe5D8BD778BD5397F99cA900624CfADD4
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000052ae12abe5d8bd778bd5397f99ca900624cfadd4
Swarm Source
bzzr://61186cca32c3e2a6034d0833a2ab4e5b30759f22b0c2f3a572f7abbe027e96b0
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.