Feature Tip: Add private address tag to any address under My Name Tag !
Latest 25 from a total of 3,705 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 24221395 | 5 days ago | IN | 0 ETH | 0.00000669 | ||||
| Withdraw | 24205627 | 7 days ago | IN | 0 ETH | 0.00000632 | ||||
| Withdraw | 24198957 | 8 days ago | IN | 0 ETH | 0.00030721 | ||||
| Withdraw | 24185243 | 10 days ago | IN | 0 ETH | 0.0000107 | ||||
| Deposit | 24165354 | 13 days ago | IN | 0 ETH | 0.00034833 | ||||
| Deposit | 24159605 | 14 days ago | IN | 0 ETH | 0.00000744 | ||||
| Withdraw | 24131318 | 18 days ago | IN | 0 ETH | 0.00030426 | ||||
| Withdraw | 24028941 | 32 days ago | IN | 0 ETH | 0.00001968 | ||||
| Deposit | 24007487 | 35 days ago | IN | 0 ETH | 0.00000498 | ||||
| Deposit | 23976070 | 39 days ago | IN | 0 ETH | 0.00003318 | ||||
| Deposit | 23879405 | 53 days ago | IN | 0 ETH | 0.00000902 | ||||
| Deposit | 23835443 | 59 days ago | IN | 0 ETH | 0.00007474 | ||||
| Withdraw | 23833520 | 60 days ago | IN | 0 ETH | 0.00005888 | ||||
| Deposit | 23833434 | 60 days ago | IN | 0 ETH | 0.00013312 | ||||
| Withdraw | 23831352 | 60 days ago | IN | 0 ETH | 0.00031443 | ||||
| Deposit | 23826015 | 61 days ago | IN | 0 ETH | 0.00010772 | ||||
| Deposit | 23818522 | 62 days ago | IN | 0 ETH | 0.00002356 | ||||
| Withdraw | 23792563 | 65 days ago | IN | 0 ETH | 0.00008083 | ||||
| Deposit | 23778669 | 67 days ago | IN | 0 ETH | 0.0000258 | ||||
| Withdraw | 23732776 | 74 days ago | IN | 0 ETH | 0.00034886 | ||||
| Withdraw | 23707221 | 77 days ago | IN | 0 ETH | 0.00008511 | ||||
| Withdraw | 23706595 | 77 days ago | IN | 0 ETH | 0.00002158 | ||||
| Deposit | 23689622 | 80 days ago | IN | 0 ETH | 0.00022844 | ||||
| Deposit | 23683598 | 80 days ago | IN | 0 ETH | 0.00042703 | ||||
| Deposit | 23649885 | 85 days ago | IN | 0 ETH | 0.00007596 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
KyberStaking
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import {Math} from '@openzeppelin/contracts/math/Math.sol';
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
import {SafeCast} from '@openzeppelin/contracts/utils/SafeCast.sol';
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {ReentrancyGuard} from '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import {PermissionAdmin} from '@kyber.network/utils-sc/contracts/PermissionAdmin.sol';
import {IKyberStaking} from '../interfaces/staking/IKyberStaking.sol';
import {IWithdrawHandler} from '../interfaces/staking/IWithdrawHandler.sol';
import {EpochUtils} from '../misc/EpochUtils.sol';
/**
* @notice This contract is using SafeMath for uint, which is inherited from EpochUtils
* Some events are moved to interface, easier for public uses
*/
contract KyberStaking is IKyberStaking, EpochUtils, ReentrancyGuard, PermissionAdmin {
using Math for uint256;
using SafeMath for uint256;
struct StakerData {
uint128 stake;
uint128 delegatedStake;
address representative;
// true/false: if data has been initialized at an epoch for a staker
bool hasInited;
}
IERC20 public immutable override kncToken;
IWithdrawHandler public withdrawHandler;
// staker data per epoch, including stake, delegated stake and representative
mapping(uint256 => mapping(address => StakerData)) internal stakerPerEpochData;
// latest data of a staker, including stake, delegated stake, representative
mapping(address => StakerData) internal stakerLatestData;
// event is fired if something is wrong with withdrawal
// even though the withdrawal is still successful
event WithdrawDataUpdateFailed(uint256 curEpoch, address staker, uint256 amount);
event UpdateWithdrawHandler(IWithdrawHandler withdrawHandler);
constructor(
address _admin,
IERC20 _kncToken,
uint256 _epochPeriod,
uint256 _startTime
) PermissionAdmin(_admin) EpochUtils(_epochPeriod, _startTime) {
require(_startTime >= block.timestamp, 'ctor: start in the past');
require(_kncToken != IERC20(0), 'ctor: kncToken 0');
kncToken = _kncToken;
}
function updateWithdrawHandler(IWithdrawHandler _withdrawHandler) external onlyAdmin {
withdrawHandler = _withdrawHandler;
emit UpdateWithdrawHandler(_withdrawHandler);
}
/**
* @dev calls to set delegation for msg.sender, will take effect from the next epoch
* @param newRepresentative address to delegate to
*/
function delegate(address newRepresentative) external override {
require(newRepresentative != address(0), 'delegate: representative 0');
address staker = msg.sender;
uint256 curEpoch = getCurrentEpochNumber();
initDataIfNeeded(staker, curEpoch);
address curRepresentative = stakerPerEpochData[curEpoch + 1][staker].representative;
// nothing changes here
if (newRepresentative == curRepresentative) {
return;
}
uint256 updatedStake = stakerPerEpochData[curEpoch + 1][staker].stake;
// reduce delegatedStake for curRepresentative if needed
if (curRepresentative != staker) {
initDataIfNeeded(curRepresentative, curEpoch);
decreaseDelegatedStake(stakerPerEpochData[curEpoch + 1][curRepresentative], updatedStake);
decreaseDelegatedStake(stakerLatestData[curRepresentative], updatedStake);
emit Delegated(staker, curRepresentative, curEpoch, false);
}
stakerLatestData[staker].representative = newRepresentative;
stakerPerEpochData[curEpoch + 1][staker].representative = newRepresentative;
// ignore if staker is delegating back to himself
if (newRepresentative != staker) {
initDataIfNeeded(newRepresentative, curEpoch);
increaseDelegatedStake(stakerPerEpochData[curEpoch + 1][newRepresentative], updatedStake);
increaseDelegatedStake(stakerLatestData[newRepresentative], updatedStake);
emit Delegated(staker, newRepresentative, curEpoch, true);
}
}
/**
* @dev call to stake more KNC for msg.sender
* @param amount amount of KNC to stake
*/
function deposit(uint256 amount) external override {
require(amount > 0, 'deposit: amount is 0');
uint256 curEpoch = getCurrentEpochNumber();
address staker = msg.sender;
// collect KNC token from staker
require(kncToken.transferFrom(staker, address(this), amount), 'deposit: can not get token');
initDataIfNeeded(staker, curEpoch);
increaseStake(stakerPerEpochData[curEpoch + 1][staker], amount);
increaseStake(stakerLatestData[staker], amount);
// increase delegated stake for address that staker has delegated to (if it is not staker)
address representative = stakerPerEpochData[curEpoch + 1][staker].representative;
if (representative != staker) {
initDataIfNeeded(representative, curEpoch);
increaseDelegatedStake(stakerPerEpochData[curEpoch + 1][representative], amount);
increaseDelegatedStake(stakerLatestData[representative], amount);
}
emit Deposited(curEpoch, staker, amount);
}
/**
* @dev call to withdraw KNC from staking
* @dev it could affect voting point when calling withdrawHandlers handleWithdrawal
* @param amount amount of KNC to withdraw
*/
function withdraw(uint256 amount) external override nonReentrant {
require(amount > 0, 'withdraw: amount is 0');
uint256 curEpoch = getCurrentEpochNumber();
address staker = msg.sender;
require(
stakerLatestData[staker].stake >= amount,
'withdraw: latest amount staked < withdrawal amount'
);
initDataIfNeeded(staker, curEpoch);
decreaseStake(stakerLatestData[staker], amount);
(bool success, ) = address(this).call(
abi.encodeWithSelector(KyberStaking.handleWithdrawal.selector, staker, amount, curEpoch)
);
if (!success) {
// Note: should catch this event to check if something went wrong
emit WithdrawDataUpdateFailed(curEpoch, staker, amount);
}
// transfer KNC back to staker
require(kncToken.transfer(staker, amount), 'withdraw: can not transfer knc');
emit Withdraw(curEpoch, staker, amount);
}
/**
* @dev initialize data if needed, then return staker's data for current epoch
* @param staker - staker's address to initialize and get data for
*/
function initAndReturnStakerDataForCurrentEpoch(address staker)
external
override
nonReentrant
returns (
uint256 stake,
uint256 delegatedStake,
address representative
)
{
uint256 curEpoch = getCurrentEpochNumber();
initDataIfNeeded(staker, curEpoch);
StakerData memory stakerData = stakerPerEpochData[curEpoch][staker];
stake = stakerData.stake;
delegatedStake = stakerData.delegatedStake;
representative = stakerData.representative;
}
/**
* @notice return raw data of a staker for an epoch
* WARN: should be used only for initialized data
* if data has not been initialized, it will return all 0
* pool master shouldn't use this function to compute/distribute rewards of pool members
*/
function getStakerRawData(address staker, uint256 epoch)
external
override
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
)
{
StakerData memory stakerData = stakerPerEpochData[epoch][staker];
stake = stakerData.stake;
delegatedStake = stakerData.delegatedStake;
representative = stakerData.representative;
}
/**
* @dev allow to get data up to current epoch + 1
*/
function getStake(address staker, uint256 epoch) external view returns (uint256) {
uint256 curEpoch = getCurrentEpochNumber();
if (epoch > curEpoch + 1) {
return 0;
}
uint256 i = epoch;
while (true) {
if (stakerPerEpochData[i][staker].hasInited) {
return stakerPerEpochData[i][staker].stake;
}
if (i == 0) {
break;
}
i--;
}
return 0;
}
/**
* @dev allow to get data up to current epoch + 1
*/
function getDelegatedStake(address staker, uint256 epoch) external view returns (uint256) {
uint256 curEpoch = getCurrentEpochNumber();
if (epoch > curEpoch + 1) {
return 0;
}
uint256 i = epoch;
while (true) {
if (stakerPerEpochData[i][staker].hasInited) {
return stakerPerEpochData[i][staker].delegatedStake;
}
if (i == 0) {
break;
}
i--;
}
return 0;
}
/**
* @dev allow to get data up to current epoch + 1
*/
function getRepresentative(address staker, uint256 epoch) external view returns (address) {
uint256 curEpoch = getCurrentEpochNumber();
if (epoch > curEpoch + 1) {
return address(0);
}
uint256 i = epoch;
while (true) {
if (stakerPerEpochData[i][staker].hasInited) {
return stakerPerEpochData[i][staker].representative;
}
if (i == 0) {
break;
}
i--;
}
// not delegated to anyone, default to yourself
return staker;
}
/**
* @notice return combine data (stake, delegatedStake, representative) of a staker
* @dev allow to get staker data up to current epoch + 1
*/
function getStakerData(address staker, uint256 epoch)
external
override
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
)
{
stake = 0;
delegatedStake = 0;
representative = address(0);
uint256 curEpoch = getCurrentEpochNumber();
if (epoch > curEpoch + 1) {
return (stake, delegatedStake, representative);
}
uint256 i = epoch;
while (true) {
if (stakerPerEpochData[i][staker].hasInited) {
stake = stakerPerEpochData[i][staker].stake;
delegatedStake = stakerPerEpochData[i][staker].delegatedStake;
representative = stakerPerEpochData[i][staker].representative;
return (stake, delegatedStake, representative);
}
if (i == 0) {
break;
}
i--;
}
// not delegated to anyone, default to yourself
representative = staker;
}
function getLatestRepresentative(address staker) external view returns (address) {
return
stakerLatestData[staker].representative == address(0)
? staker
: stakerLatestData[staker].representative;
}
function getLatestDelegatedStake(address staker) external view returns (uint256) {
return stakerLatestData[staker].delegatedStake;
}
function getLatestStakeBalance(address staker) external view returns (uint256) {
return stakerLatestData[staker].stake;
}
function getLatestStakerData(address staker)
external
override
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
)
{
stake = stakerLatestData[staker].stake;
delegatedStake = stakerLatestData[staker].delegatedStake;
representative = stakerLatestData[staker].representative == address(0)
? staker
: stakerLatestData[staker].representative;
}
/**
* @dev separate logics from withdraw, so staker can withdraw as long as amount <= staker's deposit amount
calling this function from withdraw function, ignore reverting
* @param staker staker that is withdrawing
* @param amount amount to withdraw
* @param curEpoch current epoch
*/
function handleWithdrawal(
address staker,
uint256 amount,
uint256 curEpoch
) external {
require(msg.sender == address(this), 'only staking contract');
// update staker's data for next epoch
decreaseStake(stakerPerEpochData[curEpoch + 1][staker], amount);
address representative = stakerPerEpochData[curEpoch + 1][staker].representative;
if (representative != staker) {
initDataIfNeeded(representative, curEpoch);
decreaseDelegatedStake(stakerPerEpochData[curEpoch + 1][representative], amount);
decreaseDelegatedStake(stakerLatestData[representative], amount);
}
representative = stakerPerEpochData[curEpoch][staker].representative;
uint256 curStake = stakerPerEpochData[curEpoch][staker].stake;
uint256 lStakeBal = stakerLatestData[staker].stake;
uint256 newStake = curStake.min(lStakeBal);
uint256 reduceAmount = curStake.sub(newStake); // newStake is always <= curStake
if (reduceAmount > 0) {
if (representative != staker) {
initDataIfNeeded(representative, curEpoch);
// staker has delegated to representative, withdraw will affect representative's delegated stakes
decreaseDelegatedStake(stakerPerEpochData[curEpoch][representative], reduceAmount);
}
stakerPerEpochData[curEpoch][staker].stake = SafeCast.toUint128(newStake);
// call withdrawHandlers to reduce reward, if staker has delegated, then pass his representative
if (withdrawHandler != IWithdrawHandler(0)) {
(bool success, ) = address(withdrawHandler).call(
abi.encodeWithSelector(
IWithdrawHandler.handleWithdrawal.selector,
representative,
reduceAmount
)
);
if (!success) {
emit WithdrawDataUpdateFailed(curEpoch, staker, amount);
}
}
}
}
/**
* @dev initialize data if it has not been initialized yet
* @param staker staker's address to initialize
* @param epoch should be current epoch
*/
function initDataIfNeeded(address staker, uint256 epoch) internal {
address representative = stakerLatestData[staker].representative;
if (representative == address(0)) {
// not delegate to anyone, consider as delegate to yourself
stakerLatestData[staker].representative = staker;
representative = staker;
}
uint128 lStakeBal = stakerLatestData[staker].stake;
uint128 ldStake = stakerLatestData[staker].delegatedStake;
if (!stakerPerEpochData[epoch][staker].hasInited) {
stakerPerEpochData[epoch][staker] = StakerData({
stake: lStakeBal,
delegatedStake: ldStake,
representative: representative,
hasInited: true
});
}
// whenever stakers deposit/withdraw/delegate, the current and next epoch data need to be updated
// as the result, we will also initialize data for staker at the next epoch
if (!stakerPerEpochData[epoch + 1][staker].hasInited) {
stakerPerEpochData[epoch + 1][staker] = StakerData({
stake: lStakeBal,
delegatedStake: ldStake,
representative: representative,
hasInited: true
});
}
}
function decreaseDelegatedStake(StakerData storage stakeData, uint256 amount) internal {
stakeData.delegatedStake = SafeCast.toUint128(uint256(stakeData.delegatedStake).sub(amount));
}
function increaseDelegatedStake(StakerData storage stakeData, uint256 amount) internal {
stakeData.delegatedStake = SafeCast.toUint128(uint256(stakeData.delegatedStake).add(amount));
}
function increaseStake(StakerData storage stakeData, uint256 amount) internal {
stakeData.stake = SafeCast.toUint128(uint256(stakeData.stake).add(amount));
}
function decreaseStake(StakerData storage stakeData, uint256 amount) internal {
stakeData.stake = SafeCast.toUint128(uint256(stakeData.stake).sub(amount));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
require(value < 2**255, "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
abstract contract PermissionAdmin {
address public admin;
address public pendingAdmin;
event AdminClaimed(address newAdmin, address previousAdmin);
event TransferAdminPending(address pendingAdmin);
constructor(address _admin) {
require(_admin != address(0), "admin 0");
admin = _admin;
}
modifier onlyAdmin() {
require(msg.sender == admin, "only admin");
_;
}
/**
* @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), "new admin 0");
emit TransferAdminPending(newAdmin);
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), "admin 0");
emit TransferAdminPending(newAdmin);
emit AdminClaimed(newAdmin, admin);
admin = newAdmin;
}
/**
* @dev Allows the pendingAdmin address to finalize the change admin process.
*/
function claimAdmin() public {
require(pendingAdmin == msg.sender, "not pending");
emit AdminClaimed(pendingAdmin, admin);
admin = pendingAdmin;
pendingAdmin = address(0);
}
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import {IEpochUtils} from './IEpochUtils.sol';
interface IKyberStaking is IEpochUtils {
event Delegated(
address indexed staker,
address indexed representative,
uint256 indexed epoch,
bool isDelegated
);
event Deposited(uint256 curEpoch, address indexed staker, uint256 amount);
event Withdraw(uint256 indexed curEpoch, address indexed staker, uint256 amount);
function initAndReturnStakerDataForCurrentEpoch(address staker)
external
returns (
uint256 stake,
uint256 delegatedStake,
address representative
);
function deposit(uint256 amount) external;
function delegate(address dAddr) external;
function withdraw(uint256 amount) external;
/**
* @notice return combine data (stake, delegatedStake, representative) of a staker
* @dev allow to get staker data up to current epoch + 1
*/
function getStakerData(address staker, uint256 epoch)
external
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
);
function getLatestStakerData(address staker)
external
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
);
/**
* @notice return raw data of a staker for an epoch
* WARN: should be used only for initialized data
* if data has not been initialized, it will return all 0
* pool master shouldn't use this function to compute/distribute rewards of pool members
*/
function getStakerRawData(address staker, uint256 epoch)
external
view
returns (
uint256 stake,
uint256 delegatedStake,
address representative
);
function kncToken() external view returns (IERC20);
}// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;
pragma abicoder v2;
/**
* @title Interface for callbacks hooks when user withdraws from staking contract
*/
interface IWithdrawHandler {
function handleWithdrawal(address staker, uint256 reduceAmount) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
import '@openzeppelin/contracts/math/SafeMath.sol';
import '../interfaces/staking/IEpochUtils.sol';
contract EpochUtils is IEpochUtils {
using SafeMath for uint256;
uint256 public immutable override epochPeriodInSeconds;
uint256 public immutable override firstEpochStartTime;
constructor(uint256 _epochPeriod, uint256 _startTime) {
require(_epochPeriod > 0, 'ctor: epoch period is 0');
epochPeriodInSeconds = _epochPeriod;
firstEpochStartTime = _startTime;
}
function getCurrentEpochNumber() public override view returns (uint256) {
return getEpochNumber(block.timestamp);
}
function getEpochNumber(uint256 currentTime) public override view returns (uint256) {
if (currentTime < firstEpochStartTime || epochPeriodInSeconds == 0) {
return 0;
}
// ((currentTime - firstEpochStartTime) / epochPeriodInSeconds) + 1;
return ((currentTime.sub(firstEpochStartTime)).div(epochPeriodInSeconds)).add(1);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
interface IEpochUtils {
function epochPeriodInSeconds() external view returns (uint256);
function firstEpochStartTime() external view returns (uint256);
function getCurrentEpochNumber() external view returns (uint256);
function getEpochNumber(uint256 timestamp) external view returns (uint256);
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"contract IERC20","name":"_kncToken","type":"address"},{"internalType":"uint256","name":"_epochPeriod","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"representative","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isDelegated","type":"bool"}],"name":"Delegated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"curEpoch","type":"uint256"},{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IWithdrawHandler","name":"withdrawHandler","type":"address"}],"name":"UpdateWithdrawHandler","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"curEpoch","type":"uint256"},{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"curEpoch","type":"uint256"},{"indexed":false,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawDataUpdateFailed","type":"event"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRepresentative","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epochPeriodInSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstEpochStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEpochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getDelegatedStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"currentTime","type":"uint256"}],"name":"getEpochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getLatestDelegatedStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getLatestRepresentative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getLatestStakeBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getLatestStakerData","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"delegatedStake","type":"uint256"},{"internalType":"address","name":"representative","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getRepresentative","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getStakerData","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"delegatedStake","type":"uint256"},{"internalType":"address","name":"representative","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"getStakerRawData","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"delegatedStake","type":"uint256"},{"internalType":"address","name":"representative","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"curEpoch","type":"uint256"}],"name":"handleWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"initAndReturnStakerDataForCurrentEpoch","outputs":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"delegatedStake","type":"uint256"},{"internalType":"address","name":"representative","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kncToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IWithdrawHandler","name":"_withdrawHandler","type":"address"}],"name":"updateWithdrawHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawHandler","outputs":[{"internalType":"contract IWithdrawHandler","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60e060405234801561001057600080fd5b5060405162002372380380620023728339818101604052608081101561003557600080fd5b5080516020820151604083015160609093015191929091838282816100a1576040805162461bcd60e51b815260206004820152601760248201527f63746f723a2065706f636820706572696f642069732030000000000000000000604482015290519081900360640190fd5b60809190915260a05260016000556001600160a01b0381166100f4576040805162461bcd60e51b8152602060048201526007602482015266061646d696e20360cc1b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b039290921691909117905542811015610169576040805162461bcd60e51b815260206004820152601760248201527f63746f723a20737461727420696e207468652070617374000000000000000000604482015290519081900360640190fd5b6001600160a01b0383166101b7576040805162461bcd60e51b815260206004820152601060248201526f063746f723a206b6e63546f6b656e20360841b604482015290519081900360640190fd5b50506001600160601b031960609190911b1660c0525060805160a05160c05160601c6121576200021b60003980610926528061155e52806117725250806105b4528061063a5280611a635250806105dd52806106155280611c0652506121576000f3fe608060405234801561001057600080fd5b50600436106101ae5760003560e01c806377f50f97116100ee578063b7a13c4c11610097578063d42b725411610071578063d42b7254146104a3578063d46684b2146104c9578063f63e7811146104f5578063f851a440146104fd576101ae565b8063b7a13c4c14610449578063b9ee8f661461046f578063cfd4766314610477576101ae565b8063901ab5b2116100c8578063901ab5b2146103da578063a7903f8e14610406578063b6b55f251461042c576101ae565b806377f50f97146103a45780637acc8678146103ac578063811c7fe2146103d2576101ae565b806342ce39cb1161015b5780635ee5b477116101355780635ee5b4771461030057806360e4f2e014610326578063711bbfd91461034c57806375829def1461037e576101ae565b806342ce39cb146102a65780634408d2ba146102d25780635c19a95c146102da576101ae565b80631c552f001161018c5780631c552f0014610262578063267822471461027f5780632e1a7d4d14610287576101ae565b8063072b77f1146101b3578063083473ef146101eb57806316554d621461020f575b600080fd5b6101d9600480360360208110156101c957600080fd5b50356001600160a01b0316610505565b60408051918252519081900360200190f35b6101f361052d565b604080516001600160a01b039092168252519081900360200190f35b61023b6004803603604081101561022557600080fd5b506001600160a01b03813516906020013561053c565b6040805193845260208401929092526001600160a01b031682820152519081900360600190f35b6101d96004803603602081101561027857600080fd5b50356105b0565b6101f3610670565b6102a46004803603602081101561029d57600080fd5b503561067f565b005b61023b600480360360408110156102bc57600080fd5b506001600160a01b038135169060200135610a63565b6101d9610b29565b6102a4600480360360208110156102f057600080fd5b50356001600160a01b0316610b39565b6101f36004803603602081101561031657600080fd5b50356001600160a01b0316610de4565b61023b6004803603602081101561033c57600080fd5b50356001600160a01b0316610e30565b6102a46004803603606081101561036257600080fd5b506001600160a01b038135169060208101359060400135610e9b565b6102a46004803603602081101561039457600080fd5b50356001600160a01b0316611238565b6102a461133d565b6102a4600480360360208110156103c257600080fd5b50356001600160a01b031661140f565b6101f361155c565b6101f3600480360360408110156103f057600080fd5b506001600160a01b038135169060200135611580565b6102a46004803603602081101561041c57600080fd5b50356001600160a01b0316611626565b6102a46004803603602081101561044257600080fd5b50356116c6565b61023b6004803603602081101561045f57600080fd5b50356001600160a01b0316611970565b6101d9611a61565b6101d96004803603604081101561048d57600080fd5b506001600160a01b038135169060200135611a85565b6101d9600480360360208110156104b957600080fd5b50356001600160a01b0316611b31565b6101d9600480360360408110156104df57600080fd5b506001600160a01b038135169060200135611b5c565b6101d9611c04565b6101f3611c28565b6001600160a01b0381166000908152600560205260409020546001600160801b03165b919050565b6003546001600160a01b031681565b60009081526004602090815260408083206001600160a01b039485168452825291829020825160808101845281546001600160801b03808216808452600160801b90920416938201849052600190920154948516938101849052600160a01b90940460ff1615156060909401939093529192565b60007f00000000000000000000000000000000000000000000000000000000000000008210806105fe57507f0000000000000000000000000000000000000000000000000000000000000000155b1561060b57506000610528565b61066a60016106647f000000000000000000000000000000000000000000000000000000000000000061065e867f0000000000000000000000000000000000000000000000000000000000000000611c37565b90611c94565b90611cfb565b92915050565b6002546001600160a01b031681565b600260005414156106d7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000558061072e576040805162461bcd60e51b815260206004820152601560248201527f77697468647261773a20616d6f756e7420697320300000000000000000000000604482015290519081900360640190fd5b6000610738610b29565b33600081815260056020526040902054919250906001600160801b03168311156107935760405162461bcd60e51b81526004018080602001828103825260328152602001806120f06032913960400191505060405180910390fd5b61079d8183611d5c565b6001600160a01b03811660009081526005602052604090206107bf9084611fb3565b604080516001600160a01b038316602482015260448101859052606480820185905282518083039091018152608490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f711bbfd90000000000000000000000000000000000000000000000000000000017815291518151600093309392918291908083835b6020831061086b5780518252601f19909201916020918201910161084c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146108cd576040519150601f19603f3d011682016040523d82523d6000602084013e6108d2565b606091505b505090508061092457604080518481526001600160a01b038416602082015280820186905290517fa412eef5316d3cbf9e2b4ba3d1cf3e482b40dc8946fd919b7f5053450fa621fb9181900360600190a15b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb83866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d60208110156109c557600080fd5b5051610a18576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a2063616e206e6f74207472616e73666572206b6e630000604482015290519081900360640190fd5b6040805185815290516001600160a01b0384169185917f9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf9181900360200190a3505060016000555050565b6000808080610a70610b29565b905080600101851115610a835750610b22565b845b60008181526004602090815260408083206001600160a01b038b168452909152902060010154600160a01b900460ff1615610b095760009081526004602090815260408083206001600160a01b038a81168552925290912080546001909101546001600160801b038083169750600160801b9092049091169450169150610b229050565b80610b1357610b1c565b60001901610a85565b86925050505b9250925092565b6000610b34426105b0565b905090565b6001600160a01b038116610b94576040805162461bcd60e51b815260206004820152601a60248201527f64656c65676174653a20726570726573656e7461746976652030000000000000604482015290519081900360640190fd5b336000610b9f610b29565b9050610bab8282611d5c565b600180820160009081526004602090815260408083206001600160a01b0380881685529252909120909101548116908416811415610beb57505050610de1565b6001820160009081526004602090815260408083206001600160a01b03808816808652919093529220546001600160801b03169190831614610cd357610c318284611d5c565b6001830160009081526004602090815260408083206001600160a01b03861684529091529020610c619082611ff9565b6001600160a01b0382166000908152600560205260409020610c839082611ff9565b82826001600160a01b0316856001600160a01b03167ffbb976ae5268347766b726bd1edba29af0fe16f9c505fbd3b9a10cb6d00cfa3d600060405180821515815260200191505060405180910390a45b6001600160a01b03808516600081815260056020908152604080832060019081018054968c166001600160a01b0319978816811790915589820185526004845282852086865290935292209091018054909316811790925514610ddc57610d3a8584611d5c565b6001830160009081526004602090815260408083206001600160a01b03891684529091529020610d6a9082612035565b6001600160a01b0385166000908152600560205260409020610d8c9082612035565b82856001600160a01b0316856001600160a01b03167ffbb976ae5268347766b726bd1edba29af0fe16f9c505fbd3b9a10cb6d00cfa3d600160405180821515815260200191505060405180910390a45b505050505b50565b6001600160a01b0381811660009081526005602052604081206001015490911615610e2c576001600160a01b038083166000908152600560205260409020600101541661066a565b5090565b6001600160a01b03808216600090815260056020526040812080546001909101546001600160801b0380831694600160801b9093041692911615610e91576001600160a01b0380851660009081526005602052604090206001015416610e93565b835b929491935050565b333014610eef576040805162461bcd60e51b815260206004820152601560248201527f6f6e6c79207374616b696e6720636f6e74726163740000000000000000000000604482015290519081900360640190fd5b6001810160009081526004602090815260408083206001600160a01b03871684529091529020610f1f9083611fb3565b600180820160009081526004602090815260408083206001600160a01b0380891680865291909352922090920154909116908114610fb357610f618183611d5c565b6001820160009081526004602090815260408083206001600160a01b03851684529091529020610f919084611ff9565b6001600160a01b0381166000908152600560205260409020610fb39084611ff9565b5060008181526004602090815260408083206001600160a01b038781168552908352818420600181015490546005909452918420549116926001600160801b0392831692909116906110058383612055565b905060006110138483611c37565b9050801561122e57876001600160a01b0316856001600160a01b03161461106a5761103e8587611d5c565b60008681526004602090815260408083206001600160a01b0389168452909152902061106a9082611ff9565b6110738261206b565b60008781526004602090815260408083206001600160a01b038d81168552925290912080546fffffffffffffffffffffffffffffffff19166001600160801b039390931692909217909155600354161561122e57600354604080516001600160a01b038881166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe2346d710000000000000000000000000000000000000000000000000000000017815292518251600095929092169390918291908083835b602083106111735780518252601f199092019160209182019101611154565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146111d5576040519150601f19603f3d011682016040523d82523d6000602084013e6111da565b606091505b505090508061122c57604080518881526001600160a01b038b1660208201528082018a905290517fa412eef5316d3cbf9e2b4ba3d1cf3e482b40dc8946fd919b7f5053450fa621fb9181900360600190a15b505b5050505050505050565b6001546001600160a01b03163314611284576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166112df576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461139c576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600254600154604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160028054600180546001600160a01b03199081166001600160a01b03841617909155169055565b6001546001600160a01b0316331461145b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166114b6576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600154604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008061158b610b29565b9050806001018311156115a257600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff161561160a5760009081526004602090815260408083206001600160a01b03808916855292529091206001015416915061066a9050565b806116145761161d565b600019016115a4565b50929392505050565b6001546001600160a01b03163314611672576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f8f7aa5593d02f2a45c49c1d1d22546793bd327788496696c0c87ce444a56f0319181900360200190a150565b6000811161171b576040805162461bcd60e51b815260206004820152601460248201527f6465706f7369743a20616d6f756e742069732030000000000000000000000000604482015290519081900360640190fd5b6000611725610b29565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820181905230602483015260448201869052915192935090916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd9160648083019260209291908290030181600087803b1580156117ba57600080fd5b505af11580156117ce573d6000803e3d6000fd5b505050506040513d60208110156117e457600080fd5b5051611837576040805162461bcd60e51b815260206004820152601a60248201527f6465706f7369743a2063616e206e6f742067657420746f6b656e000000000000604482015290519081900360640190fd5b6118418183611d5c565b6001820160009081526004602090815260408083206001600160a01b0385168452909152902061187190846120af565b6001600160a01b038116600090815260056020526040902061189390846120af565b600180830160009081526004602090815260408083206001600160a01b0380871680865291909352922090920154909116908114611927576118d58184611d5c565b6001830160009081526004602090815260408083206001600160a01b038516845290915290206119059085612035565b6001600160a01b03811660009081526005602052604090206119279085612035565b604080518481526020810186905281516001600160a01b038516927f1599c0fcf897af5babc2bfcf707f5dc050f841b044d97c3251ecec35b9abf80b928290030190a250505050565b6000806000600260005414156119cd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260009081556119dc610b29565b90506119e88582611d5c565b60009081526004602090815260408083206001600160a01b0397881684528252808320815160808101835281546001600160801b03808216808452600160801b90920416948201859052600192830154998a16938201849052600160a01b90990460ff1615156060909101529092559495909350915050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080611a90610b29565b905080600101831115611aa757600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff1615611b135760009081526004602090815260408083206001600160a01b03881684529091529020546001600160801b0316915061066a9050565b80611b1d57611b26565b60001901611aa9565b506000949350505050565b6001600160a01b0316600090815260056020526040902054600160801b90046001600160801b031690565b600080611b67610b29565b905080600101831115611b7e57600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff1615611bf15760009081526004602090815260408083206001600160a01b0388168452909152902054600160801b90046001600160801b0316915061066a9050565b80611bfb57611b26565b60001901611b80565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b031681565b600082821115611c8e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211611cea576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611cf357fe5b049392505050565b600082820183811015611d55576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038083166000908152600560205260409020600101541680611dae57506001600160a01b038216600081815260056020526040902060010180546001600160a01b0319169091179055815b6001600160a01b03831660008181526005602090815260408083205486845260048352818420948452939091529020600101546001600160801b0380831692600160801b90041690600160a01b900460ff16611ebf57604080516080810182526001600160801b03808516825283811660208084019182526001600160a01b0380891685870190815260016060870181815260008d8152600486528981208f86168252909552979093209551865494518616600160801b029086166fffffffffffffffffffffffffffffffff1990951694909417909416929092178455915192909101805493511515600160a01b0260ff60a01b19939092166001600160a01b031990941693909317919091161790555b600184810160009081526004602090815260408083206001600160a01b038a16845290915290200154600160a01b900460ff16610ddc57604080516080810182526001600160801b03938416815291831660208084019182526001600160a01b039586168484019081526001606086018181529881016000908152600484528581209a8916815299909252929097209251835491516fffffffffffffffffffffffffffffffff19909216908516178416600160801b919094160292909217815590519301805492516001600160a01b0319909316939091169290921760ff60a01b1916600160a01b91151591909102179055565b8154611fd190611fcc906001600160801b031683611c37565b61206b565b82546fffffffffffffffffffffffffffffffff19166001600160801b03919091161790915550565b815461201990611fcc90600160801b90046001600160801b031683611c37565b82546001600160801b03918216600160801b0291161790915550565b815461201990611fcc90600160801b90046001600160801b031683611cfb565b60008183106120645781611d55565b5090919050565b6000600160801b8210610e2c5760405162461bcd60e51b81526004018080602001828103825260278152602001806120c96027913960400191505060405180910390fd5b8154611fd190611fcc906001600160801b031683611cfb56fe53616665436173743a2076616c756520646f65736e27742066697420696e20313238206269747377697468647261773a206c617465737420616d6f756e74207374616b6564203c207769746864726177616c20616d6f756e74a2646970667358221220bf30738c4d4dc84af1c531b29dfef8f73b009e2d941e936818b265a57bd95eef64736f6c63430007060033000000000000000000000000560fb65513a3e9f22df97501393360bf0db448ad000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972020000000000000000000000000000000000000000000000000000000000127500000000000000000000000000000000000000000000000000000000006087b81b
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101ae5760003560e01c806377f50f97116100ee578063b7a13c4c11610097578063d42b725411610071578063d42b7254146104a3578063d46684b2146104c9578063f63e7811146104f5578063f851a440146104fd576101ae565b8063b7a13c4c14610449578063b9ee8f661461046f578063cfd4766314610477576101ae565b8063901ab5b2116100c8578063901ab5b2146103da578063a7903f8e14610406578063b6b55f251461042c576101ae565b806377f50f97146103a45780637acc8678146103ac578063811c7fe2146103d2576101ae565b806342ce39cb1161015b5780635ee5b477116101355780635ee5b4771461030057806360e4f2e014610326578063711bbfd91461034c57806375829def1461037e576101ae565b806342ce39cb146102a65780634408d2ba146102d25780635c19a95c146102da576101ae565b80631c552f001161018c5780631c552f0014610262578063267822471461027f5780632e1a7d4d14610287576101ae565b8063072b77f1146101b3578063083473ef146101eb57806316554d621461020f575b600080fd5b6101d9600480360360208110156101c957600080fd5b50356001600160a01b0316610505565b60408051918252519081900360200190f35b6101f361052d565b604080516001600160a01b039092168252519081900360200190f35b61023b6004803603604081101561022557600080fd5b506001600160a01b03813516906020013561053c565b6040805193845260208401929092526001600160a01b031682820152519081900360600190f35b6101d96004803603602081101561027857600080fd5b50356105b0565b6101f3610670565b6102a46004803603602081101561029d57600080fd5b503561067f565b005b61023b600480360360408110156102bc57600080fd5b506001600160a01b038135169060200135610a63565b6101d9610b29565b6102a4600480360360208110156102f057600080fd5b50356001600160a01b0316610b39565b6101f36004803603602081101561031657600080fd5b50356001600160a01b0316610de4565b61023b6004803603602081101561033c57600080fd5b50356001600160a01b0316610e30565b6102a46004803603606081101561036257600080fd5b506001600160a01b038135169060208101359060400135610e9b565b6102a46004803603602081101561039457600080fd5b50356001600160a01b0316611238565b6102a461133d565b6102a4600480360360208110156103c257600080fd5b50356001600160a01b031661140f565b6101f361155c565b6101f3600480360360408110156103f057600080fd5b506001600160a01b038135169060200135611580565b6102a46004803603602081101561041c57600080fd5b50356001600160a01b0316611626565b6102a46004803603602081101561044257600080fd5b50356116c6565b61023b6004803603602081101561045f57600080fd5b50356001600160a01b0316611970565b6101d9611a61565b6101d96004803603604081101561048d57600080fd5b506001600160a01b038135169060200135611a85565b6101d9600480360360208110156104b957600080fd5b50356001600160a01b0316611b31565b6101d9600480360360408110156104df57600080fd5b506001600160a01b038135169060200135611b5c565b6101d9611c04565b6101f3611c28565b6001600160a01b0381166000908152600560205260409020546001600160801b03165b919050565b6003546001600160a01b031681565b60009081526004602090815260408083206001600160a01b039485168452825291829020825160808101845281546001600160801b03808216808452600160801b90920416938201849052600190920154948516938101849052600160a01b90940460ff1615156060909401939093529192565b60007f000000000000000000000000000000000000000000000000000000006087b81b8210806105fe57507f0000000000000000000000000000000000000000000000000000000000127500155b1561060b57506000610528565b61066a60016106647f000000000000000000000000000000000000000000000000000000000012750061065e867f000000000000000000000000000000000000000000000000000000006087b81b611c37565b90611c94565b90611cfb565b92915050565b6002546001600160a01b031681565b600260005414156106d7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026000558061072e576040805162461bcd60e51b815260206004820152601560248201527f77697468647261773a20616d6f756e7420697320300000000000000000000000604482015290519081900360640190fd5b6000610738610b29565b33600081815260056020526040902054919250906001600160801b03168311156107935760405162461bcd60e51b81526004018080602001828103825260328152602001806120f06032913960400191505060405180910390fd5b61079d8183611d5c565b6001600160a01b03811660009081526005602052604090206107bf9084611fb3565b604080516001600160a01b038316602482015260448101859052606480820185905282518083039091018152608490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f711bbfd90000000000000000000000000000000000000000000000000000000017815291518151600093309392918291908083835b6020831061086b5780518252601f19909201916020918201910161084c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146108cd576040519150601f19603f3d011682016040523d82523d6000602084013e6108d2565b606091505b505090508061092457604080518481526001600160a01b038416602082015280820186905290517fa412eef5316d3cbf9e2b4ba3d1cf3e482b40dc8946fd919b7f5053450fa621fb9181900360600190a15b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972026001600160a01b031663a9059cbb83866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b505050506040513d60208110156109c557600080fd5b5051610a18576040805162461bcd60e51b815260206004820152601e60248201527f77697468647261773a2063616e206e6f74207472616e73666572206b6e630000604482015290519081900360640190fd5b6040805185815290516001600160a01b0384169185917f9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf9181900360200190a3505060016000555050565b6000808080610a70610b29565b905080600101851115610a835750610b22565b845b60008181526004602090815260408083206001600160a01b038b168452909152902060010154600160a01b900460ff1615610b095760009081526004602090815260408083206001600160a01b038a81168552925290912080546001909101546001600160801b038083169750600160801b9092049091169450169150610b229050565b80610b1357610b1c565b60001901610a85565b86925050505b9250925092565b6000610b34426105b0565b905090565b6001600160a01b038116610b94576040805162461bcd60e51b815260206004820152601a60248201527f64656c65676174653a20726570726573656e7461746976652030000000000000604482015290519081900360640190fd5b336000610b9f610b29565b9050610bab8282611d5c565b600180820160009081526004602090815260408083206001600160a01b0380881685529252909120909101548116908416811415610beb57505050610de1565b6001820160009081526004602090815260408083206001600160a01b03808816808652919093529220546001600160801b03169190831614610cd357610c318284611d5c565b6001830160009081526004602090815260408083206001600160a01b03861684529091529020610c619082611ff9565b6001600160a01b0382166000908152600560205260409020610c839082611ff9565b82826001600160a01b0316856001600160a01b03167ffbb976ae5268347766b726bd1edba29af0fe16f9c505fbd3b9a10cb6d00cfa3d600060405180821515815260200191505060405180910390a45b6001600160a01b03808516600081815260056020908152604080832060019081018054968c166001600160a01b0319978816811790915589820185526004845282852086865290935292209091018054909316811790925514610ddc57610d3a8584611d5c565b6001830160009081526004602090815260408083206001600160a01b03891684529091529020610d6a9082612035565b6001600160a01b0385166000908152600560205260409020610d8c9082612035565b82856001600160a01b0316856001600160a01b03167ffbb976ae5268347766b726bd1edba29af0fe16f9c505fbd3b9a10cb6d00cfa3d600160405180821515815260200191505060405180910390a45b505050505b50565b6001600160a01b0381811660009081526005602052604081206001015490911615610e2c576001600160a01b038083166000908152600560205260409020600101541661066a565b5090565b6001600160a01b03808216600090815260056020526040812080546001909101546001600160801b0380831694600160801b9093041692911615610e91576001600160a01b0380851660009081526005602052604090206001015416610e93565b835b929491935050565b333014610eef576040805162461bcd60e51b815260206004820152601560248201527f6f6e6c79207374616b696e6720636f6e74726163740000000000000000000000604482015290519081900360640190fd5b6001810160009081526004602090815260408083206001600160a01b03871684529091529020610f1f9083611fb3565b600180820160009081526004602090815260408083206001600160a01b0380891680865291909352922090920154909116908114610fb357610f618183611d5c565b6001820160009081526004602090815260408083206001600160a01b03851684529091529020610f919084611ff9565b6001600160a01b0381166000908152600560205260409020610fb39084611ff9565b5060008181526004602090815260408083206001600160a01b038781168552908352818420600181015490546005909452918420549116926001600160801b0392831692909116906110058383612055565b905060006110138483611c37565b9050801561122e57876001600160a01b0316856001600160a01b03161461106a5761103e8587611d5c565b60008681526004602090815260408083206001600160a01b0389168452909152902061106a9082611ff9565b6110738261206b565b60008781526004602090815260408083206001600160a01b038d81168552925290912080546fffffffffffffffffffffffffffffffff19166001600160801b039390931692909217909155600354161561122e57600354604080516001600160a01b038881166024830152604480830186905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fe2346d710000000000000000000000000000000000000000000000000000000017815292518251600095929092169390918291908083835b602083106111735780518252601f199092019160209182019101611154565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146111d5576040519150601f19603f3d011682016040523d82523d6000602084013e6111da565b606091505b505090508061122c57604080518881526001600160a01b038b1660208201528082018a905290517fa412eef5316d3cbf9e2b4ba3d1cf3e482b40dc8946fd919b7f5053450fa621fb9181900360600190a15b505b5050505050505050565b6001546001600160a01b03163314611284576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166112df576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461139c576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600254600154604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160028054600180546001600160a01b03199081166001600160a01b03841617909155169055565b6001546001600160a01b0316331461145b576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166114b6576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600154604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce9720281565b60008061158b610b29565b9050806001018311156115a257600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff161561160a5760009081526004602090815260408083206001600160a01b03808916855292529091206001015416915061066a9050565b806116145761161d565b600019016115a4565b50929392505050565b6001546001600160a01b03163314611672576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600380546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f8f7aa5593d02f2a45c49c1d1d22546793bd327788496696c0c87ce444a56f0319181900360200190a150565b6000811161171b576040805162461bcd60e51b815260206004820152601460248201527f6465706f7369743a20616d6f756e742069732030000000000000000000000000604482015290519081900360640190fd5b6000611725610b29565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820181905230602483015260448201869052915192935090916001600160a01b037f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce9720216916323b872dd9160648083019260209291908290030181600087803b1580156117ba57600080fd5b505af11580156117ce573d6000803e3d6000fd5b505050506040513d60208110156117e457600080fd5b5051611837576040805162461bcd60e51b815260206004820152601a60248201527f6465706f7369743a2063616e206e6f742067657420746f6b656e000000000000604482015290519081900360640190fd5b6118418183611d5c565b6001820160009081526004602090815260408083206001600160a01b0385168452909152902061187190846120af565b6001600160a01b038116600090815260056020526040902061189390846120af565b600180830160009081526004602090815260408083206001600160a01b0380871680865291909352922090920154909116908114611927576118d58184611d5c565b6001830160009081526004602090815260408083206001600160a01b038516845290915290206119059085612035565b6001600160a01b03811660009081526005602052604090206119279085612035565b604080518481526020810186905281516001600160a01b038516927f1599c0fcf897af5babc2bfcf707f5dc050f841b044d97c3251ecec35b9abf80b928290030190a250505050565b6000806000600260005414156119cd576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260009081556119dc610b29565b90506119e88582611d5c565b60009081526004602090815260408083206001600160a01b0397881684528252808320815160808101835281546001600160801b03808216808452600160801b90920416948201859052600192830154998a16938201849052600160a01b90990460ff1615156060909101529092559495909350915050565b7f000000000000000000000000000000000000000000000000000000006087b81b81565b600080611a90610b29565b905080600101831115611aa757600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff1615611b135760009081526004602090815260408083206001600160a01b03881684529091529020546001600160801b0316915061066a9050565b80611b1d57611b26565b60001901611aa9565b506000949350505050565b6001600160a01b0316600090815260056020526040902054600160801b90046001600160801b031690565b600080611b67610b29565b905080600101831115611b7e57600091505061066a565b825b60008181526004602090815260408083206001600160a01b0389168452909152902060010154600160a01b900460ff1615611bf15760009081526004602090815260408083206001600160a01b0388168452909152902054600160801b90046001600160801b0316915061066a9050565b80611bfb57611b26565b60001901611b80565b7f000000000000000000000000000000000000000000000000000000000012750081565b6001546001600160a01b031681565b600082821115611c8e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000808211611cea576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611cf357fe5b049392505050565b600082820183811015611d55576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038083166000908152600560205260409020600101541680611dae57506001600160a01b038216600081815260056020526040902060010180546001600160a01b0319169091179055815b6001600160a01b03831660008181526005602090815260408083205486845260048352818420948452939091529020600101546001600160801b0380831692600160801b90041690600160a01b900460ff16611ebf57604080516080810182526001600160801b03808516825283811660208084019182526001600160a01b0380891685870190815260016060870181815260008d8152600486528981208f86168252909552979093209551865494518616600160801b029086166fffffffffffffffffffffffffffffffff1990951694909417909416929092178455915192909101805493511515600160a01b0260ff60a01b19939092166001600160a01b031990941693909317919091161790555b600184810160009081526004602090815260408083206001600160a01b038a16845290915290200154600160a01b900460ff16610ddc57604080516080810182526001600160801b03938416815291831660208084019182526001600160a01b039586168484019081526001606086018181529881016000908152600484528581209a8916815299909252929097209251835491516fffffffffffffffffffffffffffffffff19909216908516178416600160801b919094160292909217815590519301805492516001600160a01b0319909316939091169290921760ff60a01b1916600160a01b91151591909102179055565b8154611fd190611fcc906001600160801b031683611c37565b61206b565b82546fffffffffffffffffffffffffffffffff19166001600160801b03919091161790915550565b815461201990611fcc90600160801b90046001600160801b031683611c37565b82546001600160801b03918216600160801b0291161790915550565b815461201990611fcc90600160801b90046001600160801b031683611cfb565b60008183106120645781611d55565b5090919050565b6000600160801b8210610e2c5760405162461bcd60e51b81526004018080602001828103825260278152602001806120c96027913960400191505060405180910390fd5b8154611fd190611fcc906001600160801b031683611cfb56fe53616665436173743a2076616c756520646f65736e27742066697420696e20313238206269747377697468647261773a206c617465737420616d6f756e74207374616b6564203c207769746864726177616c20616d6f756e74a2646970667358221220bf30738c4d4dc84af1c531b29dfef8f73b009e2d941e936818b265a57bd95eef64736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000560fb65513a3e9f22df97501393360bf0db448ad000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972020000000000000000000000000000000000000000000000000000000000127500000000000000000000000000000000000000000000000000000000006087b81b
-----Decoded View---------------
Arg [0] : _admin (address): 0x560FB65513a3E9F22dF97501393360Bf0db448Ad
Arg [1] : _kncToken (address): 0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202
Arg [2] : _epochPeriod (uint256): 1209600
Arg [3] : _startTime (uint256): 1619507227
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000560fb65513a3e9f22df97501393360bf0db448ad
Arg [1] : 000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202
Arg [2] : 0000000000000000000000000000000000000000000000000000000000127500
Arg [3] : 000000000000000000000000000000000000000000000000000000006087b81b
Loading...
Loading
Loading...
Loading
Net Worth in USD
$11,846,813.64
Net Worth in ETH
3,563.0595
Token Allocations
KNC
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $0.236725 | 50,044,624.1005 | $11,846,813.64 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.