Kyber Smart Contract Migration: The network will switch from the current KyberNetwork contract to a new address at 7:00 PM SGT, 2nd December 2019.
Overview
ETH Balance
0.453123519546023131 ETH
Eth Value
$1,574.03 (@ $3,473.73/ETH)Token Holdings
Latest 25 from a total of 306 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 16361371 | 685 days ago | IN | 0 ETH | 0.00045117 | ||||
Transfer | 9192561 | 1788 days ago | IN | 0 ETH | 0.000021 | ||||
Remove Reserve | 9015051 | 1822 days ago | IN | 0 ETH | 0.00027712 | ||||
List Pair For Re... | 9015003 | 1822 days ago | IN | 0 ETH | 0.00047541 | ||||
List Pair For Re... | 9014993 | 1822 days ago | IN | 0 ETH | 0.00047586 | ||||
List Pair For Re... | 9014989 | 1822 days ago | IN | 0 ETH | 0.00049439 | ||||
List Pair For Re... | 9014984 | 1822 days ago | IN | 0 ETH | 0.00048619 | ||||
List Pair For Re... | 9014968 | 1822 days ago | IN | 0 ETH | 0.0004884 | ||||
Remove Reserve | 9014927 | 1822 days ago | IN | 0 ETH | 0.00026784 | ||||
List Pair For Re... | 9014881 | 1822 days ago | IN | 0 ETH | 0.00058614 | ||||
List Pair For Re... | 9014787 | 1822 days ago | IN | 0 ETH | 0.00059742 | ||||
List Pair For Re... | 9014202 | 1822 days ago | IN | 0 ETH | 0.00146872 | ||||
List Pair For Re... | 9009057 | 1823 days ago | IN | 0 ETH | 0.00046385 | ||||
List Pair For Re... | 9009046 | 1823 days ago | IN | 0 ETH | 0.00136196 | ||||
List Pair For Re... | 9008968 | 1823 days ago | IN | 0 ETH | 0.00045852 | ||||
List Pair For Re... | 8997575 | 1825 days ago | IN | 0 ETH | 0.00376609 | ||||
Add Reserve | 8997552 | 1825 days ago | IN | 0 ETH | 0.00175315 | ||||
List Pair For Re... | 8974750 | 1829 days ago | IN | 0 ETH | 0.00120018 | ||||
List Pair For Re... | 8974086 | 1829 days ago | IN | 0 ETH | 0.00162268 | ||||
List Pair For Re... | 8974075 | 1829 days ago | IN | 0 ETH | 0.00119259 | ||||
List Pair For Re... | 8974073 | 1829 days ago | IN | 0 ETH | 0.00176917 | ||||
List Pair For Re... | 8968769 | 1830 days ago | IN | 0 ETH | 0.0011831 | ||||
List Pair For Re... | 8968764 | 1830 days ago | IN | 0 ETH | 0.00124014 | ||||
List Pair For Re... | 8968752 | 1830 days ago | IN | 0 ETH | 0.00055776 | ||||
List Pair For Re... | 8967776 | 1830 days ago | IN | 0 ETH | 0.00054794 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
9037712 | 1818 days ago | 0.001 ETH | ||||
9037710 | 1818 days ago | 0.35 ETH | ||||
9037710 | 1818 days ago | 0.35 ETH | ||||
9037705 | 1818 days ago | 0.08000707 ETH | ||||
9037705 | 1818 days ago | 0.08000707 ETH | ||||
9037701 | 1818 days ago | 0.33402098 ETH | ||||
9037701 | 1818 days ago | 0.33402098 ETH | ||||
9037701 | 1818 days ago | 0.00377467 ETH | ||||
9037701 | 1818 days ago | 0.00377467 ETH | ||||
9037691 | 1818 days ago | 1.30209372 ETH | ||||
9037691 | 1818 days ago | 1.30209372 ETH | ||||
9037677 | 1818 days ago | 0.04468622 ETH | ||||
9037677 | 1818 days ago | 0.04468622 ETH | ||||
9037665 | 1818 days ago | 0.0207 ETH | ||||
9037665 | 1818 days ago | 0.0207 ETH | ||||
9037664 | 1818 days ago | 0.33237556 ETH | ||||
9037664 | 1818 days ago | 0.33237556 ETH | ||||
9037657 | 1818 days ago | 0.99700099 ETH | ||||
9037657 | 1818 days ago | 0.99700099 ETH | ||||
9037653 | 1818 days ago | 0.98867935 ETH | ||||
9037653 | 1818 days ago | 0.98867935 ETH | ||||
9037652 | 1818 days ago | 1.14055046 ETH | ||||
9037652 | 1818 days ago | 0.00836116 ETH | ||||
9037652 | 1818 days ago | 1.14891162 ETH | ||||
9037637 | 1818 days ago | 0.9976888 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x65897aDC...E31238490 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
KyberNetwork
Compiler Version
v0.4.18+commit.9cf6e910
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-01-02 */ pragma solidity 0.4.18; // File: contracts/ERC20Interface.sol // https://github.com/ethereum/EIPs/issues/20 interface ERC20 { function totalSupply() public view returns (uint supply); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); function decimals() public view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } // File: contracts/KyberReserveInterface.sol /// @title Kyber Reserve contract interface KyberReserveInterface { function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool); function getConversionRate(ERC20 src, ERC20 dest, uint srcQty, uint blockNumber) public view returns(uint); } // File: contracts/KyberNetworkInterface.sol /// @title Kyber Network interface interface KyberNetworkInterface { function maxGasPrice() public view returns(uint); function getUserCapInWei(address user) public view returns(uint); function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint); function enabled() public view returns(bool); function info(bytes32 id) public view returns(uint); function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view returns (uint expectedRate, uint slippageRate); function tradeWithHint(address trader, ERC20 src, uint srcAmount, ERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes hint) public payable returns(uint); } // File: contracts/PermissionGroups.sol contract PermissionGroups { address public admin; address public pendingAdmin; mapping(address=>bool) internal operators; mapping(address=>bool) internal alerters; address[] internal operatorsGroup; address[] internal alertersGroup; uint constant internal MAX_GROUP_SIZE = 50; function PermissionGroups() public { admin = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin); _; } modifier onlyOperator() { require(operators[msg.sender]); _; } modifier onlyAlerter() { require(alerters[msg.sender]); _; } function getOperators () external view returns(address[]) { return operatorsGroup; } function getAlerters () external view returns(address[]) { return alertersGroup; } event TransferAdminPending(address pendingAdmin); /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(pendingAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0)); TransferAdminPending(newAdmin); AdminClaimed(newAdmin, admin); admin = newAdmin; } event AdminClaimed( address newAdmin, address previousAdmin); /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender); AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } event AlerterAdded (address newAlerter, bool isAdd); function addAlerter(address newAlerter) public onlyAdmin { require(!alerters[newAlerter]); // prevent duplicates. require(alertersGroup.length < MAX_GROUP_SIZE); AlerterAdded(newAlerter, true); alerters[newAlerter] = true; alertersGroup.push(newAlerter); } function removeAlerter (address alerter) public onlyAdmin { require(alerters[alerter]); alerters[alerter] = false; for (uint i = 0; i < alertersGroup.length; ++i) { if (alertersGroup[i] == alerter) { alertersGroup[i] = alertersGroup[alertersGroup.length - 1]; alertersGroup.length--; AlerterAdded(alerter, false); break; } } } event OperatorAdded(address newOperator, bool isAdd); function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator]); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE); OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator (address operator) public onlyAdmin { require(operators[operator]); operators[operator] = false; for (uint i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.length -= 1; OperatorAdded(operator, false); break; } } } } // File: contracts/Withdrawable.sol /** * @title Contracts that should be able to recover tokens or ethers * @author Ilan Doron * @dev This allows to recover any tokens or Ethers received in a contract. * This will prevent any accidental loss of tokens. */ contract Withdrawable is PermissionGroups { event TokenWithdraw(ERC20 token, uint amount, address sendTo); /** * @dev Withdraw all ERC20 compatible tokens * @param token ERC20 The address of the token contract */ function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin { require(token.transfer(sendTo, amount)); TokenWithdraw(token, amount, sendTo); } event EtherWithdraw(uint amount, address sendTo); /** * @dev Withdraw Ethers */ function withdrawEther(uint amount, address sendTo) external onlyAdmin { sendTo.transfer(amount); EtherWithdraw(amount, sendTo); } } // File: contracts/Utils.sol /// @title Kyber constants contract contract Utils { ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint constant internal PRECISION = (10**18); uint constant internal MAX_QTY = (10**28); // 10B tokens uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH uint constant internal MAX_DECIMALS = 18; uint constant internal ETH_DECIMALS = 18; mapping(address=>uint) internal decimals; function setDecimals(ERC20 token) internal { if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS; else decimals[token] = token.decimals(); } function getDecimals(ERC20 token) internal view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access uint tokenDecimals = decimals[token]; // technically, there might be token with decimals 0 // moreover, very possible that old tokens have decimals 0 // these tokens will just have higher gas fees. if(tokenDecimals == 0) return token.decimals(); return tokenDecimals; } function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(srcQty <= MAX_QTY); require(rate <= MAX_RATE); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION; } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals))); } } function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) { require(dstQty <= MAX_QTY); require(rate <= MAX_RATE); //source quantity is rounded up. to avoid dest quantity being too low. uint numerator; uint denominator; if (srcDecimals >= dstDecimals) { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals))); denominator = rate; } else { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); numerator = (PRECISION * dstQty); denominator = (rate * (10**(dstDecimals - srcDecimals))); } return (numerator + denominator - 1) / denominator; //avoid rounding down errors } } // File: contracts/Utils2.sol contract Utils2 is Utils { /// @dev get the balance of a user. /// @param token The token type /// @return The balance function getBalance(ERC20 token, address user) public view returns(uint) { if (token == ETH_TOKEN_ADDRESS) return user.balance; else return token.balanceOf(user); } function getDecimalsSafe(ERC20 token) internal returns(uint) { if (decimals[token] == 0) { setDecimals(token); } return decimals[token]; } function calcDestAmount(ERC20 src, ERC20 dest, uint srcAmount, uint rate) internal view returns(uint) { return calcDstQty(srcAmount, getDecimals(src), getDecimals(dest), rate); } function calcSrcAmount(ERC20 src, ERC20 dest, uint destAmount, uint rate) internal view returns(uint) { return calcSrcQty(destAmount, getDecimals(src), getDecimals(dest), rate); } function calcRateFromQty(uint srcAmount, uint destAmount, uint srcDecimals, uint dstDecimals) internal pure returns(uint) { require(srcAmount <= MAX_QTY); require(destAmount <= MAX_QTY); if (dstDecimals >= srcDecimals) { require((dstDecimals - srcDecimals) <= MAX_DECIMALS); return (destAmount * PRECISION / ((10 ** (dstDecimals - srcDecimals)) * srcAmount)); } else { require((srcDecimals - dstDecimals) <= MAX_DECIMALS); return (destAmount * PRECISION * (10 ** (srcDecimals - dstDecimals)) / srcAmount); } } } // File: contracts/WhiteListInterface.sol contract WhiteListInterface { function getUserCapInWei(address user) external view returns (uint userCapWei); } // File: contracts/ExpectedRateInterface.sol interface ExpectedRateInterface { function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty, bool usePermissionless) public view returns (uint expectedRate, uint slippageRate); } // File: contracts/FeeBurnerInterface.sol interface FeeBurnerInterface { function handleFees (uint tradeWeiAmount, address reserve, address wallet) public returns(bool); function setReserveData(address reserve, uint feesInBps, address kncWallet) public; } // File: contracts/KyberNetwork.sol /** * @title Helps contracts guard against reentrancy attacks. */ contract ReentrancyGuard { /// @dev counter to allow mutex lock with only one SSTORE operation uint256 private guardCounter = 1; /** * @dev Prevents a function from calling itself, directly or indirectly. * Calling one `nonReentrant` function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and an `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { guardCounter += 1; uint256 localCounter = guardCounter; _; require(localCounter == guardCounter); } } //////////////////////////////////////////////////////////////////////////////////////////////////////// /// @title Kyber Network main contract contract KyberNetwork is Withdrawable, Utils2, KyberNetworkInterface, ReentrancyGuard { bytes public constant PERM_HINT = "PERM"; uint public constant PERM_HINT_GET_RATE = 1 << 255; // for get rate. bit mask hint. uint public negligibleRateDiff = 10; // basic rate steps will be in 0.01% KyberReserveInterface[] public reserves; mapping(address=>ReserveType) public reserveType; WhiteListInterface public whiteListContract; ExpectedRateInterface public expectedRateContract; FeeBurnerInterface public feeBurnerContract; address public kyberNetworkProxyContract; uint public maxGasPriceValue = 50 * 1000 * 1000 * 1000; // 50 gwei bool public isEnabled = false; // network is enabled mapping(bytes32=>uint) public infoFields; // this is only a UI field for external app. mapping(address=>address[]) public reservesPerTokenSrc; //reserves supporting token to eth mapping(address=>address[]) public reservesPerTokenDest;//reserves support eth to token enum ReserveType {NONE, PERMISSIONED, PERMISSIONLESS} bytes internal constant EMPTY_HINT = ""; function KyberNetwork(address _admin) public { require(_admin != address(0)); admin = _admin; } event EtherReceival(address indexed sender, uint amount); /* solhint-disable no-complex-fallback */ // To avoid users trying to swap tokens using default payable function. We added this short code // to verify Ethers will be received only from reserves if transferred without a specific function call. function() public payable { require(reserveType[msg.sender] != ReserveType.NONE); EtherReceival(msg.sender, msg.value); } /* solhint-enable no-complex-fallback */ struct TradeInput { address trader; ERC20 src; uint srcAmount; ERC20 dest; address destAddress; uint maxDestAmount; uint minConversionRate; address walletId; bytes hint; } function tradeWithHint( address trader, ERC20 src, uint srcAmount, ERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes hint ) public nonReentrant payable returns(uint) { require(msg.sender == kyberNetworkProxyContract); require((hint.length == 0) || (hint.length == 4)); TradeInput memory tradeInput; tradeInput.trader = trader; tradeInput.src = src; tradeInput.srcAmount = srcAmount; tradeInput.dest = dest; tradeInput.destAddress = destAddress; tradeInput.maxDestAmount = maxDestAmount; tradeInput.minConversionRate = minConversionRate; tradeInput.walletId = walletId; tradeInput.hint = hint; return trade(tradeInput); } event AddReserveToNetwork(KyberReserveInterface indexed reserve, bool add, bool isPermissionless); /// @notice can be called only by operator /// @dev add or deletes a reserve to/from the network. /// @param reserve The reserve address. /// @param isPermissionless is the new reserve from permissionless type. function addReserve(KyberReserveInterface reserve, bool isPermissionless) public onlyOperator returns(bool) { require(reserveType[reserve] == ReserveType.NONE); reserves.push(reserve); reserveType[reserve] = isPermissionless ? ReserveType.PERMISSIONLESS : ReserveType.PERMISSIONED; AddReserveToNetwork(reserve, true, isPermissionless); return true; } event RemoveReserveFromNetwork(KyberReserveInterface reserve); /// @notice can be called only by operator /// @dev removes a reserve from Kyber network. /// @param reserve The reserve address. /// @param index in reserve array. function removeReserve(KyberReserveInterface reserve, uint index) public onlyOperator returns(bool) { require(reserveType[reserve] != ReserveType.NONE); require(reserves[index] == reserve); reserveType[reserve] = ReserveType.NONE; reserves[index] = reserves[reserves.length - 1]; reserves.length--; RemoveReserveFromNetwork(reserve); return true; } event ListReservePairs(address indexed reserve, ERC20 src, ERC20 dest, bool add); /// @notice can be called only by operator /// @dev allow or prevent a specific reserve to trade a pair of tokens /// @param reserve The reserve address. /// @param token token address /// @param ethToToken will it support ether to token trade /// @param tokenToEth will it support token to ether trade /// @param add If true then list this pair, otherwise unlist it. function listPairForReserve(address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add) public onlyOperator returns(bool) { require(reserveType[reserve] != ReserveType.NONE); if (ethToToken) { listPairs(reserve, token, false, add); ListReservePairs(reserve, ETH_TOKEN_ADDRESS, token, add); } if (tokenToEth) { listPairs(reserve, token, true, add); if (add) { require(token.approve(reserve, 2**255)); // approve infinity } else { require(token.approve(reserve, 0)); } ListReservePairs(reserve, token, ETH_TOKEN_ADDRESS, add); } setDecimals(token); return true; } event WhiteListContractSet(WhiteListInterface newContract, WhiteListInterface currentContract); ///@param whiteList can be empty function setWhiteList(WhiteListInterface whiteList) public onlyAdmin { WhiteListContractSet(whiteList, whiteListContract); whiteListContract = whiteList; } event ExpectedRateContractSet(ExpectedRateInterface newContract, ExpectedRateInterface currentContract); function setExpectedRate(ExpectedRateInterface expectedRate) public onlyAdmin { require(expectedRate != address(0)); ExpectedRateContractSet(expectedRate, expectedRateContract); expectedRateContract = expectedRate; } event FeeBurnerContractSet(FeeBurnerInterface newContract, FeeBurnerInterface currentContract); function setFeeBurner(FeeBurnerInterface feeBurner) public onlyAdmin { require(feeBurner != address(0)); FeeBurnerContractSet(feeBurner, feeBurnerContract); feeBurnerContract = feeBurner; } event KyberNetwrokParamsSet(uint maxGasPrice, uint negligibleRateDiff); function setParams( uint _maxGasPrice, uint _negligibleRateDiff ) public onlyAdmin { require(_negligibleRateDiff <= 100 * 100); // at most 100% maxGasPriceValue = _maxGasPrice; negligibleRateDiff = _negligibleRateDiff; KyberNetwrokParamsSet(maxGasPriceValue, negligibleRateDiff); } event KyberNetworkSetEnable(bool isEnabled); function setEnable(bool _enable) public onlyAdmin { if (_enable) { require(feeBurnerContract != address(0)); require(expectedRateContract != address(0)); require(kyberNetworkProxyContract != address(0)); } isEnabled = _enable; KyberNetworkSetEnable(isEnabled); } function setInfo(bytes32 field, uint value) public onlyOperator { infoFields[field] = value; } event KyberProxySet(address proxy, address sender); function setKyberProxy(address networkProxy) public onlyAdmin { require(networkProxy != address(0)); kyberNetworkProxyContract = networkProxy; KyberProxySet(kyberNetworkProxyContract, msg.sender); } /// @dev returns number of reserves /// @return number of reserves function getNumReserves() public view returns(uint) { return reserves.length; } /// @notice should be called off chain /// @dev get an array of all reserves /// @return An array of all reserves function getReserves() public view returns(KyberReserveInterface[]) { return reserves; } function maxGasPrice() public view returns(uint) { return maxGasPriceValue; } function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view returns(uint expectedRate, uint slippageRate) { require(expectedRateContract != address(0)); bool includePermissionless = true; if (srcQty & PERM_HINT_GET_RATE > 0) { includePermissionless = false; srcQty = srcQty & ~PERM_HINT_GET_RATE; } return expectedRateContract.getExpectedRate(src, dest, srcQty, includePermissionless); } function getExpectedRateOnlyPermission(ERC20 src, ERC20 dest, uint srcQty) public view returns(uint expectedRate, uint slippageRate) { require(expectedRateContract != address(0)); return expectedRateContract.getExpectedRate(src, dest, srcQty, false); } function getUserCapInWei(address user) public view returns(uint) { if (whiteListContract == address(0)) return (2 ** 255); return whiteListContract.getUserCapInWei(user); } function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint) { //future feature user; token; require(false); } struct BestRateResult { uint rate; address reserve1; address reserve2; uint weiAmount; uint rateSrcToEth; uint rateEthToDest; uint destAmount; } /// @notice use token address ETH_TOKEN_ADDRESS for ether /// @dev best conversion rate for a pair of tokens, if number of reserves have small differences. randomize /// @param src Src token /// @param dest Destination token /// @return obsolete - used to return best reserve index. not relevant anymore for this API. function findBestRate(ERC20 src, ERC20 dest, uint srcAmount) public view returns(uint obsolete, uint rate) { BestRateResult memory result = findBestRateTokenToToken(src, dest, srcAmount, EMPTY_HINT); return(0, result.rate); } function findBestRateOnlyPermission(ERC20 src, ERC20 dest, uint srcAmount) public view returns(uint obsolete, uint rate) { BestRateResult memory result = findBestRateTokenToToken(src, dest, srcAmount, PERM_HINT); return(0, result.rate); } function enabled() public view returns(bool) { return isEnabled; } function info(bytes32 field) public view returns(uint) { return infoFields[field]; } /* solhint-disable code-complexity */ // Regarding complexity. Below code follows the required algorithm for choosing a reserve. // It has been tested, reviewed and found to be clear enough. //@dev this function always src or dest are ether. can't do token to token function searchBestRate(ERC20 src, ERC20 dest, uint srcAmount, bool usePermissionless) public view returns(address, uint) { uint bestRate = 0; uint bestReserve = 0; uint numRelevantReserves = 0; //return 1 for ether to ether if (src == dest) return (reserves[bestReserve], PRECISION); address[] memory reserveArr; reserveArr = src == ETH_TOKEN_ADDRESS ? reservesPerTokenDest[dest] : reservesPerTokenSrc[src]; if (reserveArr.length == 0) return (reserves[bestReserve], bestRate); uint[] memory rates = new uint[](reserveArr.length); uint[] memory reserveCandidates = new uint[](reserveArr.length); for (uint i = 0; i < reserveArr.length; i++) { //list all reserves that have this token. if (!usePermissionless && reserveType[reserveArr[i]] == ReserveType.PERMISSIONLESS) { continue; } rates[i] = (KyberReserveInterface(reserveArr[i])).getConversionRate(src, dest, srcAmount, block.number); if (rates[i] > bestRate) { //best rate is highest rate bestRate = rates[i]; } } if (bestRate > 0) { uint smallestRelevantRate = (bestRate * 10000) / (10000 + negligibleRateDiff); for (i = 0; i < reserveArr.length; i++) { if (rates[i] >= smallestRelevantRate) { reserveCandidates[numRelevantReserves++] = i; } } if (numRelevantReserves > 1) { //when encountering small rate diff from bestRate. draw from relevant reserves bestReserve = reserveCandidates[uint(block.blockhash(block.number-1)) % numRelevantReserves]; } else { bestReserve = reserveCandidates[0]; } bestRate = rates[bestReserve]; } return (reserveArr[bestReserve], bestRate); } /* solhint-enable code-complexity */ function findBestRateTokenToToken(ERC20 src, ERC20 dest, uint srcAmount, bytes hint) internal view returns(BestRateResult result) { //by default we use permission less reserves bool usePermissionless = true; // if hint in first 4 bytes == 'PERM' only permissioned reserves will be used. if ((hint.length >= 4) && (keccak256(hint[0], hint[1], hint[2], hint[3]) == keccak256(PERM_HINT))) { usePermissionless = false; } (result.reserve1, result.rateSrcToEth) = searchBestRate(src, ETH_TOKEN_ADDRESS, srcAmount, usePermissionless); result.weiAmount = calcDestAmount(src, ETH_TOKEN_ADDRESS, srcAmount, result.rateSrcToEth); (result.reserve2, result.rateEthToDest) = searchBestRate(ETH_TOKEN_ADDRESS, dest, result.weiAmount, usePermissionless); result.destAmount = calcDestAmount(ETH_TOKEN_ADDRESS, dest, result.weiAmount, result.rateEthToDest); result.rate = calcRateFromQty(srcAmount, result.destAmount, getDecimals(src), getDecimals(dest)); } function listPairs(address reserve, ERC20 token, bool isTokenToEth, bool add) internal { uint i; address[] storage reserveArr = reservesPerTokenDest[token]; if (isTokenToEth) { reserveArr = reservesPerTokenSrc[token]; } for (i = 0; i < reserveArr.length; i++) { if (reserve == reserveArr[i]) { if (add) { break; //already added } else { //remove reserveArr[i] = reserveArr[reserveArr.length - 1]; reserveArr.length--; break; } } } if (add && i == reserveArr.length) { //if reserve wasn't found add it reserveArr.push(reserve); } } event KyberTrade(address indexed trader, ERC20 src, ERC20 dest, uint srcAmount, uint dstAmount, address destAddress, uint ethWeiValue, address reserve1, address reserve2, bytes hint); /* solhint-disable function-max-lines */ // Most of the lines here are functions calls spread over multiple lines. We find this function readable enough /// @notice use token address ETH_TOKEN_ADDRESS for ether /// @dev trade api for kyber network. /// @param tradeInput structure of trade inputs function trade(TradeInput tradeInput) internal returns(uint) { require(isEnabled); require(tx.gasprice <= maxGasPriceValue); require(validateTradeInput(tradeInput.src, tradeInput.srcAmount, tradeInput.dest, tradeInput.destAddress)); BestRateResult memory rateResult = findBestRateTokenToToken(tradeInput.src, tradeInput.dest, tradeInput.srcAmount, tradeInput.hint); require(rateResult.rate > 0); require(rateResult.rate < MAX_RATE); require(rateResult.rate >= tradeInput.minConversionRate); uint actualDestAmount; uint weiAmount; uint actualSrcAmount; (actualSrcAmount, weiAmount, actualDestAmount) = calcActualAmounts(tradeInput.src, tradeInput.dest, tradeInput.srcAmount, tradeInput.maxDestAmount, rateResult); require(getUserCapInWei(tradeInput.trader) >= weiAmount); require(handleChange(tradeInput.src, tradeInput.srcAmount, actualSrcAmount, tradeInput.trader)); require(doReserveTrade( //src to ETH tradeInput.src, actualSrcAmount, ETH_TOKEN_ADDRESS, this, weiAmount, KyberReserveInterface(rateResult.reserve1), rateResult.rateSrcToEth, true)); require(doReserveTrade( //Eth to dest ETH_TOKEN_ADDRESS, weiAmount, tradeInput.dest, tradeInput.destAddress, actualDestAmount, KyberReserveInterface(rateResult.reserve2), rateResult.rateEthToDest, true)); if (tradeInput.src != ETH_TOKEN_ADDRESS) //"fake" trade. (ether to ether) - don't burn. require(feeBurnerContract.handleFees(weiAmount, rateResult.reserve1, tradeInput.walletId)); if (tradeInput.dest != ETH_TOKEN_ADDRESS) //"fake" trade. (ether to ether) - don't burn. require(feeBurnerContract.handleFees(weiAmount, rateResult.reserve2, tradeInput.walletId)); KyberTrade({ trader: tradeInput.trader, src: tradeInput.src, dest: tradeInput.dest, srcAmount: actualSrcAmount, dstAmount: actualDestAmount, destAddress: tradeInput.destAddress, ethWeiValue: weiAmount, reserve1: (tradeInput.src == ETH_TOKEN_ADDRESS) ? address(0) : rateResult.reserve1, reserve2: (tradeInput.dest == ETH_TOKEN_ADDRESS) ? address(0) : rateResult.reserve2, hint: tradeInput.hint }); return actualDestAmount; } /* solhint-enable function-max-lines */ function calcActualAmounts (ERC20 src, ERC20 dest, uint srcAmount, uint maxDestAmount, BestRateResult rateResult) internal view returns(uint actualSrcAmount, uint weiAmount, uint actualDestAmount) { if (rateResult.destAmount > maxDestAmount) { actualDestAmount = maxDestAmount; weiAmount = calcSrcAmount(ETH_TOKEN_ADDRESS, dest, actualDestAmount, rateResult.rateEthToDest); actualSrcAmount = calcSrcAmount(src, ETH_TOKEN_ADDRESS, weiAmount, rateResult.rateSrcToEth); require(actualSrcAmount <= srcAmount); } else { actualDestAmount = rateResult.destAmount; actualSrcAmount = srcAmount; weiAmount = rateResult.weiAmount; } } /// @notice use token address ETH_TOKEN_ADDRESS for ether /// @dev do one trade with a reserve /// @param src Src token /// @param amount amount of src tokens /// @param dest Destination token /// @param destAddress Address to send tokens to /// @param reserve Reserve to use /// @param validate If true, additional validations are applicable /// @return true if trade is successful function doReserveTrade( ERC20 src, uint amount, ERC20 dest, address destAddress, uint expectedDestAmount, KyberReserveInterface reserve, uint conversionRate, bool validate ) internal returns(bool) { uint callValue = 0; if (src == dest) { //this is for a "fake" trade when both src and dest are ethers. if (destAddress != (address(this))) destAddress.transfer(amount); return true; } if (src == ETH_TOKEN_ADDRESS) { callValue = amount; } // reserve sends tokens/eth to network. network sends it to destination require(reserve.trade.value(callValue)(src, amount, dest, this, conversionRate, validate)); if (destAddress != address(this)) { //for token to token dest address is network. and Ether / token already here... if (dest == ETH_TOKEN_ADDRESS) { destAddress.transfer(expectedDestAmount); } else { require(dest.transfer(destAddress, expectedDestAmount)); } } return true; } /// when user sets max dest amount we could have too many source tokens == change. so we send it back to user. function handleChange (ERC20 src, uint srcAmount, uint requiredSrcAmount, address trader) internal returns (bool) { if (requiredSrcAmount < srcAmount) { //if there is "change" send back to trader if (src == ETH_TOKEN_ADDRESS) { trader.transfer(srcAmount - requiredSrcAmount); } else { require(src.transfer(trader, (srcAmount - requiredSrcAmount))); } } return true; } /// @notice use token address ETH_TOKEN_ADDRESS for ether /// @dev checks that user sent ether/tokens to contract before trade /// @param src Src token /// @param srcAmount amount of src tokens /// @return true if tradeInput is valid function validateTradeInput(ERC20 src, uint srcAmount, ERC20 dest, address destAddress) internal view returns(bool) { require(srcAmount <= MAX_QTY); require(srcAmount != 0); require(destAddress != address(0)); require(src != dest); if (src == ETH_TOKEN_ADDRESS) { require(msg.value == srcAmount); } else { require(msg.value == 0); //funds should have been moved to this contract already. require(src.balanceOf(this) >= srcAmount); } return true; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":false,"inputs":[{"name":"alerter","type":"address"}],"name":"removeAlerter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"trader","type":"address"},{"name":"src","type":"address"},{"name":"srcAmount","type":"uint256"},{"name":"dest","type":"address"},{"name":"destAddress","type":"address"},{"name":"maxDestAmount","type":"uint256"},{"name":"minConversionRate","type":"uint256"},{"name":"walletId","type":"address"},{"name":"hint","type":"bytes"}],"name":"tradeWithHint","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getReserves","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcAmount","type":"uint256"},{"name":"usePermissionless","type":"bool"}],"name":"searchBestRate","outputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"infoFields","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"feeBurner","type":"address"}],"name":"setFeeBurner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcAmount","type":"uint256"}],"name":"findBestRateOnlyPermission","outputs":[{"name":"obsolete","type":"uint256"},{"name":"rate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"enabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"reserve","type":"address"},{"name":"index","type":"uint256"}],"name":"removeReserve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getOperators","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"reservesPerTokenSrc","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"whiteList","type":"address"}],"name":"setWhiteList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"amount","type":"uint256"},{"name":"sendTo","type":"address"}],"name":"withdrawToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxGasPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAlerter","type":"address"}],"name":"addAlerter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"negligibleRateDiff","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feeBurnerContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"expectedRate","type":"address"}],"name":"setExpectedRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"expectedRateContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"whiteListContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"field","type":"bytes32"},{"name":"value","type":"uint256"}],"name":"setInfo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"user","type":"address"}],"name":"getUserCapInWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"reserveType","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_enable","type":"bool"}],"name":"setEnable","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claimAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"kyberNetworkProxyContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getAlerters","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcQty","type":"uint256"}],"name":"getExpectedRate","outputs":[{"name":"expectedRate","type":"uint256"},{"name":"slippageRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"reserves","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcQty","type":"uint256"}],"name":"getExpectedRateOnlyPermission","outputs":[{"name":"expectedRate","type":"uint256"},{"name":"slippageRate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERM_HINT","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"user","type":"address"},{"name":"token","type":"address"}],"name":"getUserCapInTokenWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"reservesPerTokenDest","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOperator","type":"address"}],"name":"addOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"reserve","type":"address"},{"name":"isPermissionless","type":"bool"}],"name":"addReserve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"operator","type":"address"}],"name":"removeOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxGasPriceValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"field","type":"bytes32"}],"name":"info","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"src","type":"address"},{"name":"dest","type":"address"},{"name":"srcAmount","type":"uint256"}],"name":"findBestRate","outputs":[{"name":"obsolete","type":"uint256"},{"name":"rate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_maxGasPrice","type":"uint256"},{"name":"_negligibleRateDiff","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PERM_HINT_GET_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"networkProxy","type":"address"}],"name":"setKyberProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"},{"name":"sendTo","type":"address"}],"name":"withdrawEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getNumReserves","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"},{"name":"user","type":"address"}],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"reserve","type":"address"},{"name":"token","type":"address"},{"name":"ethToToken","type":"bool"},{"name":"tokenToEth","type":"bool"},{"name":"add","type":"bool"}],"name":"listPairForReserve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_admin","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"EtherReceival","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"reserve","type":"address"},{"indexed":false,"name":"add","type":"bool"},{"indexed":false,"name":"isPermissionless","type":"bool"}],"name":"AddReserveToNetwork","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"reserve","type":"address"}],"name":"RemoveReserveFromNetwork","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"reserve","type":"address"},{"indexed":false,"name":"src","type":"address"},{"indexed":false,"name":"dest","type":"address"},{"indexed":false,"name":"add","type":"bool"}],"name":"ListReservePairs","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"},{"indexed":false,"name":"currentContract","type":"address"}],"name":"WhiteListContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"},{"indexed":false,"name":"currentContract","type":"address"}],"name":"ExpectedRateContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"},{"indexed":false,"name":"currentContract","type":"address"}],"name":"FeeBurnerContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"maxGasPrice","type":"uint256"},{"indexed":false,"name":"negligibleRateDiff","type":"uint256"}],"name":"KyberNetwrokParamsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"isEnabled","type":"bool"}],"name":"KyberNetworkSetEnable","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proxy","type":"address"},{"indexed":false,"name":"sender","type":"address"}],"name":"KyberProxySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"trader","type":"address"},{"indexed":false,"name":"src","type":"address"},{"indexed":false,"name":"dest","type":"address"},{"indexed":false,"name":"srcAmount","type":"uint256"},{"indexed":false,"name":"dstAmount","type":"uint256"},{"indexed":false,"name":"destAddress","type":"address"},{"indexed":false,"name":"ethWeiValue","type":"uint256"},{"indexed":false,"name":"reserve1","type":"address"},{"indexed":false,"name":"reserve2","type":"address"},{"indexed":false,"name":"hint","type":"bytes"}],"name":"KyberTrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"sendTo","type":"address"}],"name":"TokenWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"sendTo","type":"address"}],"name":"EtherWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAdmin","type":"address"},{"indexed":false,"name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAlerter","type":"address"},{"indexed":false,"name":"isAdd","type":"bool"}],"name":"AlerterAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOperator","type":"address"},{"indexed":false,"name":"isAdd","type":"bool"}],"name":"OperatorAdded","type":"event"}]
Deployed Bytecode
0x60606040526004361061024d5763ffffffff60e060020a60003504166301a12fd381146102be578063088322ef146102df5780630902f1ac1461036f5780630c235d96146103d55780631610b59b146104245780631a79464e1461043a5780631dc1f78d14610459578063238dafe014610499578063249715b3146104c057806326782247146104e257806327a099d8146105115780632ab8fc2d1461052457806339e899ee146105465780633ccdbb28146105655780633de39c111461058e578063408ee7fe146105a15780634cef5a5c146105c0578063579425b7146105d35780635d270cdc146105e65780635dada964146106055780635ed5ea28146106185780635f65d7031461062b5780636432679f146106445780636aa633b614610663578063749f95bf1461067657806375829def146106b95780637726bed3146106d857806377f50f97146106f0578063785250da146107035780637acc8678146107165780637c423f5414610735578063809a9e55146107485780638334278d1461077057806385dc0c56146107865780638b98a2c5146107ae5780638eaaeecf14610838578063937e909b1461085d5780639870d7fe1461087f578063a0d7bb1b1461089e578063ac8a584a146108c2578063b2d111f6146108e1578063b64a097e146108f4578063b8388aca1461090a578063c0324c7714610932578063c0919ac61461094b578063c6c3f3f91461095e578063ce56c4541461097d578063cfff25bb1461099f578063d4fac45d146109b2578063e02584bf146109d7578063f851a44014610a0b575b33600160a060020a03166000908152600a602052604081205460ff16600281111561027457fe5b141561027f57600080fd5b33600160a060020a03167f75f33ed68675112c77094e7c5b073890598be1d23e27cd7f6907b4a7d98ac6193460405190815260200160405180910390a2005b34156102c957600080fd5b6102dd600160a060020a0360043516610a1e565b005b61035d600160a060020a0360048035821691602480358216926044359260643581169260843582169260a4359260c4359260e4359091169190610124906101043590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b8e95505050505050565b60405190815260200160405180910390f35b341561037a57600080fd5b610382610c49565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103c15780820151838201526020016103a9565b505050509050019250505060405180910390f35b34156103e057600080fd5b610402600160a060020a03600435811690602435166044356064351515610cb2565b604051600160a060020a03909216825260208201526040908101905180910390f35b341561042f57600080fd5b61035d6004356110c2565b341561044557600080fd5b6102dd600160a060020a03600435166110d4565b341561046457600080fd5b610481600160a060020a0360043581169060243516604435611179565b60405191825260208201526040908101905180910390f35b34156104a457600080fd5b6104ac6111d6565b604051901515815260200160405180910390f35b34156104cb57600080fd5b6104ac600160a060020a03600435166024356111df565b34156104ed57600080fd5b6104f561134c565b604051600160a060020a03909116815260200160405180910390f35b341561051c57600080fd5b61038261135b565b341561052f57600080fd5b6104f5600160a060020a03600435166024356113c1565b341561055157600080fd5b6102dd600160a060020a03600435166113f8565b341561057057600080fd5b6102dd600160a060020a036004358116906024359060443516611488565b341561059957600080fd5b61035d61157f565b34156105ac57600080fd5b6102dd600160a060020a0360043516611585565b34156105cb57600080fd5b61035d611681565b34156105de57600080fd5b6104f5611687565b34156105f157600080fd5b6102dd600160a060020a0360043516611696565b341561061057600080fd5b6104f561173b565b341561062357600080fd5b6104f561174a565b341561063657600080fd5b6102dd600435602435611759565b341561064f57600080fd5b61035d600160a060020a0360043516611792565b341561066e57600080fd5b6104ac61182d565b341561068157600080fd5b610695600160a060020a0360043516611836565b604051808260028111156106a557fe5b60ff16815260200191505060405180910390f35b34156106c457600080fd5b6102dd600160a060020a036004351661184b565b34156106e357600080fd5b6102dd60043515156118e6565b34156106fb57600080fd5b6102dd611997565b341561070e57600080fd5b6104f5611a31565b341561072157600080fd5b6102dd600160a060020a0360043516611a40565b341561074057600080fd5b610382611b22565b341561075357600080fd5b610481600160a060020a0360043581169060243516604435611b88565b341561077b57600080fd5b6104f5600435611c81565b341561079157600080fd5b610481600160a060020a0360043581169060243516604435611ca9565b34156107b957600080fd5b6107c1611d63565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156107fd5780820151838201526020016107e5565b50505050905090810190601f16801561082a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561084357600080fd5b61035d600160a060020a0360043581169060243516611d9a565b341561086857600080fd5b6104f5600160a060020a0360043516602435611da0565b341561088a57600080fd5b6102dd600160a060020a0360043516611dbb565b34156108a957600080fd5b6104ac600160a060020a03600435166024351515611e8b565b34156108cd57600080fd5b6102dd600160a060020a0360043516611fac565b34156108ec57600080fd5b61035d612118565b34156108ff57600080fd5b61035d60043561211e565b341561091557600080fd5b610481600160a060020a0360043581169060243516604435612130565b341561093d57600080fd5b6102dd600435602435612155565b341561095657600080fd5b61035d6121c7565b341561096957600080fd5b6102dd600160a060020a03600435166121cf565b341561098857600080fd5b6102dd600435600160a060020a036024351661226a565b34156109aa57600080fd5b61035d6122fd565b34156109bd57600080fd5b61035d600160a060020a0360043581169060243516612303565b34156109e257600080fd5b6104ac600160a060020a03600435811690602435166044351515606435151560843515156123ae565b3415610a1657600080fd5b6104f5612633565b6000805433600160a060020a03908116911614610a3a57600080fd5b600160a060020a03821660009081526003602052604090205460ff161515610a6157600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b600554811015610b8a5781600160a060020a0316600582815481101515610aa657fe5b600091825260209091200154600160a060020a03161415610b8257600580546000198101908110610ad357fe5b60009182526020909120015460058054600160a060020a039092169183908110610af957fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556005805490610b35906000198301613695565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610b8a565b600101610a83565b5050565b6000610b986136be565b6007805460010190819055600e5433600160a060020a03908116911614610bbe57600080fd5b83511580610bcd575083516004145b1515610bd857600080fd5b600160a060020a03808d1683528b81166020840152604083018b90528981166060840152888116608084015260a0830188905260c08301879052851660e08301526101008201849052610c2a82612642565b92506007548114610c3a57600080fd5b50509998505050505050505050565b610c51613711565b6009805480602002602001604051908101604052809291908181526020018280548015610ca757602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c89575b505050505090505b90565b6000806000806000610cc2613711565b610cca613711565b610cd2613711565b6000806000975060009650600095508c600160a060020a03168e600160a060020a03161415610d30576009805488908110610d0957fe5b600091825260209091200154600160a060020a03169950670de0b6b3a764000098506110b1565b600160a060020a038e1660008051602061379283398151915214610d6b57600160a060020a038e166000908152601260205260409020610d84565b600160a060020a038d1660009081526013602052604090205b805480602002602001604051908101604052809291908181526020018280548015610dd857602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610dba575b5050505050945084511515610e16576009805488908110610df557fe5b600091825260209091200154600160a060020a0316995096975087966110b1565b8451604051805910610e255750595b908082528060200260200182016040525093508451604051805910610e475750595b90808252806020026020018201604052509250600091505b8451821015610fb8578a158015610eb757506002600a6000878581518110610e8357fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff166002811115610eb557fe5b145b15610ec157610fad565b848281518110610ecd57fe5b90602001906020020151600160a060020a0316637cd442728f8f8f4360006040516020015260405160e060020a63ffffffff8716028152600160a060020a03948516600482015292909316602483015260448201526064810191909152608401602060405180830381600087803b1515610f4657600080fd5b6102c65a03f11515610f5757600080fd5b50505060405180519050848381518110610f6d57fe5b6020908102909101015287848381518110610f8457fe5b906020019060200201511115610fad57838281518110610fa057fe5b9060200190602002015197505b600190910190610e5f565b600088111561109557600854612710018861271002811515610fd657fe5b049050600091505b845182101561102c5780848381518110610ff457fe5b9060200190602002015110611021578183878060010198508151811061101657fe5b602090810290910101525b600190910190610fde565b600186111561106257828660001943014081151561104657fe5b068151811061105157fe5b90602001906020020151965061107c565b8260008151811061106f57fe5b9060200190602002015196505b83878151811061108857fe5b9060200190602002015197505b8487815181106110a157fe5b9060200190602002015188995099505b505050505050505094509492505050565b60116020526000908152604090205481565b60005433600160a060020a039081169116146110ef57600080fd5b600160a060020a038116151561110457600080fd5b600d547f91251c8b04e3ed4b921776c3aced2ad433c3701257fc5666cb35239ec4df5411908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a1600d8054600160a060020a031916600160a060020a0392909216919091179055565b600080611184613723565b6111c386868660408051908101604052600481527f5045524d000000000000000000000000000000000000000000000000000000006020820152612aa4565b9050600081519097909650945050505050565b60105460ff1690565b600160a060020a03331660009081526002602052604081205460ff16151561120657600080fd5b600160a060020a0383166000908152600a602052604081205460ff16600281111561122d57fe5b141561123857600080fd5b82600160a060020a031660098381548110151561125157fe5b600091825260209091200154600160a060020a03161461127057600080fd5b600160a060020a0383166000908152600a60205260409020805460ff191690556009805460001981019081106112a257fe5b60009182526020909120015460098054600160a060020a0390921691849081106112c857fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556009805490611304906000198301613695565b507f861f07ab6bad95b71c362ed240dc0082c3d9bbfe75e7830be646ef0d61da311783604051600160a060020a03909116815260200160405180910390a15060015b92915050565b600154600160a060020a031681565b611363613711565b6004805480602002602001604051908101604052809291908181526020018280548015610ca757602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610c89575050505050905090565b6012602052816000526040600020818154811015156113dc57fe5b600091825260209091200154600160a060020a03169150829050565b60005433600160a060020a0390811691161461141357600080fd5b600b547f1eae61fde1a37f65af69f00b4269aa5fda423f684194d303865cba6c650b2366908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a1600b8054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146114a357600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561150057600080fd5b6102c65a03f1151561151157600080fd5b50505060405180519050151561152657600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b600f5490565b60005433600160a060020a039081169116146115a057600080fd5b600160a060020a03811660009081526003602052604090205460ff16156115c657600080fd5b600554603290106115d657600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560058054909181016116558382613695565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b60085481565b600d54600160a060020a031681565b60005433600160a060020a039081169116146116b157600080fd5b600160a060020a03811615156116c657600080fd5b600c547fa2446ac1a8b17e6d40c1cafcbf076b945fdc5f897c970e6e19915760def475ad908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a1600c8054600160a060020a031916600160a060020a0392909216919091179055565b600c54600160a060020a031681565b600b54600160a060020a031681565b600160a060020a03331660009081526002602052604090205460ff16151561178057600080fd5b60009182526011602052604090912055565b600b54600090600160a060020a031615156117b2575060ff60020a611828565b600b54600160a060020a0316636432679f8360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561180b57600080fd5b6102c65a03f1151561181c57600080fd5b50505060405180519150505b919050565b60105460ff1681565b600a6020526000908152604090205460ff1681565b60005433600160a060020a0390811691161461186657600080fd5b600160a060020a038116151561187b57600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461190157600080fd5b801561194c57600d54600160a060020a0316151561191e57600080fd5b600c54600160a060020a0316151561193557600080fd5b600e54600160a060020a0316151561194c57600080fd5b6010805460ff191682151517908190557f8a846a525e22497042ee2f99423a8ff8bbb831d3ae5384692bf6040f591c1eba9060ff16604051901515815260200160405180910390a150565b60015433600160a060020a039081169116146119b257600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b600e54600160a060020a031681565b60005433600160a060020a03908116911614611a5b57600080fd5b600160a060020a0381161515611a7057600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b611b2a613711565b6005805480602002602001604051908101604052809291908181526020018280548015610ca757602002820191906000526020600020908154600160a060020a03168152600190910190602001808311610c89575050505050905090565b600c5460009081908190600160a060020a03161515611ba657600080fd5b506001600060ff60020a85161115611be257507f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff929092169160005b600c54600160a060020a031663d38d2bea8787878560006040516040015260405160e060020a63ffffffff8716028152600160a060020a039485166004820152929093166024830152604482015290151560648201526084016040805180830381600087803b1515611c5357600080fd5b6102c65a03f11515611c6457600080fd5b505050604051805190602001805190509250925050935093915050565b6009805482908110611c8f57fe5b600091825260209091200154600160a060020a0316905081565b600c546000908190600160a060020a03161515611cc557600080fd5b600c54600160a060020a031663d38d2bea8686866000806040516040015260405160e060020a63ffffffff8716028152600160a060020a039485166004820152929093166024830152604482015290151560648201526084016040805180830381600087803b1515611d3657600080fd5b6102c65a03f11515611d4757600080fd5b5050506040518051906020018051905091509150935093915050565b60408051908101604052600481527f5045524d00000000000000000000000000000000000000000000000000000000602082015281565b60008080fd5b6013602052816000526040600020818154811015156113dc57fe5b60005433600160a060020a03908116911614611dd657600080fd5b600160a060020a03811660009081526002602052604090205460ff1615611dfc57600080fd5b60045460329010611e0c57600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff1916600190811790915560048054909181016116558382613695565b600160a060020a03331660009081526002602052604081205460ff161515611eb257600080fd5b600160a060020a0383166000908152600a602052604081205460ff166002811115611ed957fe5b14611ee357600080fd5b6009805460018101611ef58382613695565b5060009182526020909120018054600160a060020a031916600160a060020a03851617905581611f26576001611f29565b60025b600160a060020a0384166000908152600a60205260409020805460ff19166001836002811115611f5557fe5b021790555082600160a060020a03167f4d99ce7cd99dfb1a7692e50c2e9b8d84c1b420f1d439ca8c4de0171acac119076001846040519115158252151560208201526040908101905180910390a250600192915050565b6000805433600160a060020a03908116911614611fc857600080fd5b600160a060020a03821660009081526002602052604090205460ff161515611fef57600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b600454811015610b8a5781600160a060020a031660048281548110151561203457fe5b600091825260209091200154600160a060020a031614156121105760048054600019810190811061206157fe5b60009182526020909120015460048054600160a060020a03909216918390811061208757fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556004805460001901906120c39082613695565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610b8a565b600101612011565b600f5481565b60009081526011602052604090205490565b60008061213b613723565b6111c3868686602060405190810160405260008152612aa4565b60005433600160a060020a0390811691161461217057600080fd5b61271081111561217f57600080fd5b600f82905560088190557fc1bdc2503431144078ba3cb975f03be0f6c1d365cf490875e7534b4ca70c863e828260405191825260208201526040908101905180910390a15050565b60ff60020a81565b60005433600160a060020a039081169116146121ea57600080fd5b600160a060020a03811615156121ff57600080fd5b600e8054600160a060020a031916600160a060020a0383811691909117918290557ffdd305502f7797ff3390aa08825f7f6aec92c27a94e103bfaf45452b4cf1d4f4911633604051600160a060020a039283168152911660208201526040908101905180910390a150565b60005433600160a060020a0390811691161461228557600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f1935050505015156122b657600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b60095490565b6000600160a060020a03831660008051602061379283398151915214156123355750600160a060020a03811631611346565b82600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561238c57600080fd5b6102c65a03f1151561239d57600080fd5b505050604051805190509050611346565b600160a060020a03331660009081526002602052604081205460ff1615156123d557600080fd5b600160a060020a0386166000908152600a602052604081205460ff1660028111156123fc57fe5b141561240757600080fd5b83156124885761241a8686600085612cf7565b85600160a060020a03167fadb5a4f14d89b3a5ffb3900ac1ea4574d991f93887f6199fabaf25393644e01c6000805160206137928339815191528785604051600160a060020a0393841681529190921660208201529015156040808301919091526060909101905180910390a25b821561261e5761249b8686600185612cf7565b811561252d5784600160a060020a031663095ea7b38760ff60020a60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561250257600080fd5b6102c65a03f1151561251357600080fd5b50505060405180519050151561252857600080fd5b6125b0565b84600160a060020a031663095ea7b3876000806040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561258a57600080fd5b6102c65a03f1151561259b57600080fd5b5050506040518051905015156125b057600080fd5b85600160a060020a03167fadb5a4f14d89b3a5ffb3900ac1ea4574d991f93887f6199fabaf25393644e01c8660008051602061379283398151915285604051600160a060020a0393841681529190921660208201529015156040808301919091526060909101905180910390a25b61262785612e49565b50600195945050505050565b600054600160a060020a031681565b600061264c613723565b6010546000908190819060ff16151561266457600080fd5b600f543a111561267357600080fd5b61268f8660200151876040015188606001518960800151612f06565b151561269a57600080fd5b6126b7866020015187606001518860400151896101000151612aa4565b935060008451116126c757600080fd5b69d3c21bcecceda10000008451106126de57600080fd5b8560c00151845110156126f057600080fd5b61270d8660200151876060015188604001518960a0015188613022565b9450925090508161271e8751611792565b101561272957600080fd5b61273e866020015187604001518389516130a4565b151561274957600080fd5b612774866020015182600080516020613792833981519152308689602001518a608001516001613186565b151561277f57600080fd5b6127ae60008051602061379283398151915283886060015189608001518789604001518a60a001516001613186565b15156127b957600080fd5b6000805160206137928339815191526020870151600160a060020a03161461287257600d54600160a060020a031663fd062d3b8360208701518960e0015160006040516020015260405160e060020a63ffffffff86160281526004810193909352600160a060020a039182166024840152166044820152606401602060405180830381600087803b151561284c57600080fd5b6102c65a03f1151561285d57600080fd5b50505060405180519050151561287257600080fd5b6000805160206137928339815191526060870151600160a060020a03161461292b57600d54600160a060020a031663fd062d3b8360408701518960e0015160006040516020015260405160e060020a63ffffffff86160281526004810193909352600160a060020a039182166024840152166044820152606401602060405180830381600087803b151561290557600080fd5b6102c65a03f1151561291657600080fd5b50505060405180519050151561292b57600080fd5b8551600160a060020a03167fd30ca399cb43507ecec6a629a35cf45eb98cda550c27696dcb0d8c4a3873ce6c8760200151886060015184878b608001518860008051602061379283398151915260208f0151600160a060020a031614612995578b60200151612998565b60005b600080516020613792833981519152600160a060020a03168f60600151600160a060020a0316146129cd578c604001516129d0565b60005b8f6101000151604051600160a060020a03808b16825289811660208301526040820189905260608201889052868116608083015260a0820186905284811660c0830152831660e0820152610120610100820181815290820183818151815260200191508051906020019080838360005b83811015612a58578082015183820152602001612a40565b50505050905090810190601f168015612a855780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390a25090949350505050565b612aac613723565b60016004835110158015612c165750604080519081016040908152600482527f5045524d000000000000000000000000000000000000000000000000000000006020830152518082805190602001908083835b60208310612b1e5780518252601f199092019160209182019101612aff565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902083600081518110612b5857fe5b016020015160f860020a900460f860020a0284600181518110612b7757fe5b016020015160f860020a900460f860020a0285600281518110612b9657fe5b016020015160f860020a900460f860020a0286600381518110612bb557fe5b016020015160f860020a900460f860020a026040517fff000000000000000000000000000000000000000000000000000000000000009485168152928416600184015290831660028301529091166003820152600401604051908190039020145b15612c1f575060005b612c39866000805160206137928339815191528684610cb2565b60808401908152600160a060020a039091166020840152612c6e908790600080516020613792833981519152908790516133c3565b60608301908152612c92906000805160206137928339815191529087905184610cb2565b60a0840152600160a060020a03166040830152612cc76000805160206137928339815191528660608501518560a001516133c3565b60c08301908152612cec90859051612cde896133ea565b612ce7896133ea565b6134a8565b825250949350505050565b600160a060020a03831660009081526013602052604081208315612d2f5750600160a060020a03841660009081526012602052604090205b600091505b8054821015612df7578082815481101515612d4b57fe5b600091825260209091200154600160a060020a0387811691161415612dec578215612d7557612df7565b805481906000198101908110612d8757fe5b6000918252602090912001548154600160a060020a0390911690829084908110612dad57fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790558054612de6826000198301613695565b50612df7565b600190910190612d34565b828015612e045750805482145b15612e41578054819060018101612e1b8382613695565b5060009182526020909120018054600160a060020a031916600160a060020a0388161790555b505050505050565b600160a060020a0381166000805160206137928339815191521415612e8957600160a060020a038116600090815260066020526040902060129055612f03565b80600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515612ecf57600080fd5b6102c65a03f11515612ee057600080fd5b5050506040518051600160a060020a038316600090815260066020526040902055505b50565b60006b204fce5e3e25026110000000841115612f2157600080fd5b831515612f2d57600080fd5b600160a060020a0382161515612f4257600080fd5b600160a060020a038581169084161415612f5b57600080fd5b600160a060020a0385166000805160206137928339815191521415612f8b57348414612f8657600080fd5b613016565b3415612f9657600080fd5b8385600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612fee57600080fd5b6102c65a03f11515612fff57600080fd5b505050604051805190501015151561301657600080fd5b5060015b949350505050565b6000806000848460c001511115613087575083613053600080516020613792833981519152888360a0880151613543565b915061307388600080516020613792833981519152848760800151613543565b92508583111561308257600080fd5b613099565b8360c001519050859250836060015191505b955095509592505050565b60008383101561301657600160a060020a038516600080516020613792833981519152141561310157600160a060020a03821683850380156108fc0290604051600060405180830381858888f193505050501515612f8657600080fd5b84600160a060020a031663a9059cbb8385870360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561316057600080fd5b6102c65a03f1151561317157600080fd5b50505060405180519050151561301657600080fd5b600080600160a060020a038a811690891614156131f25730600160a060020a031687600160a060020a03161415156131e957600160a060020a03871689156108fc028a604051600060405180830381858888f1935050505015156131e957600080fd5b600191506133b6565b600160a060020a038a1660008051602061379283398151915214156132145750875b84600160a060020a0316636cf69811828c8c8c308a8a60006040516020015260405160e060020a63ffffffff8a16028152600160a060020a0396871660048201526024810195909552928516604485015293166064830152608482019290925290151560a482015260c4016020604051808303818588803b151561329757600080fd5b6125ee5a03f115156132a857600080fd5b505050506040518051905015156132be57600080fd5b30600160a060020a031687600160a060020a03161415156133b157600160a060020a038816600080516020613792833981519152141561332e57600160a060020a03871686156108fc0287604051600060405180830381858888f19350505050151561332957600080fd5b6133b1565b87600160a060020a031663a9059cbb888860006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561338b57600080fd5b6102c65a03f1151561339c57600080fd5b5050506040518051905015156133b157600080fd5b600191505b5098975050505050505050565b60006133e1836133d2876133ea565b6133db876133ea565b85613561565b95945050505050565b600080600160a060020a038316600080516020613792833981519152141561341557601291506134a2565b50600160a060020a03821660009081526006602052604090205480151561349e5782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561347c57600080fd5b6102c65a03f1151561348d57600080fd5b5050506040518051905091506134a2565b8091505b50919050565b60006b204fce5e3e250261100000008511156134c357600080fd5b6b204fce5e3e250261100000008411156134dc57600080fd5b82821061351757601283830311156134f357600080fd5b84838303600a0a02670de0b6b3a7640000850281151561350f57fe5b04905061301a565b6012828403111561352757600080fd5b84828403600a0a670de0b6b3a764000086020281151561350f57fe5b60006133e183613552876133ea565b61355b876133ea565b856135ee565b60006b204fce5e3e2502611000000085111561357c57600080fd5b69d3c21bcecceda100000082111561359357600080fd5b8383106135c257601284840311156135aa57600080fd5b670de0b6b3a7640000858302858503600a0a0261350f565b601283850311156135d257600080fd5b828403600a0a670de0b6b3a76400000282860281151561350f57fe5b600080806b204fce5e3e2502611000000087111561360b57600080fd5b69d3c21bcecceda100000084111561362257600080fd5b848610613653576012858703111561363957600080fd5b5050828403600a0a8502670de0b6b3a76400000282613679565b6012868603111561366357600080fd5b5050670de0b6b3a76400008502848403600a0a83025b8060018284010381151561368957fe5b04979650505050505050565b8154818355818115116136b9576000838152602090206136b9918101908301613773565b505050565b6101206040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820152610100810161370c613711565b905290565b60206040519081016040526000815290565b60e060405190810160405280600081526020016000600160a060020a031681526020016000600160a060020a03168152602001600081526020016000815260200160008152602001600081525090565b610caf91905b8082111561378d5760008155600101613779565b50905600000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeea165627a7a7230582014161e4c4b7d3065d6a0b61c3e23d94c76fd23cbfc83bd98ccfa431ddf84f5db0029
Swarm Source
bzzr://14161e4c4b7d3065d6a0b61c3e23d94c76fd23cbfc83bd98ccfa431ddf84f5db
Loading...
Loading
Loading...
Loading
OVERVIEW
Kyber's old DEX contract.Important points to note during this migration:
- At 7:00 PM SGT, 2nd December 2019, trading will stop for approximately 30 minutes and the network contracts will be migrated.
- Trading and operations will resume by 7:30 PM SGT, 2nd December 2019.
- The network will switch from the current KyberNetwork contract to (0x65bF64Ff5f51272f729BDcD7AcFB00677ced86Cd).
- The KyberNetworyProxy or simply the proxy contract, will point to the new KyberNetwork contract on the time and date of the migration.
- No major changes are done to the contract functions.
- Token liquidity is NOT affected.
- Tracking websites and apps will need to check https://developer.kyber.network/docs/Integrations-ContractEvents/ for the new/past contracts and relevant events.
- This update does not affect the KNC token contract. KNC holder’s tokens are NOT affected.
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 59.93% | $11.24 | 400 | $4,496 | |
ETH | Ether (ETH) | 20.99% | $3,474.91 | 0.4531 | $1,574.56 |
ETH | 13.18% | $18.17 | 54.4042 | $988.52 | |
ETH | 2.88% | $85.94 | 2.5138 | $216.04 | |
ETH | 2.71% | $279.31 | 0.729 | $203.61 | |
ETH | 0.11% | $1 | 8.1 | $8.11 | |
ETH | 0.06% | $0.359437 | 12.0492 | $4.33 | |
ETH | 0.05% | $0.00709 | 500.0034 | $3.54 | |
ETH | 0.02% | $0.005411 | 207.9825 | $1.13 | |
ETH | <0.01% | $0.000035 | 10,000 | $0.3464 | |
ETH | <0.01% | $0.106057 | 3 | $0.3181 | |
ETH | <0.01% | $0.999868 | 0.2916 | $0.2915 | |
ETH | <0.01% | $0.258535 | 0.4652 | $0.1202 | |
BSC | 0.07% | $5.56 | 1 | $5.56 |
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.