Source Code
Latest 25 from a total of 75 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Reward | 11507554 | 1842 days ago | IN | 0 ETH | 0.00547152 | ||||
| Claim Reward | 11479038 | 1847 days ago | IN | 0 ETH | 0.00437185 | ||||
| Claim Reward | 11474942 | 1847 days ago | IN | 0 ETH | 0.00437185 | ||||
| Claim Reward | 11473728 | 1847 days ago | IN | 0 ETH | 0.0038255 | ||||
| Withdraw | 11473636 | 1847 days ago | IN | 0 ETH | 0.00170974 | ||||
| Withdraw | 11470321 | 1848 days ago | IN | 0 ETH | 0.00548748 | ||||
| Claim Reward | 11467137 | 1848 days ago | IN | 0 ETH | 0.01138261 | ||||
| Withdraw | 11445513 | 1852 days ago | IN | 0 ETH | 0.00211526 | ||||
| Claim Reward | 11445474 | 1852 days ago | IN | 0 ETH | 0.00974263 | ||||
| Claim Reward | 11444058 | 1852 days ago | IN | 0 ETH | 0.00291267 | ||||
| Withdraw | 11444042 | 1852 days ago | IN | 0 ETH | 0.00173898 | ||||
| Withdraw | 11442578 | 1852 days ago | IN | 0 ETH | 0.00165123 | ||||
| Claim Reward | 11442578 | 1852 days ago | IN | 0 ETH | 0.00383028 | ||||
| Claim Reward | 11439580 | 1853 days ago | IN | 0 ETH | 0.00226018 | ||||
| Withdraw | 11439571 | 1853 days ago | IN | 0 ETH | 0.00210104 | ||||
| Claim Reward | 11397561 | 1859 days ago | IN | 0 ETH | 0.00309878 | ||||
| Stake | 11372776 | 1863 days ago | IN | 0 ETH | 0.00256012 | ||||
| Claim Reward | 11371585 | 1863 days ago | IN | 0 ETH | 0.00372182 | ||||
| Withdraw | 11371573 | 1863 days ago | IN | 0 ETH | 0.00230235 | ||||
| Claim Reward | 11366321 | 1864 days ago | IN | 0 ETH | 0.01375807 | ||||
| Claim Reward | 11349920 | 1866 days ago | IN | 0 ETH | 0.00163352 | ||||
| Claim Reward | 11346027 | 1867 days ago | IN | 0 ETH | 0.00143603 | ||||
| Withdraw | 11345958 | 1867 days ago | IN | 0 ETH | 0.00115932 | ||||
| Withdraw | 11344385 | 1867 days ago | IN | 0 ETH | 0.00115749 | ||||
| Claim Reward | 11344372 | 1867 days ago | IN | 0 ETH | 0.0021296 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
StakingPool
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2020-11-12
*/
// File: @openzeppelin/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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].
*/
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 () internal {
_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;
}
}
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.6.0;
/*
* @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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity ^0.6.0;
/**
* @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.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* 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 {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @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(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.6.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, 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.
*/
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.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
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.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.6.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);
}
// File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol
pragma solidity ^0.6.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: browser/SPO/LPTokenWrapper.sol
pragma solidity ^0.6.0;
/**
* @title lpTokenWrapper
* @author Synthetix (forked from /Synthetixio/synthetix/contracts/StakingRewards.sol)
* Audit: https://github.com/sigp/public-audits/blob/master/synthetix/unipool/review.pdf
* Changes by: SPO.
* @notice LP Token wrapper to facilitate tracking of staked balances
* @dev Changes:
* - Added UserData and _historyTotalSupply to track history balances
* - Changing 'stake' and 'withdraw' to internal funcs
*/
contract LPTokenWrapper is ReentrancyGuard {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public lpToken;
uint256 private _totalSupply;
mapping (uint256 => uint256) private _historyTotalSupply;
mapping(address => uint256) private _balances;
//Hold in seconds before withdrawal after last time staked
uint256 public holdTime;
struct UserData {
//Period when balance becomes nonzero or last period rewards claimed
uint256 period;
//Last time deposited. used to implement holdDays
uint256 lastTime;
mapping (uint256 => uint) historyBalance;
}
mapping (address => UserData) private userData;
/**
* @dev TokenWrapper constructor
* @param _lpToken Wrapped token to be staked
* @param _holdDays Hold days after last deposit
*/
constructor(address _lpToken, uint256 _holdDays) internal {
lpToken = IERC20(_lpToken);
holdTime = _holdDays.mul(1 days);
}
/**
* @dev Get the total amount of the staked token
* @return uint256 total supply
*/
function totalSupply()
public
view
returns (uint256)
{
return _totalSupply;
}
/**
* @dev Get the total amount of the staked token
* @param _period Period for which total supply returned
* @return uint256 total supply
*/
function historyTotalSupply(uint256 _period)
public
view
returns (uint256)
{
return _historyTotalSupply[_period];
}
/**
* @dev Get the balance of a given account
* @param _address User for which to retrieve balance
*/
function balanceOf(address _address)
public
view
returns (uint256)
{
return _balances[_address];
}
/**
* @dev Deposits a given amount of lpToken from sender
* @param _amount Units of lpToken
*/
function _stake(uint256 _amount, uint256 _period)
internal
nonReentrant
{
_totalSupply = _totalSupply.add(_amount);
_updateHistoryTotalSupply(_period);
UserData storage user = userData[msg.sender];
if(_balances[msg.sender] == 0) user.period = _period;
_balances[msg.sender] = _balances[msg.sender].add(_amount);
user.historyBalance[_period] = _balances[msg.sender];
user.lastTime = block.timestamp;
lpToken.safeTransferFrom(msg.sender, address(this), _amount);
}
/**
* @dev Withdraws a given stake from sender
* @param _amount Units of lpToken
*/
function _withdraw(uint256 _amount, uint256 _period)
internal
nonReentrant
{
//Check first if user has sufficient balance, added due to hold requrement
//("Cannot withdraw, tokens on hold" will be fired even if user has no balance)
require(_balances[msg.sender] >= _amount, "Not enough balance");
UserData storage user = userData[msg.sender];
require(block.timestamp.sub(user.lastTime) >= holdTime, "Cannot withdraw, tokens on hold");
_totalSupply = _totalSupply.sub(_amount);
_updateHistoryTotalSupply(_period);
_balances[msg.sender] = _balances[msg.sender].sub(_amount);
user.historyBalance[_period] = _balances[msg.sender];
lpToken.safeTransfer(msg.sender, _amount);
}
/**
* @dev Updates history total supply
* @param _period Current period
*/
function _updateHistoryTotalSupply(uint256 _period)
internal
{
_historyTotalSupply[_period] = _totalSupply;
}
/**
* @dev Returns User Data
* @param _address address of the User
*/
function getUserData(address _address)
internal
view
returns (UserData storage)
{
return userData[_address];
}
/**
* @dev Sets user's period and balance for that period
* @param _address address of the User
*/
function _updateUser(address _address, uint256 _period)
internal
{
userData[_address].period = _period;
userData[_address].historyBalance[_period] = _balances[_address];
}
}
// File: browser/SPO/StakingPool.sol
pragma solidity ^0.6.0;
contract StakingPool is Ownable, ReentrancyGuard, LPTokenWrapper {
using SafeMath for uint256;
using SafeERC20 for IERC20;
using Address for address;
//interface for Rewards Token
IERC20 public rewardsToken;
//Conctact status states
enum Status {Setup, Running, Ended}
//Constants
uint256 constant public CALC_PRECISION = 1e18;
// Address where fees will be sent if fee isn't 0
address public feeBeneficiary;
// Fee in PPM (Parts Per Million), can be 0
uint256 public fee;
//Status of contract
Status public status;
//Rewards for period
uint256 public rewardsPerPeriodCap;
//Total rewards for all periods
uint256 public rewardsTotalCap;
//Staking Period in seconds
uint256 public periodTime;
//Total Periods
uint256 public totalPeriods;
//Grace Periods Time (time window after contract is Ended when users have to claim their Reward Tokens)
//after this period ends, no reward withdrawal is possible and contact owner can withdraw unclamed Reward Tokens
uint256 public gracePeriodTime;
//Time when contracts starts
uint256 public startTime;
//Time when contract ends
uint256 public endTime;
//Time when contract closes (endTime + gracePeriodTime)
uint256 public closeTime;
//Last Period
uint256 public period;
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event WithdrawnERC20(address indexed user, address token, uint256 amount);
/** @dev Updates Period before executing function */
modifier updatePeriod() {
_updatePeriod();
_;
}
/** @dev Make sure setup is finished */
modifier onlyAfterSetup() {
require(status != Status.Setup, "Setup is not finished");
_;
}
/** @dev Make sure setup is finished */
modifier onlyAfterStart() {
require(startTime != 0, "Staking is not started");
_;
}
/**
* @dev Contract constructor
* @param _lpToken Contract address of LP Token
* @param _rewardsToken Contract address of Rewards Token
* @param _rewardsPerPeriodCap Amount of tokens to be distributed each period (1e18)
* @param _periodDays Period time in days
* @param _totalPeriods Total periods contract will be running
* @param _gracePeriodDays Grace period in days
* @param _holdDays Time in days LP Tokens will be on hold for user after each stake
* @param _feeBeneficiary Address where fees will be sent
* @param _fee Fee in ppm
*/
constructor(
address _lpToken,
address _rewardsToken,
uint256 _rewardsPerPeriodCap,
uint256 _periodDays,
uint256 _totalPeriods,
uint256 _gracePeriodDays,
uint256 _holdDays,
address _feeBeneficiary,
uint256 _fee
)
public
LPTokenWrapper(_lpToken, _holdDays)
{
require(_lpToken.isContract(), "LP Token address must be a contract");
require(_rewardsToken.isContract(), "Rewards Token address must be a contract");
rewardsToken = IERC20(_rewardsToken);
rewardsPerPeriodCap = _rewardsPerPeriodCap;
rewardsTotalCap = _rewardsPerPeriodCap.mul(_totalPeriods);
periodTime = _periodDays.mul(1 days);
totalPeriods = _totalPeriods;
gracePeriodTime = _gracePeriodDays.mul(1 days);
feeBeneficiary = _feeBeneficiary;
fee = _fee;
}
/***************************************
ADMIN
****************************************/
/**
* @dev Updates contract setup and mark contract status as Running if all requirements are met
* @param _now Start contract immediatly if true
*/
function adminStart(bool _now)
external
onlyOwner
{
require(status == Status.Setup, "Already started");
require(rewardsToken.balanceOf(address(this)) >= rewardsTotalCap, "Not enough reward tokens to start");
status = Status.Running;
if(_now) _startNow();
}
/**
* @dev Option to start contract even there is no deposits yet
*/
function adminStartNow()
external
onlyOwner
onlyAfterSetup
{
require(startTime == 0 && status == Status.Running, "Already started");
_startNow();
}
/**
* @dev Option to end contract
*/
function adminEnd()
external
onlyOwner
onlyAfterSetup
{
require(block.timestamp >= endTime && endTime != 0, "Cannot End");
_updatePeriod();
}
/**
* @dev Close contract after End and Grace period and withdraw unclamed rewards tokens
* @param _address where to send
*/
function adminClose(address _address)
external
onlyOwner
onlyAfterSetup
{
require(block.timestamp >= closeTime && closeTime != 0, "Cannot Close");
uint256 _rewardsBalance = rewardsToken.balanceOf(address(this));
if(_rewardsBalance > 0) rewardsToken.safeTransfer(_address, _rewardsBalance);
}
/**
* @dev Withdraw other than LP or Rewards tokens
* @param _tokenAddress address of the token contract to withdraw
*/
function adminWithdrawERC20(address _tokenAddress)
external
onlyOwner
{
require(_tokenAddress != address(rewardsToken) && _tokenAddress != address(lpToken), "Cannot withdraw Reward or LP Tokens");
IERC20 _token = IERC20(_tokenAddress);
uint256 _balance = _token.balanceOf(address(this));
require(_balance != 0, "Not enough balance");
uint256 _fee = _balance.mul(fee).div(1e6);
if(_fee != 0){
_token.safeTransfer(feeBeneficiary, _fee);
emit WithdrawnERC20(feeBeneficiary, _tokenAddress, _fee);
}
_token.safeTransfer(msg.sender, _balance.sub(_fee));
emit WithdrawnERC20(msg.sender, _tokenAddress, _balance.sub(_fee));
}
/***************************************
PRIVATE
****************************************/
/**
* @dev Starts the contract
*/
function _startNow()
private
{
startTime = block.timestamp;
endTime = startTime.add(periodTime.mul(totalPeriods));
closeTime = endTime.add(gracePeriodTime);
}
/**
* @dev Updates last period to current and set status to Ended if needed
*/
function _updatePeriod()
private
{
uint256 _currentPeriod = currentPeriod();
if(_currentPeriod != period){
period = _currentPeriod;
_updateHistoryTotalSupply(period);
if(_currentPeriod == totalPeriods){
status = Status.Ended;
//release hold of LP tokens
holdTime = 0;
}
}
}
/***************************************
ACTIONS
****************************************/
/**
* @dev Stakes an amount for the sender, assumes sender approved allowace at LP Token contract _amount for this contract address
* @param _amount of LP Tokens
*/
function stake(uint256 _amount)
external
onlyAfterSetup
updatePeriod
{
require(_amount > 0, "Cannot stake 0");
require(status != Status.Ended, "Contract is Ended");
if(startTime == 0) _startNow();
_stake(_amount, period);
emit Staked(msg.sender, _amount);
}
/**
* @dev Withdraws given LP Token stake amount from the pool
* @param _amount LP Tokens to withdraw
*/
function withdraw(uint256 _amount)
public
onlyAfterStart
updatePeriod
{
require(_amount > 0, "Cannot withdraw 0");
_withdraw(_amount, period);
emit Withdrawn(msg.sender, _amount);
}
/**
* @dev Claims outstanding rewards for the sender.
* First updates outstanding reward allocation and then transfers.
*/
function claimReward()
public
nonReentrant
onlyAfterStart
updatePeriod
{
require(block.timestamp <= closeTime, "Contract is Closed");
uint256 reward = calculateReward(msg.sender);
if (reward > 0) {
_updateUser(msg.sender, period);
rewardsToken.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
/**
* @dev Withdraws LP Tokens stake from pool and claims any rewards
*/
function exit()
external
{
uint256 _amount = balanceOf(msg.sender);
if(_amount !=0) withdraw(_amount);
claimReward();
}
/***************************************
GETTERS
****************************************/
/**
* @dev Calculates current period, if contract is ended returns currentPeriod + 1 (totalPeriods)
*/
function currentPeriod()
public
view
returns (uint256)
{
uint256 _currentPeriod;
if(startTime != 0 && endTime != 0)
{
if(block.timestamp >= endTime){
_currentPeriod = totalPeriods;
}else{
_currentPeriod = block.timestamp.sub(startTime).div(periodTime);
}
}
return _currentPeriod;
}
/**
* @dev Calculates pending rewards for the user since last period claimed rewards to current period
* @param _address address of the user
*/
function calculateReward(address _address)
public
view
returns (uint256)
{
UserData storage user = getUserData(_address);
if(block.timestamp >= closeTime) return 0;
uint256 _period = currentPeriod();
uint256 periodTotalSupply;
uint256 savedTotalSupply;
uint256 periodBalance;
uint256 savedBalance;
uint256 rewardTotal;
if(_period > user.period){
savedTotalSupply = historyTotalSupply(user.period);
savedBalance = user.historyBalance[user.period];
if(savedTotalSupply != 0){
rewardTotal = rewardTotal.add(
rewardsPerPeriodCap.mul(
savedBalance
).mul(
CALC_PRECISION
).div(
savedTotalSupply
).div(
CALC_PRECISION
)
);
}
for(uint256 i = user.period+1; i < _period; i++){
periodTotalSupply = historyTotalSupply(i);
periodBalance = user.historyBalance[i];
periodBalance == 0 ? periodBalance = savedBalance : savedBalance = periodBalance;
periodTotalSupply == 0 ? periodTotalSupply = savedTotalSupply : savedTotalSupply = periodTotalSupply;
if(periodTotalSupply != 0){
rewardTotal = rewardTotal.add(
rewardsPerPeriodCap.mul(
periodBalance
).mul(
CALC_PRECISION
).div(
periodTotalSupply
).div(
CALC_PRECISION
)
);
}
}
}
return rewardTotal;
}
/**
* @dev Returns estimated current period reward for the user based on current total supply and his balance
* @param _address address of the user
*/
function estimateReward(address _address)
public
view
returns (uint256)
{
uint256 _totalSupply = totalSupply();
if(_totalSupply == 0 || block.timestamp >= closeTime) return 0;
return rewardsPerPeriodCap.mul(
balanceOf(_address)
).mul(
CALC_PRECISION
).div(
_totalSupply
).div(
CALC_PRECISION
);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"uint256","name":"_rewardsPerPeriodCap","type":"uint256"},{"internalType":"uint256","name":"_periodDays","type":"uint256"},{"internalType":"uint256","name":"_totalPeriods","type":"uint256"},{"internalType":"uint256","name":"_gracePeriodDays","type":"uint256"},{"internalType":"uint256","name":"_holdDays","type":"uint256"},{"internalType":"address","name":"_feeBeneficiary","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"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":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawnERC20","type":"event"},{"inputs":[],"name":"CALC_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"adminClose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_now","type":"bool"}],"name":"adminStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminStartNow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"adminWithdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"calculateReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"estimateReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeBeneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gracePeriodTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_period","type":"uint256"}],"name":"historyTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"holdTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"period","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsPerPeriodCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsTotalCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"status","outputs":[{"internalType":"enum StakingPool.Status","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPeriods","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620021043803806200210483398181016040526101208110156200003857600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e088015161010090980151969795969495939492939192909190888360006200008262000274565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600280546001600160a01b0319166001600160a01b03841617905562000106816201518062000278602090811b620013e917901c565b60068190555050506200012d896001600160a01b0316620002df60201b6200144b1760201c565b6200016a5760405162461bcd60e51b8152600401808060200182810382526023815260200180620020e16023913960400191505060405180910390fd5b62000189886001600160a01b0316620002df60201b6200144b1760201c565b620001c65760405162461bcd60e51b8152600401808060200182810382526028815260200180620020986028913960400191505060405180910390fd5b600880546001600160a01b0319166001600160a01b038a16179055600c879055620001fe878662000278602090811b620013e917901c565b600d556200021c866201518062000278602090811b620013e917901c565b600e55600f8590556200023f846201518062000278602090811b620013e917901c565b601055600980546001600160a01b0319166001600160a01b039390931692909217909155600a5550620002e595505050505050565b3390565b6000826200028957506000620002d9565b828202828482816200029757fe5b0414620002d65760405162461bcd60e51b8152600401808060200182810382526021815260200180620020c06021913960400191505060405180910390fd5b90505b92915050565b3b151590565b611da380620002f56000396000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063627749e61161011a578063d5bd765c116100ad578063e73e87d51161007c578063e73e87d514610406578063e9fad8ee14610425578063ef78d4fd1461042d578063f2fde38b14610435578063fea708f61461045b576101fb565b8063d5bd765c146103aa578063d82e3962146103b2578063ddca3f43146103d8578063e6de48e0146103e0576101fb565b8063a694fc3a116100e9578063a694fc3a14610360578063b3de47401461037d578063b88a802f1461039a578063d1af0c7d146103a2576101fb565b8063627749e61461032257806370a082311461032a57806378e97925146103505780638da5cb5b14610358576101fb565b80632e1a7d4d11610192578063492fb34311610161578063492fb343146102e65780634dc70bac1461030a5780635c40e30e146103125780635fcbd2851461031a576101fb565b80632e1a7d4d146102b15780632e4d8561146102ce5780633197cbb6146102d65780633efbb8ff146102de576101fb565b806319a33ea2116101ce57806319a33ea2146102525780631d31fac014610278578063200d2ed2146102805780632deef13f146102a9576101fb565b80630604061814610200578063097d51551461021a5780630cbbf1a01461022257806318160ddd1461024a575b600080fd5b610208610463565b60408051918252519081900360200190f35b6102086104ba565b6102486004803603602081101561023857600080fd5b50356001600160a01b03166104c0565b005b610208610663565b6102486004803603602081101561026857600080fd5b50356001600160a01b0316610669565b6102086108e8565b6102886108ee565b6040518082600281111561029857fe5b815260200191505060405180910390f35b6102086108f7565b610248600480360360208110156102c757600080fd5b50356108fd565b6102486109e0565b610208610b03565b610208610b09565b6102ee610b0f565b604080516001600160a01b039092168252519081900360200190f35b610208610b1e565b610248610b2a565b6102ee610c39565b610208610c48565b6102086004803603602081101561034057600080fd5b50356001600160a01b0316610c4e565b610208610c6d565b6102ee610c73565b6102486004803603602081101561037657600080fd5b5035610c82565b6102086004803603602081101561039357600080fd5b5035610ddc565b610248610dee565b6102ee610f60565b610208610f6f565b610208600480360360208110156103c857600080fd5b50356001600160a01b0316610f75565b6102086110d4565b610208600480360360208110156103f657600080fd5b50356001600160a01b03166110da565b6102486004803603602081101561041c57600080fd5b5035151561113d565b6102486112c1565b6102086112e5565b6102486004803603602081101561044b57600080fd5b50356001600160a01b03166112eb565b6102086113e3565b60008060115460001415801561047a575060125415155b156104b55760125442106104915750600f546104b5565b6104b2600e546104ac6011544261145190919063ffffffff16565b90611493565b90505b905090565b60065481565b6104c86114d5565b6000546001600160a01b03908116911614610518576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff16600281111561052b57fe5b1415610576576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b6013544210158015610589575060135415155b6105c9576040805162461bcd60e51b815260206004820152600c60248201526b43616e6e6f7420436c6f736560a01b604482015290519081900360640190fd5b600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561061457600080fd5b505afa158015610628573d6000803e3d6000fd5b505050506040513d602081101561063e57600080fd5b50519050801561065f5760085461065f906001600160a01b031683836114d9565b5050565b60035490565b6106716114d5565b6000546001600160a01b039081169116146106c1576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6008546001600160a01b038281169116148015906106ed57506002546001600160a01b03828116911614155b6107285760405162461bcd60e51b8152600401808060200182810382526023815260200180611d4b6023913960400191505060405180910390fd5b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d602081101561079d57600080fd5b50519050806107e8576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6000610806620f42406104ac600a54856113e990919063ffffffff16565b9050801561087457600954610828906001600160a01b038581169116836114d9565b600954604080516001600160a01b0387811682526020820185905282519316927f31e3f58fbb760a4c31ae5c6416229fca813390b5fa0de533ee4cef14b2b344db929181900390910190a25b610893336108828484611451565b6001600160a01b03861691906114d9565b337f31e3f58fbb760a4c31ae5c6416229fca813390b5fa0de533ee4cef14b2b344db856108c08585611451565b604080516001600160a01b03909316835260208301919091528051918290030190a250505050565b600e5481565b600b5460ff1681565b600d5481565b60115461094a576040805162461bcd60e51b815260206004820152601660248201527514dd185ada5b99c81a5cc81b9bdd081cdd185c9d195960521b604482015290519081900360640190fd5b610952611530565b6000811161099b576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b6109a781601454611572565b60408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6109e86114d5565b6000546001600160a01b03908116911614610a38576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff166002811115610a4b57fe5b1415610a96576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b601154158015610ab657506001600b5460ff166002811115610ab457fe5b145b610af9576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b604482015290519081900360640190fd5b610b01611718565b565b60125481565b600c5481565b6009546001600160a01b031681565b670de0b6b3a764000081565b610b326114d5565b6000546001600160a01b03908116911614610b82576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff166002811115610b9557fe5b1415610be0576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b6012544210158015610bf3575060125415155b610c31576040805162461bcd60e51b815260206004820152600a60248201526910d85b9b9bdd08115b9960b21b604482015290519081900360640190fd5b610b01611530565b6002546001600160a01b031681565b60135481565b6001600160a01b0381166000908152600560205260409020545b919050565b60115481565b6000546001600160a01b031690565b6000600b5460ff166002811115610c9557fe5b1415610ce0576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b610ce8611530565b60008111610d2e576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b6002600b5460ff166002811115610d4157fe5b1415610d88576040805162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd081a5cc8115b991959607a1b604482015290519081900360640190fd5b601154610d9757610d97611718565b610da381601454611750565b60408051828152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250565b60009081526004602052604090205490565b60026001541415610e46576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155601154610e98576040805162461bcd60e51b815260206004820152601660248201527514dd185ada5b99c81a5cc81b9bdd081cdd185c9d195960521b604482015290519081900360640190fd5b610ea0611530565b601354421115610eec576040805162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc810db1bdcd95960721b604482015290519081900360640190fd5b6000610ef733610f75565b90508015610f5957610f0b33601454611849565b600854610f22906001600160a01b031633836114d9565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5060018055565b6008546001600160a01b031681565b60105481565b600080610f818361187e565b90506013544210610f96576000915050610c68565b6000610fa0610463565b9050600080600080600086600001548611156110c8578654610fc190610ddc565b875460009081526002890160205260409020549094509150831561102357611020611019670de0b6b3a76400006104ac876104ac670de0b6b3a764000061101389600c546113e990919063ffffffff16565b906113e9565b8290611898565b90505b86546001015b868110156110c65761103a81610ddc565b600082815260028a0160205260409020549096509350831561105f5783925082611064565b829350835b5085156110745785945084611079565b849550855b5085156110be576110bb6110b4670de0b6b3a76400006104ac896104ac670de0b6b3a76400006110138b600c546113e990919063ffffffff16565b8390611898565b91505b600101611029565b505b98975050505050505050565b600a5481565b6000806110e5610663565b90508015806110f657506013544210155b15611105576000915050610c68565b611136670de0b6b3a76400006104ac836104ac670de0b6b3a764000061101361112d8a610c4e565b600c54906113e9565b9392505050565b6111456114d5565b6000546001600160a01b03908116911614611195576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff1660028111156111a857fe5b146111ec576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b604482015290519081900360640190fd5b600d54600854604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561123a57600080fd5b505afa15801561124e573d6000803e3d6000fd5b505050506040513d602081101561126457600080fd5b505110156112a35760405162461bcd60e51b8152600401808060200182810382526021815260200180611cbf6021913960400191505060405180910390fd5b600b805460ff1916600117905580156112be576112be611718565b50565b60006112cc33610c4e565b905080156112dd576112dd816108fd565b6112be610dee565b60145481565b6112f36114d5565b6000546001600160a01b03908116911614611343576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6001600160a01b0381166113885760405162461bcd60e51b8152600401808060200182810382526026815260200180611c996026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600f5481565b6000826113f857506000611445565b8282028284828161140557fe5b04146114425760405162461bcd60e51b8152600401808060200182810382526021815260200180611ce06021913960400191505060405180910390fd5b90505b92915050565b3b151590565b600061144283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118f2565b600061144283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611989565b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261152b9084906119ee565b505050565b600061153a610463565b905060145481146112be57601481905561155381611a9f565b600f548114156112be5750600b805460ff191660021790556000600655565b600260015414156115ca576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533600090815260056020526040902054821115611628576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b336000908152600760205260409020600654600182015461164a904290611451565b101561169d576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742077697468647261772c20746f6b656e73206f6e20686f6c6400604482015290519081900360640190fd5b6003546116aa9084611451565b6003556116b682611a9f565b336000908152600560205260409020546116d09084611451565b336000818152600560209081526040808320859055868352600286810190925290912092909255905461170f916001600160a01b0390911690856114d9565b50506001805550565b42601155600f54600e546117399161173091906113e9565b60115490611898565b601281905560105461174b9190611898565b601355565b600260015414156117a8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556003546117ba9083611898565b6003556117c681611a9f565b3360009081526007602090815260408083206005909252909120546117e9578181555b336000908152600560205260409020546118039084611898565b336000818152600560209081526040808320859055868352600286810190925290912092909255426001840155905461170f916001600160a01b03909116903086611ab4565b6001600160a01b0390911660009081526007602090815260408083208481556005835281842054948452600201909152902055565b6001600160a01b0316600090815260076020526040902090565b600082820183811015611442576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081848411156119815760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561194657818101518382015260200161192e565b50505050905090810190601f1680156119735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119d85760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561194657818101518382015260200161192e565b5060008385816119e457fe5b0495945050505050565b6060611a43826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b149092919063ffffffff16565b80519091501561152b57808060200190516020811015611a6257600080fd5b505161152b5760405162461bcd60e51b815260040180806020018281038252602a815260200180611d21602a913960400191505060405180910390fd5b60035460009182526004602052604090912055565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b0e9085906119ee565b50505050565b6060611b238484600085611b2b565b949350505050565b6060611b368561144b565b611b87576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611bc65780518252601f199092019160209182019101611ba7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611c28576040519150601f19603f3d011682016040523d82523d6000602084013e611c2d565b606091505b50915091508115611c41579150611b239050565b805115611c515780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561194657818101518382015260200161192e56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734e6f7420656e6f7567682072657761726420746f6b656e7320746f207374617274536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656443616e6e6f7420776974686472617720526577617264206f72204c5020546f6b656e73a26469706673582212207eb1dcfc8f9ca4cad3bd989fdaf3844b0b36e2bbf4a90878dc56c4544bfaba0664736f6c634300060c00335265776172647320546f6b656e2061646472657373206d757374206265206120636f6e7472616374536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774c5020546f6b656e2061646472657373206d757374206265206120636f6e747261637400000000000000000000000057755f7dec33320bca83159c26e93751bfd30fbe00000000000000000000000046bfa3bb807b5c3b3ce7f7e0e667397020b6dc150000000000000000000000000000000000000000000000121b2e5e64647800000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000007317fd9bf44e6a4acbf1602327c2112b5b827a520000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063627749e61161011a578063d5bd765c116100ad578063e73e87d51161007c578063e73e87d514610406578063e9fad8ee14610425578063ef78d4fd1461042d578063f2fde38b14610435578063fea708f61461045b576101fb565b8063d5bd765c146103aa578063d82e3962146103b2578063ddca3f43146103d8578063e6de48e0146103e0576101fb565b8063a694fc3a116100e9578063a694fc3a14610360578063b3de47401461037d578063b88a802f1461039a578063d1af0c7d146103a2576101fb565b8063627749e61461032257806370a082311461032a57806378e97925146103505780638da5cb5b14610358576101fb565b80632e1a7d4d11610192578063492fb34311610161578063492fb343146102e65780634dc70bac1461030a5780635c40e30e146103125780635fcbd2851461031a576101fb565b80632e1a7d4d146102b15780632e4d8561146102ce5780633197cbb6146102d65780633efbb8ff146102de576101fb565b806319a33ea2116101ce57806319a33ea2146102525780631d31fac014610278578063200d2ed2146102805780632deef13f146102a9576101fb565b80630604061814610200578063097d51551461021a5780630cbbf1a01461022257806318160ddd1461024a575b600080fd5b610208610463565b60408051918252519081900360200190f35b6102086104ba565b6102486004803603602081101561023857600080fd5b50356001600160a01b03166104c0565b005b610208610663565b6102486004803603602081101561026857600080fd5b50356001600160a01b0316610669565b6102086108e8565b6102886108ee565b6040518082600281111561029857fe5b815260200191505060405180910390f35b6102086108f7565b610248600480360360208110156102c757600080fd5b50356108fd565b6102486109e0565b610208610b03565b610208610b09565b6102ee610b0f565b604080516001600160a01b039092168252519081900360200190f35b610208610b1e565b610248610b2a565b6102ee610c39565b610208610c48565b6102086004803603602081101561034057600080fd5b50356001600160a01b0316610c4e565b610208610c6d565b6102ee610c73565b6102486004803603602081101561037657600080fd5b5035610c82565b6102086004803603602081101561039357600080fd5b5035610ddc565b610248610dee565b6102ee610f60565b610208610f6f565b610208600480360360208110156103c857600080fd5b50356001600160a01b0316610f75565b6102086110d4565b610208600480360360208110156103f657600080fd5b50356001600160a01b03166110da565b6102486004803603602081101561041c57600080fd5b5035151561113d565b6102486112c1565b6102086112e5565b6102486004803603602081101561044b57600080fd5b50356001600160a01b03166112eb565b6102086113e3565b60008060115460001415801561047a575060125415155b156104b55760125442106104915750600f546104b5565b6104b2600e546104ac6011544261145190919063ffffffff16565b90611493565b90505b905090565b60065481565b6104c86114d5565b6000546001600160a01b03908116911614610518576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff16600281111561052b57fe5b1415610576576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b6013544210158015610589575060135415155b6105c9576040805162461bcd60e51b815260206004820152600c60248201526b43616e6e6f7420436c6f736560a01b604482015290519081900360640190fd5b600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561061457600080fd5b505afa158015610628573d6000803e3d6000fd5b505050506040513d602081101561063e57600080fd5b50519050801561065f5760085461065f906001600160a01b031683836114d9565b5050565b60035490565b6106716114d5565b6000546001600160a01b039081169116146106c1576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6008546001600160a01b038281169116148015906106ed57506002546001600160a01b03828116911614155b6107285760405162461bcd60e51b8152600401808060200182810382526023815260200180611d4b6023913960400191505060405180910390fd5b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d602081101561079d57600080fd5b50519050806107e8576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b6000610806620f42406104ac600a54856113e990919063ffffffff16565b9050801561087457600954610828906001600160a01b038581169116836114d9565b600954604080516001600160a01b0387811682526020820185905282519316927f31e3f58fbb760a4c31ae5c6416229fca813390b5fa0de533ee4cef14b2b344db929181900390910190a25b610893336108828484611451565b6001600160a01b03861691906114d9565b337f31e3f58fbb760a4c31ae5c6416229fca813390b5fa0de533ee4cef14b2b344db856108c08585611451565b604080516001600160a01b03909316835260208301919091528051918290030190a250505050565b600e5481565b600b5460ff1681565b600d5481565b60115461094a576040805162461bcd60e51b815260206004820152601660248201527514dd185ada5b99c81a5cc81b9bdd081cdd185c9d195960521b604482015290519081900360640190fd5b610952611530565b6000811161099b576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b6109a781601454611572565b60408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6109e86114d5565b6000546001600160a01b03908116911614610a38576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff166002811115610a4b57fe5b1415610a96576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b601154158015610ab657506001600b5460ff166002811115610ab457fe5b145b610af9576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b604482015290519081900360640190fd5b610b01611718565b565b60125481565b600c5481565b6009546001600160a01b031681565b670de0b6b3a764000081565b610b326114d5565b6000546001600160a01b03908116911614610b82576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff166002811115610b9557fe5b1415610be0576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b6012544210158015610bf3575060125415155b610c31576040805162461bcd60e51b815260206004820152600a60248201526910d85b9b9bdd08115b9960b21b604482015290519081900360640190fd5b610b01611530565b6002546001600160a01b031681565b60135481565b6001600160a01b0381166000908152600560205260409020545b919050565b60115481565b6000546001600160a01b031690565b6000600b5460ff166002811115610c9557fe5b1415610ce0576040805162461bcd60e51b815260206004820152601560248201527414d95d1d5c081a5cc81b9bdd08199a5b9a5cda1959605a1b604482015290519081900360640190fd5b610ce8611530565b60008111610d2e576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b6002600b5460ff166002811115610d4157fe5b1415610d88576040805162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd081a5cc8115b991959607a1b604482015290519081900360640190fd5b601154610d9757610d97611718565b610da381601454611750565b60408051828152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a250565b60009081526004602052604090205490565b60026001541415610e46576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155601154610e98576040805162461bcd60e51b815260206004820152601660248201527514dd185ada5b99c81a5cc81b9bdd081cdd185c9d195960521b604482015290519081900360640190fd5b610ea0611530565b601354421115610eec576040805162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc810db1bdcd95960721b604482015290519081900360640190fd5b6000610ef733610f75565b90508015610f5957610f0b33601454611849565b600854610f22906001600160a01b031633836114d9565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5060018055565b6008546001600160a01b031681565b60105481565b600080610f818361187e565b90506013544210610f96576000915050610c68565b6000610fa0610463565b9050600080600080600086600001548611156110c8578654610fc190610ddc565b875460009081526002890160205260409020549094509150831561102357611020611019670de0b6b3a76400006104ac876104ac670de0b6b3a764000061101389600c546113e990919063ffffffff16565b906113e9565b8290611898565b90505b86546001015b868110156110c65761103a81610ddc565b600082815260028a0160205260409020549096509350831561105f5783925082611064565b829350835b5085156110745785945084611079565b849550855b5085156110be576110bb6110b4670de0b6b3a76400006104ac896104ac670de0b6b3a76400006110138b600c546113e990919063ffffffff16565b8390611898565b91505b600101611029565b505b98975050505050505050565b600a5481565b6000806110e5610663565b90508015806110f657506013544210155b15611105576000915050610c68565b611136670de0b6b3a76400006104ac836104ac670de0b6b3a764000061101361112d8a610c4e565b600c54906113e9565b9392505050565b6111456114d5565b6000546001600160a01b03908116911614611195576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6000600b5460ff1660028111156111a857fe5b146111ec576040805162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cdd185c9d1959608a1b604482015290519081900360640190fd5b600d54600854604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561123a57600080fd5b505afa15801561124e573d6000803e3d6000fd5b505050506040513d602081101561126457600080fd5b505110156112a35760405162461bcd60e51b8152600401808060200182810382526021815260200180611cbf6021913960400191505060405180910390fd5b600b805460ff1916600117905580156112be576112be611718565b50565b60006112cc33610c4e565b905080156112dd576112dd816108fd565b6112be610dee565b60145481565b6112f36114d5565b6000546001600160a01b03908116911614611343576040805162461bcd60e51b81526020600482018190526024820152600080516020611d01833981519152604482015290519081900360640190fd5b6001600160a01b0381166113885760405162461bcd60e51b8152600401808060200182810382526026815260200180611c996026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600f5481565b6000826113f857506000611445565b8282028284828161140557fe5b04146114425760405162461bcd60e51b8152600401808060200182810382526021815260200180611ce06021913960400191505060405180910390fd5b90505b92915050565b3b151590565b600061144283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118f2565b600061144283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611989565b3390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261152b9084906119ee565b505050565b600061153a610463565b905060145481146112be57601481905561155381611a9f565b600f548114156112be5750600b805460ff191660021790556000600655565b600260015414156115ca576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260015533600090815260056020526040902054821115611628576040805162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015290519081900360640190fd5b336000908152600760205260409020600654600182015461164a904290611451565b101561169d576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742077697468647261772c20746f6b656e73206f6e20686f6c6400604482015290519081900360640190fd5b6003546116aa9084611451565b6003556116b682611a9f565b336000908152600560205260409020546116d09084611451565b336000818152600560209081526040808320859055868352600286810190925290912092909255905461170f916001600160a01b0390911690856114d9565b50506001805550565b42601155600f54600e546117399161173091906113e9565b60115490611898565b601281905560105461174b9190611898565b601355565b600260015414156117a8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001556003546117ba9083611898565b6003556117c681611a9f565b3360009081526007602090815260408083206005909252909120546117e9578181555b336000908152600560205260409020546118039084611898565b336000818152600560209081526040808320859055868352600286810190925290912092909255426001840155905461170f916001600160a01b03909116903086611ab4565b6001600160a01b0390911660009081526007602090815260408083208481556005835281842054948452600201909152902055565b6001600160a01b0316600090815260076020526040902090565b600082820183811015611442576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600081848411156119815760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561194657818101518382015260200161192e565b50505050905090810190601f1680156119735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119d85760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561194657818101518382015260200161192e565b5060008385816119e457fe5b0495945050505050565b6060611a43826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b149092919063ffffffff16565b80519091501561152b57808060200190516020811015611a6257600080fd5b505161152b5760405162461bcd60e51b815260040180806020018281038252602a815260200180611d21602a913960400191505060405180910390fd5b60035460009182526004602052604090912055565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b0e9085906119ee565b50505050565b6060611b238484600085611b2b565b949350505050565b6060611b368561144b565b611b87576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611bc65780518252601f199092019160209182019101611ba7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611c28576040519150601f19603f3d011682016040523d82523d6000602084013e611c2d565b606091505b50915091508115611c41579150611b239050565b805115611c515780518082602001fd5b60405162461bcd60e51b815260206004820181815286516024840152865187939192839260440191908501908083836000831561194657818101518382015260200161192e56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734e6f7420656e6f7567682072657761726420746f6b656e7320746f207374617274536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656443616e6e6f7420776974686472617720526577617264206f72204c5020546f6b656e73a26469706673582212207eb1dcfc8f9ca4cad3bd989fdaf3844b0b36e2bbf4a90878dc56c4544bfaba0664736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000057755f7dec33320bca83159c26e93751bfd30fbe00000000000000000000000046bfa3bb807b5c3b3ce7f7e0e667397020b6dc150000000000000000000000000000000000000000000000121b2e5e64647800000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000010000000000000000000000007317fd9bf44e6a4acbf1602327c2112b5b827a520000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _lpToken (address): 0x57755F7DeC33320BcA83159C26E93751bFd30fbE
Arg [1] : _rewardsToken (address): 0x46bFA3Bb807B5c3b3Ce7F7e0E667397020B6dc15
Arg [2] : _rewardsPerPeriodCap (uint256): 334000000000000000000
Arg [3] : _periodDays (uint256): 1
Arg [4] : _totalPeriods (uint256): 30
Arg [5] : _gracePeriodDays (uint256): 30
Arg [6] : _holdDays (uint256): 1
Arg [7] : _feeBeneficiary (address): 0x7317Fd9bf44e6a4ACBf1602327C2112B5B827A52
Arg [8] : _fee (uint256): 0
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000057755f7dec33320bca83159c26e93751bfd30fbe
Arg [1] : 00000000000000000000000046bfa3bb807b5c3b3ce7f7e0e667397020b6dc15
Arg [2] : 0000000000000000000000000000000000000000000000121b2e5e6464780000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [4] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [5] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 0000000000000000000000007317fd9bf44e6a4acbf1602327c2112b5b827a52
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.