Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 87 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Unstake | 13594143 | 1568 days ago | IN | 0 ETH | 0.02854869 | ||||
| Unstake | 13590489 | 1569 days ago | IN | 0 ETH | 0.03284417 | ||||
| Unstake | 13583092 | 1570 days ago | IN | 0 ETH | 0.02868532 | ||||
| Unstake | 13581500 | 1570 days ago | IN | 0 ETH | 0.02254567 | ||||
| Unstake | 13164311 | 1635 days ago | IN | 0 ETH | 0.01803999 | ||||
| Unstake | 12761783 | 1698 days ago | IN | 0 ETH | 0.00227691 | ||||
| Unstake | 12669258 | 1713 days ago | IN | 0 ETH | 0.00256152 | ||||
| Unstake | 12662484 | 1714 days ago | IN | 0 ETH | 0.00241921 | ||||
| Unstake | 12471530 | 1743 days ago | IN | 0 ETH | 0.01464921 | ||||
| Unstake | 12386737 | 1756 days ago | IN | 0 ETH | 0.00640882 | ||||
| Unstake | 12382750 | 1757 days ago | IN | 0 ETH | 0.01309224 | ||||
| Unstake | 12364082 | 1760 days ago | IN | 0 ETH | 0.01246983 | ||||
| Unstake | 12319525 | 1767 days ago | IN | 0 ETH | 0.00582572 | ||||
| Unstake | 12292457 | 1771 days ago | IN | 0 ETH | 0.02359416 | ||||
| Unstake | 12221813 | 1782 days ago | IN | 0 ETH | 0.01125555 | ||||
| Unstake | 12210982 | 1783 days ago | IN | 0 ETH | 0.01681125 | ||||
| Unstake | 12210360 | 1784 days ago | IN | 0 ETH | 0.01772723 | ||||
| Unstake | 12178797 | 1788 days ago | IN | 0 ETH | 0.01589864 | ||||
| Unstake | 12129210 | 1796 days ago | IN | 0 ETH | 0.02667304 | ||||
| Unstake | 12127270 | 1796 days ago | IN | 0 ETH | 0.01907159 | ||||
| Unstake | 12107148 | 1799 days ago | IN | 0 ETH | 0.04140441 | ||||
| Unstake | 12088402 | 1802 days ago | IN | 0 ETH | 0.03072307 | ||||
| Unstake | 12085589 | 1803 days ago | IN | 0 ETH | 0.03960396 | ||||
| Unstake | 12080372 | 1804 days ago | IN | 0 ETH | 0.02448122 | ||||
| Unstake | 12075570 | 1804 days ago | IN | 0 ETH | 0.02205235 |
Latest 3 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 11913445 | 1829 days ago | Contract Creation | 0 ETH | |||
| - | 11913445 | 1829 days ago | Contract Creation | 0 ETH | |||
| - | 11913445 | 1829 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TokenGeyser
Compiler Version
v0.5.17+commit.d19bba13
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2021-02-23
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.5.17;
// Part: IStaking
/**
* @title Staking interface, as defined by EIP-900.
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-900.md
*/
contract IStaking {
event Staked(address indexed user, uint256 amount, uint256 total, bytes data);
event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data);
function stake(uint256 amount, bytes calldata data) external;
function stakeFor(address user, uint256 amount, bytes calldata data) external;
function unstake(uint256 amount, bytes calldata data) external;
function totalStakedFor(address addr) public view returns (uint256);
function totalStaked() public view returns (uint256);
function token() external view returns (address);
/**
* @return False. This application does not support staking history.
*/
function supportsHistory() external pure returns (bool) {
return false;
}
}
// Part: OpenZeppelin/[email protected]/Context
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// Part: OpenZeppelin/[email protected]/IERC20
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
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);
}
// Part: OpenZeppelin/[email protected]/SafeMath
/**
* @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, 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) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message 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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// Part: OpenZeppelin/[email protected]/Ownable
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// Part: TokenPool
/**
* @title A simple holder of tokens.
* This is a simple contract to hold tokens. It's useful in the case where a separate contract
* needs to hold multiple distinct pools of the same token.
*/
contract TokenPool is Ownable {
IERC20 public token;
constructor(IERC20 _token) public {
token = _token;
}
function balance() public view returns (uint256) {
return token.balanceOf(address(this));
}
function transfer(address to, uint256 value) external onlyOwner returns (bool) {
return token.transfer(to, value);
}
function rescueFunds(address tokenToRescue, address to, uint256 amount) external onlyOwner returns (bool) {
require(address(token) != tokenToRescue, 'TokenPool: Cannot claim token held by the contract');
return IERC20(tokenToRescue).transfer(to, amount);
}
}
// File: TokenGeyser.sol
/**
* @title Token Geyser
* @dev A smart-contract based mechanism to distribute tokens over time, inspired loosely by
* Compound and Uniswap.
*
* Distribution tokens are added to a locked pool in the contract and become unlocked over time
* according to a once-configurable unlock schedule. Once unlocked, they are available to be
* claimed by users.
*
* A user may deposit tokens to accrue ownership share over the unlocked pool. This owner share
* is a function of the number of tokens deposited as well as the length of time deposited.
* Specifically, a user's share of the currently-unlocked pool equals their 'deposit-seconds'
* divided by the global 'deposit-seconds'. This aligns the new token distribution with long
* term supporters of the project, addressing one of the major drawbacks of simple airdrops.
*
* More background and motivation available at:
* https://github.com/ampleforth/RFCs/blob/master/RFCs/rfc-1.md
*/
contract TokenGeyser is IStaking, Ownable {
using SafeMath for uint256;
event Staked(address indexed user, uint256 amount, uint256 total, bytes data);
event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data);
event TokensClaimed(address indexed user, uint256 amount);
event TokensLocked(uint256 amount, uint256 durationSec, uint256 total);
// amount: Unlocked tokens, total: Total locked tokens
event TokensUnlocked(uint256 amount, uint256 total);
TokenPool private _stakingPool;
TokenPool private _unlockedPool;
TokenPool private _lockedPool;
//
// Time-bonus params
//
uint256 public constant BONUS_DECIMALS = 2;
uint256 public startBonus = 0;
uint256 public bonusPeriodSec = 0;
//
// Global accounting state
//
uint256 public totalLockedShares = 0;
uint256 public totalStakingShares = 0;
uint256 private _totalStakingShareSeconds = 0;
uint256 private _lastAccountingTimestampSec = now;
uint256 private _maxUnlockSchedules = 0;
uint256 private _initialSharesPerToken = 0;
//
// User accounting state
//
// Represents a single stake for a user. A user may have multiple.
struct Stake {
uint256 stakingShares;
uint256 timestampSec;
}
// Caches aggregated values from the User->Stake[] map to save computation.
// If lastAccountingTimestampSec is 0, there's no entry for that user.
struct UserTotals {
uint256 stakingShares;
uint256 stakingShareSeconds;
uint256 lastAccountingTimestampSec;
}
// Aggregated staking values per user
mapping(address => UserTotals) private _userTotals;
// The collection of stakes for each user. Ordered by timestamp, earliest to latest.
mapping(address => Stake[]) private _userStakes;
//
// Locked/Unlocked Accounting state
//
struct UnlockSchedule {
uint256 initialLockedShares;
uint256 unlockedShares;
uint256 lastUnlockTimestampSec;
uint256 endAtSec;
uint256 durationSec;
}
UnlockSchedule[] public unlockSchedules;
/**
* @param stakingToken The token users deposit as stake.
* @param distributionToken The token users receive as they unstake.
* @param maxUnlockSchedules Max number of unlock stages, to guard against hitting gas limit.
* @param startBonus_ Starting time bonus, BONUS_DECIMALS fixed point.
* e.g. 25% means user gets 25% of max distribution tokens.
* @param bonusPeriodSec_ Length of time for bonus to increase linearly to max.
* @param initialSharesPerToken Number of shares to mint per staking token on first stake.
*/
constructor(IERC20 stakingToken, IERC20 distributionToken, uint256 maxUnlockSchedules,
uint256 startBonus_, uint256 bonusPeriodSec_, uint256 initialSharesPerToken) public {
// The start bonus must be some fraction of the max. (i.e. <= 100%)
require(startBonus_ <= 10**BONUS_DECIMALS, 'TokenGeyser: start bonus too high');
// If no period is desired, instead set startBonus = 100%
// and bonusPeriod to a small value like 1sec.
require(bonusPeriodSec_ != 0, 'TokenGeyser: bonus period is zero');
require(initialSharesPerToken > 0, 'TokenGeyser: initialSharesPerToken is zero');
_stakingPool = new TokenPool(stakingToken);
_unlockedPool = new TokenPool(distributionToken);
_lockedPool = new TokenPool(distributionToken);
startBonus = startBonus_;
bonusPeriodSec = bonusPeriodSec_;
_maxUnlockSchedules = maxUnlockSchedules;
_initialSharesPerToken = initialSharesPerToken;
}
/**
* @return The token users deposit as stake.
*/
function getStakingToken() public view returns (IERC20) {
return _stakingPool.token();
}
/**
* @return The token users receive as they unstake.
*/
function getDistributionToken() public view returns (IERC20) {
assert(_unlockedPool.token() == _lockedPool.token());
return _unlockedPool.token();
}
/**
* @dev Transfers amount of deposit tokens from the user.
* @param amount Number of deposit tokens to stake.
* @param data Not used.
*/
function stake(uint256 amount, bytes calldata data) external {
_stakeFor(msg.sender, msg.sender, amount);
}
/**
* @dev Transfers amount of deposit tokens from the caller on behalf of user.
* @param user User address who gains credit for this stake operation.
* @param amount Number of deposit tokens to stake.
* @param data Not used.
*/
function stakeFor(address user, uint256 amount, bytes calldata data) external onlyOwner {
_stakeFor(msg.sender, user, amount);
}
/**
* @dev Private implementation of staking methods.
* @param staker User address who deposits tokens to stake.
* @param beneficiary User address who gains credit for this stake operation.
* @param amount Number of deposit tokens to stake.
*/
function _stakeFor(address staker, address beneficiary, uint256 amount) private {
require(amount > 0, 'TokenGeyser: stake amount is zero');
require(beneficiary != address(0), 'TokenGeyser: beneficiary is zero address');
require(totalStakingShares == 0 || totalStaked() > 0,
'TokenGeyser: Invalid state. Staking shares exist, but no staking tokens do');
uint256 mintedStakingShares = (totalStakingShares > 0)
? totalStakingShares.mul(amount).div(totalStaked())
: amount.mul(_initialSharesPerToken);
require(mintedStakingShares > 0, 'TokenGeyser: Stake amount is too small');
updateAccounting();
// 1. User Accounting
UserTotals storage totals = _userTotals[beneficiary];
totals.stakingShares = totals.stakingShares.add(mintedStakingShares);
totals.lastAccountingTimestampSec = now;
Stake memory newStake = Stake(mintedStakingShares, now);
_userStakes[beneficiary].push(newStake);
// 2. Global Accounting
totalStakingShares = totalStakingShares.add(mintedStakingShares);
// Already set in updateAccounting()
// _lastAccountingTimestampSec = now;
// interactions
require(_stakingPool.token().transferFrom(staker, address(_stakingPool), amount),
'TokenGeyser: transfer into staking pool failed');
emit Staked(beneficiary, amount, totalStakedFor(beneficiary), '');
}
/**
* @dev Unstakes a certain amount of previously deposited tokens. User also receives their
* alotted number of distribution tokens.
* @param amount Number of deposit tokens to unstake / withdraw.
* @param data Not used.
*/
function unstake(uint256 amount, bytes calldata data) external {
_unstake(amount);
}
/**
* @param amount Number of deposit tokens to unstake / withdraw.
* @return The total number of distribution tokens that would be rewarded.
*/
function unstakeQuery(uint256 amount) public returns (uint256) {
return _unstake(amount);
}
/**
* @dev Unstakes a certain amount of previously deposited tokens. User also receives their
* alotted number of distribution tokens.
* @param amount Number of deposit tokens to unstake / withdraw.
* @return The total number of distribution tokens rewarded.
*/
function _unstake(uint256 amount) private returns (uint256) {
updateAccounting();
// checks
require(amount > 0, 'TokenGeyser: unstake amount is zero');
require(totalStakedFor(msg.sender) >= amount,
'TokenGeyser: unstake amount is greater than total user stakes');
uint256 stakingSharesToBurn = totalStakingShares.mul(amount).div(totalStaked());
require(stakingSharesToBurn > 0, 'TokenGeyser: Unable to unstake amount this small');
// 1. User Accounting
UserTotals storage totals = _userTotals[msg.sender];
Stake[] storage accountStakes = _userStakes[msg.sender];
// Redeem from most recent stake and go backwards in time.
uint256 stakingShareSecondsToBurn = 0;
uint256 sharesLeftToBurn = stakingSharesToBurn;
uint256 rewardAmount = 0;
while (sharesLeftToBurn > 0) {
Stake storage lastStake = accountStakes[accountStakes.length - 1];
uint256 stakeTimeSec = now.sub(lastStake.timestampSec);
uint256 newStakingShareSecondsToBurn = 0;
if (lastStake.stakingShares <= sharesLeftToBurn) {
// fully redeem a past stake
newStakingShareSecondsToBurn = lastStake.stakingShares.mul(stakeTimeSec);
rewardAmount = computeNewReward(rewardAmount, newStakingShareSecondsToBurn, stakeTimeSec);
stakingShareSecondsToBurn = stakingShareSecondsToBurn.add(newStakingShareSecondsToBurn);
sharesLeftToBurn = sharesLeftToBurn.sub(lastStake.stakingShares);
accountStakes.length--;
} else {
// partially redeem a past stake
newStakingShareSecondsToBurn = sharesLeftToBurn.mul(stakeTimeSec);
rewardAmount = computeNewReward(rewardAmount, newStakingShareSecondsToBurn, stakeTimeSec);
stakingShareSecondsToBurn = stakingShareSecondsToBurn.add(newStakingShareSecondsToBurn);
lastStake.stakingShares = lastStake.stakingShares.sub(sharesLeftToBurn);
sharesLeftToBurn = 0;
}
}
totals.stakingShareSeconds = totals.stakingShareSeconds.sub(stakingShareSecondsToBurn);
totals.stakingShares = totals.stakingShares.sub(stakingSharesToBurn);
// Already set in updateAccounting
// totals.lastAccountingTimestampSec = now;
// 2. Global Accounting
_totalStakingShareSeconds = _totalStakingShareSeconds.sub(stakingShareSecondsToBurn);
totalStakingShares = totalStakingShares.sub(stakingSharesToBurn);
// Already set in updateAccounting
// _lastAccountingTimestampSec = now;
// interactions
require(_stakingPool.transfer(msg.sender, amount),
'TokenGeyser: transfer out of staking pool failed');
require(_unlockedPool.transfer(msg.sender, rewardAmount),
'TokenGeyser: transfer out of unlocked pool failed');
emit Unstaked(msg.sender, amount, totalStakedFor(msg.sender), '');
emit TokensClaimed(msg.sender, rewardAmount);
require(totalStakingShares == 0 || totalStaked() > 0,
'TokenGeyser: Error unstaking. Staking shares exist, but no staking tokens do');
return rewardAmount;
}
/**
* @dev Applies an additional time-bonus to a distribution amount. This is necessary to
* encourage long-term deposits instead of constant unstake/restakes.
* The bonus-multiplier is the result of a linear function that starts at startBonus and
* ends at 100% over bonusPeriodSec, then stays at 100% thereafter.
* @param currentRewardTokens The current number of distribution tokens already alotted for this
* unstake op. Any bonuses are already applied.
* @param stakingShareSeconds The stakingShare-seconds that are being burned for new
* distribution tokens.
* @param stakeTimeSec Length of time for which the tokens were staked. Needed to calculate
* the time-bonus.
* @return Updated amount of distribution tokens to award, with any bonus included on the
* newly added tokens.
*/
function computeNewReward(uint256 currentRewardTokens,
uint256 stakingShareSeconds,
uint256 stakeTimeSec) private view returns (uint256) {
uint256 newRewardTokens =
totalUnlocked()
.mul(stakingShareSeconds)
.div(_totalStakingShareSeconds);
if (stakeTimeSec >= bonusPeriodSec) {
return currentRewardTokens.add(newRewardTokens);
}
uint256 oneHundredPct = 10**BONUS_DECIMALS;
uint256 bonusedReward =
startBonus
.add(oneHundredPct.sub(startBonus).mul(stakeTimeSec).div(bonusPeriodSec))
.mul(newRewardTokens)
.div(oneHundredPct);
return currentRewardTokens.add(bonusedReward);
}
/**
* @param addr The user to look up staking information for.
* @return The number of staking tokens deposited for addr.
*/
function totalStakedFor(address addr) public view returns (uint256) {
return totalStakingShares > 0 ?
totalStaked().mul(_userTotals[addr].stakingShares).div(totalStakingShares) : 0;
}
/**
* @return The total number of deposit tokens staked globally, by all users.
*/
function totalStaked() public view returns (uint256) {
return _stakingPool.balance();
}
/**
* @dev Note that this application has a staking token as well as a distribution token, which
* may be different. This function is required by EIP-900.
* @return The deposit token used for staking.
*/
function token() external view returns (address) {
return address(getStakingToken());
}
/**
* @dev A globally callable function to update the accounting state of the system.
* Global state and state for the caller are updated.
* @return [0] balance of the locked pool
* @return [1] balance of the unlocked pool
* @return [2] caller's staking share seconds
* @return [3] global staking share seconds
* @return [4] Rewards caller has accumulated, optimistically assumes max time-bonus.
* @return [5] block timestamp
*/
function updateAccounting() public returns (
uint256, uint256, uint256, uint256, uint256, uint256) {
unlockTokens();
// Global accounting
uint256 newStakingShareSeconds =
now
.sub(_lastAccountingTimestampSec)
.mul(totalStakingShares);
_totalStakingShareSeconds = _totalStakingShareSeconds.add(newStakingShareSeconds);
_lastAccountingTimestampSec = now;
// User Accounting
UserTotals storage totals = _userTotals[msg.sender];
uint256 newUserStakingShareSeconds =
now
.sub(totals.lastAccountingTimestampSec)
.mul(totals.stakingShares);
totals.stakingShareSeconds =
totals.stakingShareSeconds
.add(newUserStakingShareSeconds);
totals.lastAccountingTimestampSec = now;
uint256 totalUserRewards = (_totalStakingShareSeconds > 0)
? totalUnlocked().mul(totals.stakingShareSeconds).div(_totalStakingShareSeconds)
: 0;
return (
totalLocked(),
totalUnlocked(),
totals.stakingShareSeconds,
_totalStakingShareSeconds,
totalUserRewards,
now
);
}
/**
* @return Total number of locked distribution tokens.
*/
function totalLocked() public view returns (uint256) {
return _lockedPool.balance();
}
/**
* @return Total number of unlocked distribution tokens.
*/
function totalUnlocked() public view returns (uint256) {
return _unlockedPool.balance();
}
/**
* @return Number of unlock schedules.
*/
function unlockScheduleCount() public view returns (uint256) {
return unlockSchedules.length;
}
/**
* @dev This funcion allows the contract owner to add more locked distribution tokens, along
* with the associated 'unlock schedule'. These locked tokens immediately begin unlocking
* linearly over the duraction of durationSec timeframe.
* @param amount Number of distribution tokens to lock. These are transferred from the caller.
* @param durationSec Length of time to linear unlock the tokens.
*/
function lockTokens(uint256 amount, uint256 durationSec) external onlyOwner {
require(unlockSchedules.length < _maxUnlockSchedules,
'TokenGeyser: reached maximum unlock schedules');
// Update lockedTokens amount before using it in computations after.
updateAccounting();
uint256 lockedTokens = totalLocked();
uint256 mintedLockedShares = (lockedTokens > 0)
? totalLockedShares.mul(amount).div(lockedTokens)
: amount.mul(_initialSharesPerToken);
UnlockSchedule memory schedule;
schedule.initialLockedShares = mintedLockedShares;
schedule.lastUnlockTimestampSec = now;
schedule.endAtSec = now.add(durationSec);
schedule.durationSec = durationSec;
unlockSchedules.push(schedule);
totalLockedShares = totalLockedShares.add(mintedLockedShares);
require(_lockedPool.token().transferFrom(msg.sender, address(_lockedPool), amount),
'TokenGeyser: transfer into locked pool failed');
emit TokensLocked(amount, durationSec, totalLocked());
}
/**
* @dev Moves distribution tokens from the locked pool to the unlocked pool, according to the
* previously defined unlock schedules. Publicly callable.
* @return Number of newly unlocked distribution tokens.
*/
function unlockTokens() public returns (uint256) {
uint256 unlockedTokens = 0;
uint256 lockedTokens = totalLocked();
if (totalLockedShares == 0) {
unlockedTokens = lockedTokens;
} else {
uint256 unlockedShares = 0;
for (uint256 s = 0; s < unlockSchedules.length; s++) {
unlockedShares = unlockedShares.add(unlockScheduleShares(s));
}
unlockedTokens = unlockedShares.mul(lockedTokens).div(totalLockedShares);
totalLockedShares = totalLockedShares.sub(unlockedShares);
}
if (unlockedTokens > 0) {
require(_lockedPool.transfer(address(_unlockedPool), unlockedTokens),
'TokenGeyser: transfer out of locked pool failed');
emit TokensUnlocked(unlockedTokens, totalLocked());
}
return unlockedTokens;
}
/**
* @dev Returns the number of unlockable shares from a given schedule. The returned value
* depends on the time since the last unlock. This function updates schedule accounting,
* but does not actually transfer any tokens.
* @param s Index of the unlock schedule.
* @return The number of unlocked shares.
*/
function unlockScheduleShares(uint256 s) private returns (uint256) {
UnlockSchedule storage schedule = unlockSchedules[s];
if(schedule.unlockedShares >= schedule.initialLockedShares) {
return 0;
}
uint256 sharesToUnlock = 0;
// Special case to handle any leftover dust from integer division
if (now >= schedule.endAtSec) {
sharesToUnlock = (schedule.initialLockedShares.sub(schedule.unlockedShares));
schedule.lastUnlockTimestampSec = schedule.endAtSec;
} else {
sharesToUnlock = now.sub(schedule.lastUnlockTimestampSec)
.mul(schedule.initialLockedShares)
.div(schedule.durationSec);
schedule.lastUnlockTimestampSec = now;
}
schedule.unlockedShares = schedule.unlockedShares.add(sharesToUnlock);
return sharesToUnlock;
}
/**
* @dev Lets the owner rescue funds air-dropped to the staking pool.
* @param tokenToRescue Address of the token to be rescued.
* @param to Address to which the rescued funds are to be sent.
* @param amount Amount of tokens to be rescued.
* @return Transfer success.
*/
function rescueFundsFromStakingPool(address tokenToRescue, address to, uint256 amount)
public onlyOwner returns (bool) {
return _stakingPool.rescueFunds(tokenToRescue, to, amount);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"stakingToken","type":"address"},{"internalType":"contract IERC20","name":"distributionToken","type":"address"},{"internalType":"uint256","name":"maxUnlockSchedules","type":"uint256"},{"internalType":"uint256","name":"startBonus_","type":"uint256"},{"internalType":"uint256","name":"bonusPeriodSec_","type":"uint256"},{"internalType":"uint256","name":"initialSharesPerToken","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"durationSec","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"}],"name":"TokensLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"}],"name":"TokensUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"Unstaked","type":"event"},{"constant":true,"inputs":[],"name":"BONUS_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bonusPeriodSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getDistributionToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getStakingToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"durationSec","type":"uint256"}],"name":"lockTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenToRescue","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFundsFromStakingPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"stakeFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"startBonus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"supportsHistory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalLockedShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"totalStakedFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStakingShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalUnlocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"unlockScheduleCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"unlockSchedules","outputs":[{"internalType":"uint256","name":"initialLockedShares","type":"uint256"},{"internalType":"uint256","name":"unlockedShares","type":"uint256"},{"internalType":"uint256","name":"lastUnlockTimestampSec","type":"uint256"},{"internalType":"uint256","name":"endAtSec","type":"uint256"},{"internalType":"uint256","name":"durationSec","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unlockTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"unstake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"unstakeQuery","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"updateAccounting","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405260006004556000600555600060065560006007556000600855426009556000600a556000600b553480156200003857600080fd5b5060405162002c1538038062002c15833981810160405260c08110156200005e57600080fd5b508051602082015160408301516060840151608085015160a0909501519394929391929091620000966001600160e01b03620002d616565b600080546001600160a01b0319166001600160a01b03928316178082556040519216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36064831115620001205760405162461bcd60e51b815260040180806020018281038252602181526020018062002ba96021913960400191505060405180910390fd5b816200015e5760405162461bcd60e51b815260040180806020018281038252602181526020018062002bf46021913960400191505060405180910390fd5b600081116200019f5760405162461bcd60e51b815260040180806020018281038252602a81526020018062002bca602a913960400191505060405180910390fd5b85604051620001ae90620002da565b6001600160a01b03909116815260405190819003602001906000f080158015620001dc573d6000803e3d6000fd5b50600180546001600160a01b0319166001600160a01b039290921691909117905560405185906200020d90620002da565b6001600160a01b03909116815260405190819003602001906000f0801580156200023b573d6000803e3d6000fd5b50600280546001600160a01b0319166001600160a01b039290921691909117905560405185906200026c90620002da565b6001600160a01b03909116815260405190819003602001906000f0801580156200029a573d6000803e3d6000fd5b50600380546001600160a01b0319166001600160a01b0392909216919091179055600492909255600555600a91909155600b5550620002e89050565b3390565b610736806200247383390190565b61217b80620002f86000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c80637c6aa6f4116100f95780639f9106d111610097578063c8fd6ed011610071578063c8fd6ed014610485578063f2fde38b146104fc578063f968f49314610522578063fc0c546a1461052a576101a9565b80639f9106d11461046d578063a779d08014610475578063c7ae20071461047d576101a9565b806386805dd1116100d357806386805dd11461041d57806389158d8e1461043a5780638da5cb5b1461045d5780638f32d59b14610465576101a9565b80637c6aa6f414610405578063817b1cd21461040d57806381c39bec14610415576101a9565b80634b341aed116101665780635c94bcb2116101405780635c94bcb2146103a55780637033e4a6146103ed57806370c6a17e146103f5578063715018a6146103fd576101a9565b80634b341aed1461032d57806356891412146103535780635a72bbef1461035b576101a9565b80630e89439b146101ae5780630ef96356146102275780631dc27fde146102ac57806322c12b84146102c657806338b45fde146102ea578063494347e7146102f2575b600080fd5b610225600480360360408110156101c457600080fd5b813591908101906040810160208201356401000000008111156101e657600080fd5b8201836020820111156101f857600080fd5b8035906020019184600183028401116401000000008311171561021a57600080fd5b509092509050610532565b005b6102256004803603606081101561023d57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561026d57600080fd5b82018360208201111561027f57600080fd5b803590602001918460018302840111640100000000831117156102a157600080fd5b509092509050610542565b6102b461059a565b60408051918252519081900360200190f35b6102ce61059f565b604080516001600160a01b039092168252519081900360200190f35b6102b4610715565b6102fa61071b565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6102b46004803603602081101561034357600080fd5b50356001600160a01b0316610827565b6102b461086e565b6103916004803603606081101561037157600080fd5b506001600160a01b038135811691602081013590911690604001356108b3565b604080519115158252519081900360200190f35b6103c2600480360360208110156103bb57600080fd5b5035610990565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6103916109ce565b6102b46109d3565b6102256109d9565b6102b4610a6a565b6102b4610a70565b6102b4610ab5565b6102b46004803603602081101561043357600080fd5b5035610abb565b6102256004803603604081101561045057600080fd5b5080359060200135610ac6565b6102ce610e44565b610391610e53565b6102ce610e77565b6102b4610ebc565b6102b4610f01565b6102256004803603604081101561049b57600080fd5b813591908101906040810160208201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050610f07565b6102256004803603602081101561051257600080fd5b50356001600160a01b0316610f10565b6102b4610f63565b6102ce6110f7565b61053d333385611106565b505050565b61054a610e53565b610589576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b610594338585611106565b50505050565b600281565b60035460408051637e062a3560e11b815290516000926001600160a01b03169163fc0c546a916004808301926020929190829003018186803b1580156105e457600080fd5b505afa1580156105f8573d6000803e3d6000fd5b505050506040513d602081101561060e57600080fd5b505160025460408051637e062a3560e11b815290516001600160a01b03938416939092169163fc0c546a91600480820192602092909190829003018186803b15801561065957600080fd5b505afa15801561066d573d6000803e3d6000fd5b505050506040513d602081101561068357600080fd5b50516001600160a01b03161461069557fe5b600260009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d602081101561070d57600080fd5b505190505b90565b60045481565b60008060008060008061072c610f63565b50600061075660075461074a600954426114a190919063ffffffff16565b9063ffffffff6114ec16565b60085490915061076c908263ffffffff61154516565b600855426009819055336000908152600c602052604081208054600282015491936107a19261074a919063ffffffff6114a116565b60018301549091506107b9908263ffffffff61154516565b60018301554260028301556008546000906107d55760006107f7565b6107f76008546107eb856001015461074a610ebc565b9063ffffffff61159f16565b905061080161086e565b610809610ebc565b600190940154600854919c949b509950975095504294509092505050565b60008060075411610839576000610866565b6007546001600160a01b0383166000908152600c602052604090205461086691906107eb9061074a610a70565b90505b919050565b600354604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b60006108bd610e53565b6108fc576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b60015460408051631b32b81560e21b81526001600160a01b03878116600483015286811660248301526044820186905291519190921691636ccae0549160648083019260209291908290030181600087803b15801561095a57600080fd5b505af115801561096e573d6000803e3d6000fd5b505050506040513d602081101561098457600080fd5b505190505b9392505050565b600e818154811061099d57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401549294509092909185565b600090565b60075481565b6109e1610e53565b610a20576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60055481565b600154604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b60065481565b6000610866826115e1565b610ace610e53565b610b0d576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b600a54600e5410610b4f5760405162461bcd60e51b815260040180806020018281038252602d8152602001806120ea602d913960400191505060405180910390fd5b610b5761071b565b5050505050506000610b6761086e565b90506000808211610b8b57600b54610b8690859063ffffffff6114ec16565b610ba4565b610ba4826107eb866006546114ec90919063ffffffff16565b9050610bae611da1565b8181524260408201819052610bc9908563ffffffff61154516565b6060820190815260808201858152600e805460018101825560009190915283517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd60059092029182015560208401517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fe82015560408401517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3ff82015591517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c400830155517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c40190910155600654610cbe9083611545565b60065560035460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a91600480820192602092909190829003018186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d6020811015610d3057600080fd5b5051600354604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101899052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610d8e57600080fd5b505af1158015610da2573d6000803e3d6000fd5b505050506040513d6020811015610db857600080fd5b5051610df55760405162461bcd60e51b815260040180806020018281038252602d815260200180611e33602d913960400191505060405180910390fd5b7ff346961af4c52f314df1b45964746280fe409abb959d4a2458d58f79408b1fe88585610e2061086e565b60408051938452602084019290925282820152519081900360600190a15050505050565b6000546001600160a01b031690565b600080546001600160a01b0316610e68611ab0565b6001600160a01b031614905090565b60015460408051637e062a3560e11b815290516000926001600160a01b03169163fc0c546a916004808301926020929190829003018186803b1580156106e357600080fd5b600254604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b600e5490565b610594836115e1565b610f18610e53565b610f57576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b610f6081611ab4565b50565b60008080610f6f61086e565b905060065460001415610f8457809150610fe8565b6000805b600e54811015610fb557610fab610f9e82611b54565b839063ffffffff61154516565b9150600101610f88565b50600654610fcd906107eb838563ffffffff6114ec16565b600654909350610fe3908263ffffffff6114a116565b600655505b81156110f1576003546002546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b505050506040513d602081101561107157600080fd5b50516110ae5760405162461bcd60e51b815260040180806020018281038252602f815260200180611f6f602f913960400191505060405180910390fd5b7f2e444eb379b177e88ce0649c6110a3b01099f03e297127919dd5e3b63a761a9c826110d861086e565b6040805192835260208301919091528051918290030190a15b50905090565b6000611101610e77565b905090565b600081116111455760405162461bcd60e51b815260040180806020018281038252602181526020018061203e6021913960400191505060405180910390fd5b6001600160a01b03821661118a5760405162461bcd60e51b8152600401808060200182810382526028815260200180611f246028913960400191505060405180910390fd5b60075415806111a05750600061119e610a70565b115b6111db5760405162461bcd60e51b815260040180806020018281038252604a8152602001806120a0604a913960600191505060405180910390fd5b600080600754116111ff57600b546111fa90839063ffffffff6114ec16565b61121d565b61121d61120a610a70565b6007546107eb908563ffffffff6114ec16565b90506000811161125e5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f9e6026913960400191505060405180910390fd5b61126661071b565b505050506001600160a01b0385166000908152600c602052604090208054909250611292915083611545565b81554260028201556112a2611dd0565b506040805180820182528381524260208083019182526001600160a01b0388166000908152600d82529384208054600181810183559186529190942083516002909202019081559051920191909155600754611304908463ffffffff61154516565b60075560015460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a91600480820192602092909190829003018186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d602081101561137657600080fd5b5051600154604080516323b872dd60e01b81526001600160a01b038a81166004830152928316602482015260448101889052905191909216916323b872dd9160648083019260209291908290030181600087803b1580156113d657600080fd5b505af11580156113ea573d6000803e3d6000fd5b505050506040513d602081101561140057600080fd5b505161143d5760405162461bcd60e51b815260040180806020018281038252602e815260200180612010602e913960400191505060405180910390fd5b846001600160a01b03167fc65e53b88159e7d2c0fc12a0600072e28ae53ff73b4c1715369c30f1609351428561147288610827565b6040805192835260208301919091526060828201819052600090830152519081900360a00190a2505050505050565b60006114e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c17565b90505b92915050565b6000826114fb575060006114e6565b8282028284828161150857fe5b04146114e35760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000828201838110156114e3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006114e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611cae565b60006115eb61071b565b505050505050600082116116305760405162461bcd60e51b8152600401808060200182810382526023815260200180611f4c6023913960400191505060405180910390fd5b8161163a33610827565b10156116775760405162461bcd60e51b815260040180806020018281038252603d815260200180611ee7603d913960400191505060405180910390fd5b6000611697611684610a70565b6007546107eb908663ffffffff6114ec16565b9050600081116116d85760405162461bcd60e51b8152600401808060200182810382526030815260200180611e606030913960400191505060405180910390fd5b336000908152600c60209081526040808320600d9092528220909183815b81156117fb5783546000908590600019810190811061171157fe5b90600052602060002090600202019050600061173a8260010154426114a190919063ffffffff16565b825490915060009085106117a857825461175a908363ffffffff6114ec16565b9050611767848284611d13565b9350611779868263ffffffff61154516565b835490965061178f90869063ffffffff6114a116565b87549095506117a2886000198301611dea565b506117f3565b6117b8858363ffffffff6114ec16565b90506117c5848284611d13565b93506117d7868263ffffffff61154516565b83549096506117ec908663ffffffff6114a116565b8355600094505b5050506116f6565b6001850154611810908463ffffffff6114a116565b60018601558454611827908763ffffffff6114a116565b855560085461183c908463ffffffff6114a116565b600855600754611852908763ffffffff6114a116565b6007556001546040805163a9059cbb60e01b8152336004820152602481018b905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156118a957600080fd5b505af11580156118bd573d6000803e3d6000fd5b505050506040513d60208110156118d357600080fd5b50516119105760405162461bcd60e51b81526004018080602001828103825260308152602001806121176030913960400191505060405180910390fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561196457600080fd5b505af1158015611978573d6000803e3d6000fd5b505050506040513d602081101561198e57600080fd5b50516119cb5760405162461bcd60e51b8152600401808060200182810382526031815260200180611eb66031913960400191505060405180910390fd5b337faf01bfc8475df280aca00b578c4a948e6d95700f0db8c13365240f7f973c8754896119f783610827565b6040805192835260208301919091526060828201819052600090830152519081900360a00190a260408051828152905133917f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430919081900360200190a26007541580611a6a57506000611a68610a70565b115b611aa55760405162461bcd60e51b815260040180806020018281038252604c815260200180611fc4604c913960600191505060405180910390fd5b979650505050505050565b3390565b6001600160a01b038116611af95760405162461bcd60e51b8152600401808060200182810382526026815260200180611e906026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080600e8381548110611b6457fe5b906000526020600020906005020190508060000154816001015410611b8d576000915050610869565b60038101546000904210611bc25760018201548254611bb19163ffffffff6114a116565b600383015460028401559050611bf2565b611be982600401546107eb846000015461074a8660020154426114a190919063ffffffff16565b42600284015590505b6001820154611c07908263ffffffff61154516565b6001909201919091559050919050565b60008184841115611ca65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c6b578181015183820152602001611c53565b50505050905090810190601f168015611c985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611cfd5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611c6b578181015183820152602001611c53565b506000838581611d0957fe5b0495945050505050565b600080611d286008546107eb8661074a610ebc565b90506005548310611d4b57611d43858263ffffffff61154516565b915050610989565b60006002600a0a90506000611d8f826107eb8561074a611d806005546107eb8c61074a6004548c6114a190919063ffffffff16565b6004549063ffffffff61154516565b9050611aa5878263ffffffff61154516565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b81548183558181111561053d5760008381526020902061053d916107129160029182028101918502015b80821115611e2e5760008082556001820155600201611e14565b509056fe546f6b656e4765797365723a207472616e7366657220696e746f206c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a20556e61626c6520746f20756e7374616b6520616d6f756e74207468697320736d616c6c4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373546f6b656e4765797365723a207472616e73666572206f7574206f6620756e6c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a20756e7374616b6520616d6f756e742069732067726561746572207468616e20746f74616c2075736572207374616b6573546f6b656e4765797365723a2062656e6566696369617279206973207a65726f2061646472657373546f6b656e4765797365723a20756e7374616b6520616d6f756e74206973207a65726f546f6b656e4765797365723a207472616e73666572206f7574206f66206c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a205374616b6520616d6f756e7420697320746f6f20736d616c6c546f6b656e4765797365723a204572726f7220756e7374616b696e672e205374616b696e67207368617265732065786973742c20627574206e6f207374616b696e6720746f6b656e7320646f546f6b656e4765797365723a207472616e7366657220696e746f207374616b696e6720706f6f6c206661696c6564546f6b656e4765797365723a207374616b6520616d6f756e74206973207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572546f6b656e4765797365723a20496e76616c69642073746174652e205374616b696e67207368617265732065786973742c20627574206e6f207374616b696e6720746f6b656e7320646f546f6b656e4765797365723a2072656163686564206d6178696d756d20756e6c6f636b207363686564756c6573546f6b656e4765797365723a207472616e73666572206f7574206f66207374616b696e6720706f6f6c206661696c6564a265627a7a72315820fb42426b4ad76b0aeac7560814c93e5d4abfa352949297b779d2484a79ae4b6864736f6c63430005110032608060405234801561001057600080fd5b506040516107363803806107368339818101604052602081101561003357600080fd5b50516100466001600160e01b036100b316565b600080546001600160a01b0319166001600160a01b03928316178082556040519216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600180546001600160a01b0319166001600160a01b03929092169190911790556100b7565b3390565b610670806100c66000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a9059cbb1161005b578063a9059cbb1461010d578063b69ef8a814610139578063f2fde38b14610153578063fc0c546a1461017957610088565b80636ccae0541461008d578063715018a6146100d75780638da5cb5b146100e15780638f32d59b14610105575b600080fd5b6100c3600480360360608110156100a357600080fd5b506001600160a01b03813581169160208101359091169060400135610181565b604080519115158252519081900360200190f35b6100df6102ab565b005b6100e961033c565b604080516001600160a01b039092168252519081900360200190f35b6100c361034b565b6100c36004803603604081101561012357600080fd5b506001600160a01b03813516906020013561036f565b610141610441565b60408051918252519081900360200190f35b6100df6004803603602081101561016957600080fd5b50356001600160a01b03166104bd565b6100e9610510565b600061018b61034b565b6101ca576040805162461bcd60e51b815260206004820181905260248201526000805160206105ea833981519152604482015290519081900360640190fd5b6001546001600160a01b03858116911614156102175760405162461bcd60e51b815260040180806020018281038252603281526020018061060a6032913960400191505060405180910390fd5b836001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b505050506040513d60208110156102a157600080fd5b5051949350505050565b6102b361034b565b6102f2576040805162461bcd60e51b815260206004820181905260248201526000805160206105ea833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600080546001600160a01b031661036061051f565b6001600160a01b031614905090565b600061037961034b565b6103b8576040805162461bcd60e51b815260206004820181905260248201526000805160206105ea833981519152604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561040e57600080fd5b505af1158015610422573d6000803e3d6000fd5b505050506040513d602081101561043857600080fd5b50519392505050565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561048c57600080fd5b505afa1580156104a0573d6000803e3d6000fd5b505050506040513d60208110156104b657600080fd5b5051905090565b6104c561034b565b610504576040805162461bcd60e51b815260206004820181905260248201526000805160206105ea833981519152604482015290519081900360640190fd5b61050d81610523565b50565b6001546001600160a01b031681565b3390565b6001600160a01b0381166105685760405162461bcd60e51b81526004018080602001828103825260268152602001806105c46026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572546f6b656e506f6f6c3a2043616e6e6f7420636c61696d20746f6b656e2068656c642062792074686520636f6e7472616374a265627a7a7231582084bf79772ae8bef35fbee9ca2fb3b43d95f3aff319c1e1b462434ee14feb281f64736f6c63430005110032546f6b656e4765797365723a20737461727420626f6e757320746f6f2068696768546f6b656e4765797365723a20696e697469616c536861726573506572546f6b656e206973207a65726f546f6b656e4765797365723a20626f6e757320706572696f64206973207a65726f0000000000000000000000000e5da7dd2750a728df4ee8dd5f46e5a8ff431640000000000000000000000000fcf8eda095e37a41e002e266daad7efc1579bc0a0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000004f1a0000000000000000000000000000000000000000000000000000000000000f4240
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80637c6aa6f4116100f95780639f9106d111610097578063c8fd6ed011610071578063c8fd6ed014610485578063f2fde38b146104fc578063f968f49314610522578063fc0c546a1461052a576101a9565b80639f9106d11461046d578063a779d08014610475578063c7ae20071461047d576101a9565b806386805dd1116100d357806386805dd11461041d57806389158d8e1461043a5780638da5cb5b1461045d5780638f32d59b14610465576101a9565b80637c6aa6f414610405578063817b1cd21461040d57806381c39bec14610415576101a9565b80634b341aed116101665780635c94bcb2116101405780635c94bcb2146103a55780637033e4a6146103ed57806370c6a17e146103f5578063715018a6146103fd576101a9565b80634b341aed1461032d57806356891412146103535780635a72bbef1461035b576101a9565b80630e89439b146101ae5780630ef96356146102275780631dc27fde146102ac57806322c12b84146102c657806338b45fde146102ea578063494347e7146102f2575b600080fd5b610225600480360360408110156101c457600080fd5b813591908101906040810160208201356401000000008111156101e657600080fd5b8201836020820111156101f857600080fd5b8035906020019184600183028401116401000000008311171561021a57600080fd5b509092509050610532565b005b6102256004803603606081101561023d57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561026d57600080fd5b82018360208201111561027f57600080fd5b803590602001918460018302840111640100000000831117156102a157600080fd5b509092509050610542565b6102b461059a565b60408051918252519081900360200190f35b6102ce61059f565b604080516001600160a01b039092168252519081900360200190f35b6102b4610715565b6102fa61071b565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b6102b46004803603602081101561034357600080fd5b50356001600160a01b0316610827565b6102b461086e565b6103916004803603606081101561037157600080fd5b506001600160a01b038135811691602081013590911690604001356108b3565b604080519115158252519081900360200190f35b6103c2600480360360208110156103bb57600080fd5b5035610990565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6103916109ce565b6102b46109d3565b6102256109d9565b6102b4610a6a565b6102b4610a70565b6102b4610ab5565b6102b46004803603602081101561043357600080fd5b5035610abb565b6102256004803603604081101561045057600080fd5b5080359060200135610ac6565b6102ce610e44565b610391610e53565b6102ce610e77565b6102b4610ebc565b6102b4610f01565b6102256004803603604081101561049b57600080fd5b813591908101906040810160208201356401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b509092509050610f07565b6102256004803603602081101561051257600080fd5b50356001600160a01b0316610f10565b6102b4610f63565b6102ce6110f7565b61053d333385611106565b505050565b61054a610e53565b610589576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b610594338585611106565b50505050565b600281565b60035460408051637e062a3560e11b815290516000926001600160a01b03169163fc0c546a916004808301926020929190829003018186803b1580156105e457600080fd5b505afa1580156105f8573d6000803e3d6000fd5b505050506040513d602081101561060e57600080fd5b505160025460408051637e062a3560e11b815290516001600160a01b03938416939092169163fc0c546a91600480820192602092909190829003018186803b15801561065957600080fd5b505afa15801561066d573d6000803e3d6000fd5b505050506040513d602081101561068357600080fd5b50516001600160a01b03161461069557fe5b600260009054906101000a90046001600160a01b03166001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106e357600080fd5b505afa1580156106f7573d6000803e3d6000fd5b505050506040513d602081101561070d57600080fd5b505190505b90565b60045481565b60008060008060008061072c610f63565b50600061075660075461074a600954426114a190919063ffffffff16565b9063ffffffff6114ec16565b60085490915061076c908263ffffffff61154516565b600855426009819055336000908152600c602052604081208054600282015491936107a19261074a919063ffffffff6114a116565b60018301549091506107b9908263ffffffff61154516565b60018301554260028301556008546000906107d55760006107f7565b6107f76008546107eb856001015461074a610ebc565b9063ffffffff61159f16565b905061080161086e565b610809610ebc565b600190940154600854919c949b509950975095504294509092505050565b60008060075411610839576000610866565b6007546001600160a01b0383166000908152600c602052604090205461086691906107eb9061074a610a70565b90505b919050565b600354604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b60006108bd610e53565b6108fc576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b60015460408051631b32b81560e21b81526001600160a01b03878116600483015286811660248301526044820186905291519190921691636ccae0549160648083019260209291908290030181600087803b15801561095a57600080fd5b505af115801561096e573d6000803e3d6000fd5b505050506040513d602081101561098457600080fd5b505190505b9392505050565b600e818154811061099d57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401549294509092909185565b600090565b60075481565b6109e1610e53565b610a20576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60055481565b600154604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b60065481565b6000610866826115e1565b610ace610e53565b610b0d576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b600a54600e5410610b4f5760405162461bcd60e51b815260040180806020018281038252602d8152602001806120ea602d913960400191505060405180910390fd5b610b5761071b565b5050505050506000610b6761086e565b90506000808211610b8b57600b54610b8690859063ffffffff6114ec16565b610ba4565b610ba4826107eb866006546114ec90919063ffffffff16565b9050610bae611da1565b8181524260408201819052610bc9908563ffffffff61154516565b6060820190815260808201858152600e805460018101825560009190915283517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd60059092029182015560208401517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fe82015560408401517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3ff82015591517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c400830155517fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c40190910155600654610cbe9083611545565b60065560035460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a91600480820192602092909190829003018186803b158015610d0657600080fd5b505afa158015610d1a573d6000803e3d6000fd5b505050506040513d6020811015610d3057600080fd5b5051600354604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101899052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610d8e57600080fd5b505af1158015610da2573d6000803e3d6000fd5b505050506040513d6020811015610db857600080fd5b5051610df55760405162461bcd60e51b815260040180806020018281038252602d815260200180611e33602d913960400191505060405180910390fd5b7ff346961af4c52f314df1b45964746280fe409abb959d4a2458d58f79408b1fe88585610e2061086e565b60408051938452602084019290925282820152519081900360600190a15050505050565b6000546001600160a01b031690565b600080546001600160a01b0316610e68611ab0565b6001600160a01b031614905090565b60015460408051637e062a3560e11b815290516000926001600160a01b03169163fc0c546a916004808301926020929190829003018186803b1580156106e357600080fd5b600254604080516316d3df1560e31b815290516000926001600160a01b03169163b69ef8a8916004808301926020929190829003018186803b1580156106e357600080fd5b600e5490565b610594836115e1565b610f18610e53565b610f57576040805162461bcd60e51b81526020600482018190526024820152600080516020612080833981519152604482015290519081900360640190fd5b610f6081611ab4565b50565b60008080610f6f61086e565b905060065460001415610f8457809150610fe8565b6000805b600e54811015610fb557610fab610f9e82611b54565b839063ffffffff61154516565b9150600101610f88565b50600654610fcd906107eb838563ffffffff6114ec16565b600654909350610fe3908263ffffffff6114a116565b600655505b81156110f1576003546002546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561104757600080fd5b505af115801561105b573d6000803e3d6000fd5b505050506040513d602081101561107157600080fd5b50516110ae5760405162461bcd60e51b815260040180806020018281038252602f815260200180611f6f602f913960400191505060405180910390fd5b7f2e444eb379b177e88ce0649c6110a3b01099f03e297127919dd5e3b63a761a9c826110d861086e565b6040805192835260208301919091528051918290030190a15b50905090565b6000611101610e77565b905090565b600081116111455760405162461bcd60e51b815260040180806020018281038252602181526020018061203e6021913960400191505060405180910390fd5b6001600160a01b03821661118a5760405162461bcd60e51b8152600401808060200182810382526028815260200180611f246028913960400191505060405180910390fd5b60075415806111a05750600061119e610a70565b115b6111db5760405162461bcd60e51b815260040180806020018281038252604a8152602001806120a0604a913960600191505060405180910390fd5b600080600754116111ff57600b546111fa90839063ffffffff6114ec16565b61121d565b61121d61120a610a70565b6007546107eb908563ffffffff6114ec16565b90506000811161125e5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f9e6026913960400191505060405180910390fd5b61126661071b565b505050506001600160a01b0385166000908152600c602052604090208054909250611292915083611545565b81554260028201556112a2611dd0565b506040805180820182528381524260208083019182526001600160a01b0388166000908152600d82529384208054600181810183559186529190942083516002909202019081559051920191909155600754611304908463ffffffff61154516565b60075560015460408051637e062a3560e11b815290516001600160a01b039092169163fc0c546a91600480820192602092909190829003018186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d602081101561137657600080fd5b5051600154604080516323b872dd60e01b81526001600160a01b038a81166004830152928316602482015260448101889052905191909216916323b872dd9160648083019260209291908290030181600087803b1580156113d657600080fd5b505af11580156113ea573d6000803e3d6000fd5b505050506040513d602081101561140057600080fd5b505161143d5760405162461bcd60e51b815260040180806020018281038252602e815260200180612010602e913960400191505060405180910390fd5b846001600160a01b03167fc65e53b88159e7d2c0fc12a0600072e28ae53ff73b4c1715369c30f1609351428561147288610827565b6040805192835260208301919091526060828201819052600090830152519081900360a00190a2505050505050565b60006114e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c17565b90505b92915050565b6000826114fb575060006114e6565b8282028284828161150857fe5b04146114e35760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000828201838110156114e3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006114e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611cae565b60006115eb61071b565b505050505050600082116116305760405162461bcd60e51b8152600401808060200182810382526023815260200180611f4c6023913960400191505060405180910390fd5b8161163a33610827565b10156116775760405162461bcd60e51b815260040180806020018281038252603d815260200180611ee7603d913960400191505060405180910390fd5b6000611697611684610a70565b6007546107eb908663ffffffff6114ec16565b9050600081116116d85760405162461bcd60e51b8152600401808060200182810382526030815260200180611e606030913960400191505060405180910390fd5b336000908152600c60209081526040808320600d9092528220909183815b81156117fb5783546000908590600019810190811061171157fe5b90600052602060002090600202019050600061173a8260010154426114a190919063ffffffff16565b825490915060009085106117a857825461175a908363ffffffff6114ec16565b9050611767848284611d13565b9350611779868263ffffffff61154516565b835490965061178f90869063ffffffff6114a116565b87549095506117a2886000198301611dea565b506117f3565b6117b8858363ffffffff6114ec16565b90506117c5848284611d13565b93506117d7868263ffffffff61154516565b83549096506117ec908663ffffffff6114a116565b8355600094505b5050506116f6565b6001850154611810908463ffffffff6114a116565b60018601558454611827908763ffffffff6114a116565b855560085461183c908463ffffffff6114a116565b600855600754611852908763ffffffff6114a116565b6007556001546040805163a9059cbb60e01b8152336004820152602481018b905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156118a957600080fd5b505af11580156118bd573d6000803e3d6000fd5b505050506040513d60208110156118d357600080fd5b50516119105760405162461bcd60e51b81526004018080602001828103825260308152602001806121176030913960400191505060405180910390fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561196457600080fd5b505af1158015611978573d6000803e3d6000fd5b505050506040513d602081101561198e57600080fd5b50516119cb5760405162461bcd60e51b8152600401808060200182810382526031815260200180611eb66031913960400191505060405180910390fd5b337faf01bfc8475df280aca00b578c4a948e6d95700f0db8c13365240f7f973c8754896119f783610827565b6040805192835260208301919091526060828201819052600090830152519081900360a00190a260408051828152905133917f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430919081900360200190a26007541580611a6a57506000611a68610a70565b115b611aa55760405162461bcd60e51b815260040180806020018281038252604c815260200180611fc4604c913960600191505060405180910390fd5b979650505050505050565b3390565b6001600160a01b038116611af95760405162461bcd60e51b8152600401808060200182810382526026815260200180611e906026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080600e8381548110611b6457fe5b906000526020600020906005020190508060000154816001015410611b8d576000915050610869565b60038101546000904210611bc25760018201548254611bb19163ffffffff6114a116565b600383015460028401559050611bf2565b611be982600401546107eb846000015461074a8660020154426114a190919063ffffffff16565b42600284015590505b6001820154611c07908263ffffffff61154516565b6001909201919091559050919050565b60008184841115611ca65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c6b578181015183820152602001611c53565b50505050905090810190601f168015611c985780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611cfd5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611c6b578181015183820152602001611c53565b506000838581611d0957fe5b0495945050505050565b600080611d286008546107eb8661074a610ebc565b90506005548310611d4b57611d43858263ffffffff61154516565b915050610989565b60006002600a0a90506000611d8f826107eb8561074a611d806005546107eb8c61074a6004548c6114a190919063ffffffff16565b6004549063ffffffff61154516565b9050611aa5878263ffffffff61154516565b6040518060a0016040528060008152602001600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b81548183558181111561053d5760008381526020902061053d916107129160029182028101918502015b80821115611e2e5760008082556001820155600201611e14565b509056fe546f6b656e4765797365723a207472616e7366657220696e746f206c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a20556e61626c6520746f20756e7374616b6520616d6f756e74207468697320736d616c6c4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373546f6b656e4765797365723a207472616e73666572206f7574206f6620756e6c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a20756e7374616b6520616d6f756e742069732067726561746572207468616e20746f74616c2075736572207374616b6573546f6b656e4765797365723a2062656e6566696369617279206973207a65726f2061646472657373546f6b656e4765797365723a20756e7374616b6520616d6f756e74206973207a65726f546f6b656e4765797365723a207472616e73666572206f7574206f66206c6f636b656420706f6f6c206661696c6564546f6b656e4765797365723a205374616b6520616d6f756e7420697320746f6f20736d616c6c546f6b656e4765797365723a204572726f7220756e7374616b696e672e205374616b696e67207368617265732065786973742c20627574206e6f207374616b696e6720746f6b656e7320646f546f6b656e4765797365723a207472616e7366657220696e746f207374616b696e6720706f6f6c206661696c6564546f6b656e4765797365723a207374616b6520616d6f756e74206973207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572546f6b656e4765797365723a20496e76616c69642073746174652e205374616b696e67207368617265732065786973742c20627574206e6f207374616b696e6720746f6b656e7320646f546f6b656e4765797365723a2072656163686564206d6178696d756d20756e6c6f636b207363686564756c6573546f6b656e4765797365723a207472616e73666572206f7574206f66207374616b696e6720706f6f6c206661696c6564a265627a7a72315820fb42426b4ad76b0aeac7560814c93e5d4abfa352949297b779d2484a79ae4b6864736f6c63430005110032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000e5da7dd2750a728df4ee8dd5f46e5a8ff431640000000000000000000000000fcf8eda095e37a41e002e266daad7efc1579bc0a0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000004f1a0000000000000000000000000000000000000000000000000000000000000f4240
-----Decoded View---------------
Arg [0] : stakingToken (address): 0x0e5da7Dd2750a728df4EE8dD5f46E5A8fF431640
Arg [1] : distributionToken (address): 0xFcF8eda095e37A41e002E266DaAD7efC1579bc0A
Arg [2] : maxUnlockSchedules (uint256): 10000
Arg [3] : startBonus_ (uint256): 33
Arg [4] : bonusPeriodSec_ (uint256): 5184000
Arg [5] : initialSharesPerToken (uint256): 1000000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e5da7dd2750a728df4ee8dd5f46e5a8ff431640
Arg [1] : 000000000000000000000000fcf8eda095e37a41e002e266daad7efc1579bc0a
Arg [2] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000021
Arg [4] : 00000000000000000000000000000000000000000000000000000000004f1a00
Arg [5] : 00000000000000000000000000000000000000000000000000000000000f4240
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.