Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x8d48a51bcf2386ad99ebc2c1eac1a14cacab631e.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
- Contract name:
- ElonStakingPool
- Optimization enabled
- true
- Compiler version
- v0.8.18+commit.87f61d96
- Optimization runs
- 800
- Verified at
- 2024-01-10T19:31:57.394511Z
contracts/staking/strategies/ElonStakingPool.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import { IMultiplier } from "../interfaces/IMultiplier.sol"; import { IPenaltyFee } from "../interfaces/IPenaltyFee.sol"; import { IStakingPool } from "../interfaces/IStakingPool.sol"; contract ElonStakingPool is ReentrancyGuard, IStakingPool { using SafeERC20 for IERC20; uint256 public constant DECIMAL_MODIFIER = 1e18; IERC20 public immutable rewardsToken; IMultiplier public immutable override rewardsMultiplier; IPenaltyFee public immutable override penaltyFeeCalculator; address public owner; // Duration of the rewards (in seconds) uint256 public rewardsDuration; // Timestamp of when the staking starts uint256 public startsAt; // Timestamp of when the staking ends uint256 public endsAt; // Timestamp of the reward updated uint256 public lastUpdateTime; // Reward per second (total rewards / duration) uint256 public rewardRatePerSec; // Reward per token stored uint256 public rewardPerTokenStored; bool public isPaused; // Total staked uint256 public totalRewards; // Raw amount staked by all users uint256 public totalStaked; // Total staked with each user multiplier applied uint256 public totalWeightedStake; // User address => array of the staking info mapping(address => StakingInfo[]) public userStakingInfo; // it has to be evaluated on a user basis enum StakeTimeOptions { Duration, EndTime } event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event TokenRecovered(address token, uint256 amount); constructor(address _rewardToken, address _multiplier, address _penaltyFeeCalculator) { owner = msg.sender; rewardsToken = IERC20(_rewardToken); rewardsMultiplier = IMultiplier(_multiplier); penaltyFeeCalculator = IPenaltyFee(_penaltyFeeCalculator); } /* ========== VIEWS ========== */ /** * Calculates how much rewards a user has earned up to current block, every time the user stakes/unstakes/withdraw. * We update "rewards[_user]" with how much they are entitled to, up to current block. * Next time we calculate how much they earned since last update and accumulate on rewards[_user]. */ function getUserRewards(address _user, uint256 _stakeNumber) public view returns (uint256) { uint256 weightedAmount = rewardsMultiplier.applyMultiplier( userStakingInfo[_user][_stakeNumber].stakedAmount, userStakingInfo[_user][_stakeNumber].duration ); uint256 rewardsSinceLastUpdate = ((weightedAmount * (rewardPerToken() - userStakingInfo[_user][_stakeNumber].rewardPerTokenPaid)) / DECIMAL_MODIFIER); return rewardsSinceLastUpdate + userStakingInfo[_user][_stakeNumber].rewards; } function lastTimeRewardApplicable() public view returns (uint256) { return block.timestamp < endsAt ? block.timestamp : endsAt; } function rewardPerToken() public view returns (uint256) { if (totalStaked == 0) { return rewardPerTokenStored; } uint256 howLongSinceLastTime = lastTimeRewardApplicable() - lastUpdateTime; return rewardPerTokenStored + ((rewardRatePerSec * howLongSinceLastTime * DECIMAL_MODIFIER) / totalWeightedStake); } function getUserStakes(address _user) external view returns (StakingInfo[] memory) { return userStakingInfo[_user]; } /* ========== MUTATIVE FUNCTIONS ========== */ function _updateReward(address _user, uint256 _stakeNumber) private { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (_user != address(0)) { userStakingInfo[_user][_stakeNumber].rewards = getUserRewards(_user, _stakeNumber); userStakingInfo[_user][_stakeNumber].rewardPerTokenPaid = rewardPerTokenStored; } } function stake(StakeTimeOptions _stakeTimeOption, uint256 _unstakeTime) external payable nonReentrant inProgress { uint256 _amount = msg.value; require(_amount > 0, "ElonStakingPool::stake: amount = 0"); uint256 _minimumStakeTimestamp = _stakeTimeOption == StakeTimeOptions.Duration ? block.timestamp + _unstakeTime : _unstakeTime; require(_minimumStakeTimestamp > startsAt, "ElonStakingPool::stake: _minimumStakeTimestamp <= startsAt"); require( _minimumStakeTimestamp > block.timestamp, "ElonStakingPool::stake: _minimumStakeTimestamp <= block.timestamp" ); uint256 _stakeDuration = _minimumStakeTimestamp - block.timestamp; _updateReward(address(0), 0); StakingInfo memory _stakingInfo = StakingInfo({ stakedAmount: _amount, minimumStakeTimestamp: _minimumStakeTimestamp, duration: _stakeDuration, rewardPerTokenPaid: rewardPerTokenStored, rewards: 0 }); userStakingInfo[msg.sender].push(_stakingInfo); uint256 _stakeNumber = userStakingInfo[msg.sender].length - 1; uint256 weightedStake = rewardsMultiplier.applyMultiplier(_amount, _stakeDuration); totalWeightedStake += weightedStake; totalStaked += _amount; emit Staked(msg.sender, _stakeNumber, _amount); } function unstake(uint256 _amount, uint256 _stakeNumber) external nonReentrant { require(_amount > 0, "ElonStakingPool::unstake: amount = 0"); require( _amount <= userStakingInfo[msg.sender][_stakeNumber].stakedAmount, "ElonStakingPool::unstake: not enough balance" ); _updateReward(msg.sender, _stakeNumber); uint256 currentWeightedStake = rewardsMultiplier.applyMultiplier( userStakingInfo[msg.sender][_stakeNumber].stakedAmount, userStakingInfo[msg.sender][_stakeNumber].duration ); totalWeightedStake -= currentWeightedStake; totalStaked -= _amount; uint256 penaltyFee = 0; if (block.timestamp < userStakingInfo[msg.sender][_stakeNumber].minimumStakeTimestamp) { penaltyFee = penaltyFeeCalculator.calculate( _amount, userStakingInfo[msg.sender][_stakeNumber].duration, address(this) ); if (penaltyFee > _amount) { penaltyFee = _amount; } } userStakingInfo[msg.sender][_stakeNumber].stakedAmount -= _amount; if (userStakingInfo[msg.sender][_stakeNumber].stakedAmount == 0) { _claimRewards(msg.sender, _stakeNumber); // remove the staking info from array userStakingInfo[msg.sender][_stakeNumber] = userStakingInfo[msg.sender][ userStakingInfo[msg.sender].length - 1 ]; userStakingInfo[msg.sender].pop(); } else { // update the weighted stake uint256 newWeightedStake = rewardsMultiplier.applyMultiplier( userStakingInfo[msg.sender][_stakeNumber].stakedAmount, userStakingInfo[msg.sender][_stakeNumber].duration ); totalWeightedStake += newWeightedStake; } if (penaltyFee > 0) { // transfer the penalty fee to the treasury payable(owner).transfer(penaltyFee); _amount -= penaltyFee; } // transfer the amount minus the penalty fee to the user payable(msg.sender).transfer(_amount); emit Unstaked(msg.sender, _stakeNumber, _amount); } function _claimRewards(address _user, uint256 _stakeNumber) private { uint256 reward = userStakingInfo[_user][_stakeNumber].rewards; if (reward > 0) { userStakingInfo[_user][_stakeNumber].rewards = 0; rewardsToken.safeTransfer(_user, reward); emit RewardPaid(_user, _stakeNumber, reward); } } function claimRewards(uint256 _stakeNumber) external nonReentrant { _updateReward(msg.sender, _stakeNumber); _claimRewards(msg.sender, _stakeNumber); } /* ========== RESTRICTED FUNCTIONS ========== */ function initializeStaking( uint256 _startsAt, uint256 _rewardsDuration, uint256 _amount ) external nonReentrant onlyOwner { require(_startsAt > block.timestamp, "ElonStakingPool::initializeStaking: _startsAt must be in the future"); require(_rewardsDuration > 0, "ElonStakingPool::initializeStaking: _rewardsDuration = 0"); require(_amount > 0, "ElonStakingPool::initializeStaking: _amount = 0"); require(startsAt == 0, "ElonStakingPool::initializeStaking: staking already started"); _updateReward(address(0), 0); rewardsDuration = _rewardsDuration; startsAt = _startsAt; endsAt = _startsAt + _rewardsDuration; // add the amount to the pool uint256 initialAmount = rewardsToken.balanceOf(address(this)); rewardsToken.safeTransferFrom(msg.sender, address(this), _amount); uint256 actualAmount = rewardsToken.balanceOf(address(this)) - initialAmount; totalRewards = actualAmount; rewardRatePerSec = actualAmount / _rewardsDuration; // set the staking to in progress isPaused = false; } function resumeStaking() external onlyOwner { require(rewardRatePerSec > 0, "ElonStakingPool::startStaking: reward rate = 0"); require(isPaused, "ElonStakingPool::startStaking: staking already started"); isPaused = false; } function pauseStaking() external onlyOwner { require(!isPaused, "ElonStakingPool::pauseStaking: staking already paused"); isPaused = true; } // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { if (tokenAddress == address(0)) { payable(owner).transfer(tokenAmount); } else { IERC20(tokenAddress).safeTransfer(owner, tokenAmount); } emit TokenRecovered(tokenAddress, tokenAmount); } function transferOwnership(address _newOwner) external onlyOwner { address currentOwner = owner; owner = _newOwner; emit OwnershipTransferred(currentOwner, _newOwner); } /* ========== MODIFIERS ========== */ modifier inProgress() { require(!isPaused, "ElonStakingPool::initialized: staking is paused"); require(startsAt <= block.timestamp, "ElonStakingPool::initialized: staking has not started yet"); require(endsAt > block.timestamp, "ElonStakingPool::notFinished: staking has finished"); _; } modifier onlyOwner() { require(msg.sender == owner, "ElonStakingPool::onlyOwner: not authorized"); _; } }
@openzeppelin/contracts/security/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool); }
@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @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 Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ 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' 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to * 0 before setting it to a non-zero value. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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"); (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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
contracts/staking/interfaces/IMultiplier.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; interface IMultiplier { /** * Applies a multiplier on the _amount, based on the _pool and _beneficiary. * The multiplier is not necessarily a constant number, it can be a more complex factor. */ function applyMultiplier(uint256 _amount, uint256 _duration) external view returns (uint256); function getMultiplier(uint256 _amount, uint256 _duration) external view returns (uint256); function getDurationGroup(uint256 _duration) external view returns (uint256); function getDurationMultiplier(uint256 _duration) external view returns (uint256); }
contracts/staking/interfaces/IPenaltyFee.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; interface IPenaltyFee { /** * Calculates the penalty fee for the given _amount for a specific _beneficiary. */ function calculate(uint256 _amount, uint256 _duration, address _pool) external view returns (uint256); }
contracts/staking/interfaces/IStakingPool.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.18; import { IMultiplier } from "../interfaces/IMultiplier.sol"; import { IPenaltyFee } from "../interfaces/IPenaltyFee.sol"; interface IStakingPool { struct StakingInfo { uint256 stakedAmount; // amount of the stake uint256 minimumStakeTimestamp; // timestamp of the minimum stake uint256 duration; // in seconds uint256 rewardPerTokenPaid; // Reward per token paid uint256 rewards; // rewards to be claimed } function rewardsMultiplier() external view returns (IMultiplier); function penaltyFeeCalculator() external view returns (IPenaltyFee); event Staked(address indexed user, uint256 stakeNumber, uint256 amount); event Unstaked(address indexed user, uint256 stakeNumber, uint256 amount); event RewardPaid(address indexed user, uint256 stakeNumber, uint256 reward); }
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":800,"enabled":true},"metadata":{"useLiteralContent":true,"bytecodeHash":"none"},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_rewardToken","internalType":"address"},{"type":"address","name":"_multiplier","internalType":"address"},{"type":"address","name":"_penaltyFeeCalculator","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardPaid","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"stakeNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"reward","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"stakeNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokenRecovered","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unstaked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"stakeNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"DECIMAL_MODIFIER","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimRewards","inputs":[{"type":"uint256","name":"_stakeNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"endsAt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUserRewards","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"uint256","name":"_stakeNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IStakingPool.StakingInfo[]","components":[{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"minimumStakeTimestamp","internalType":"uint256"},{"type":"uint256","name":"duration","internalType":"uint256"},{"type":"uint256","name":"rewardPerTokenPaid","internalType":"uint256"},{"type":"uint256","name":"rewards","internalType":"uint256"}]}],"name":"getUserStakes","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initializeStaking","inputs":[{"type":"uint256","name":"_startsAt","internalType":"uint256"},{"type":"uint256","name":"_rewardsDuration","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPaused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastTimeRewardApplicable","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastUpdateTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pauseStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPenaltyFee"}],"name":"penaltyFeeCalculator","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"resumeStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerTokenStored","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardRatePerSec","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardsDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMultiplier"}],"name":"rewardsMultiplier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"rewardsToken","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"stake","inputs":[{"type":"uint8","name":"_stakeTimeOption","internalType":"enum ElonStakingPool.StakeTimeOptions"},{"type":"uint256","name":"_unstakeTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startsAt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalStaked","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalWeightedStake","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"_newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unstake","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"uint256","name":"_stakeNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"stakedAmount","internalType":"uint256"},{"type":"uint256","name":"minimumStakeTimestamp","internalType":"uint256"},{"type":"uint256","name":"duration","internalType":"uint256"},{"type":"uint256","name":"rewardPerTokenPaid","internalType":"uint256"},{"type":"uint256","name":"rewards","internalType":"uint256"}],"name":"userStakingInfo","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]}]
Contract Creation Code
0x60e06040523480156200001157600080fd5b506040516200264338038062002643833981016040819052620000349162000086565b6001600081905580546001600160a01b031916331790556001600160a01b0392831660805290821660a0521660c052620000d0565b80516001600160a01b03811681146200008157600080fd5b919050565b6000806000606084860312156200009c57600080fd5b620000a78462000069565b9250620000b76020850162000069565b9150620000c76040850162000069565b90509250925092565b60805160a05160c0516125046200013f600039600081816102770152610fab01526000818161042201528181610e42015281816112360152818161181a0152611ad30152600081816104970152818161085f015281816108e10152818161092b0152611e6601526125046000f3fe6080604052600436106101b75760003560e01c80639e2c8a5b116100ec578063d1af0c7d1161008a578063eed9da1f11610064578063eed9da1f146104e2578063f2fde38b146104f8578063f999c50614610518578063fff0c5361461052d57600080fd5b8063d1af0c7d14610485578063dd752e55146104b9578063df136d65146104cc57600080fd5b8063b6d7dc5c116100c6578063b6d7dc5c14610410578063bddff59214610444578063c8f33c911461045a578063cd3daf9d1461047057600080fd5b80639e2c8a5b146103b0578063af468682146103d0578063b187bd26146103e657600080fd5b80637475f91311610159578063842e298111610133578063842e2981146103275780638980f11f146103545780638da5cb5b14610374578063957577a91461039457600080fd5b80637475f913146102e757806380faa57d146102fc578063817b1cd21461031157600080fd5b80630e15561a116101955780630e15561a1461024f57806323a592771461026557806331d94f89146102b1578063386a9525146102d157600080fd5b806304d978f1146101bc5780630962ef79146102095780630a09284a1461022b575b600080fd5b3480156101c857600080fd5b506101dc6101d736600461224f565b61054d565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b34801561021557600080fd5b50610229610224366004612279565b61059b565b005b34801561023757600080fd5b5061024160045481565b604051908152602001610200565b34801561025b57600080fd5b5061024160095481565b34801561027157600080fd5b506102997f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610200565b3480156102bd57600080fd5b506102296102cc366004612292565b6105c4565b3480156102dd57600080fd5b5061024160025481565b3480156102f357600080fd5b506102296109cf565b34801561030857600080fd5b50610241610b38565b34801561031d57600080fd5b50610241600a5481565b34801561033357600080fd5b506103476103423660046122be565b610b4f565b60405161020091906122e0565b34801561036057600080fd5b5061022961036f36600461224f565b610bf6565b34801561038057600080fd5b50600154610299906001600160a01b031681565b3480156103a057600080fd5b50610241670de0b6b3a764000081565b3480156103bc57600080fd5b506102296103cb36600461234e565b610d11565b3480156103dc57600080fd5b5061024160035481565b3480156103f257600080fd5b506008546104009060ff1681565b6040519015158152602001610200565b34801561041c57600080fd5b506102997f000000000000000000000000000000000000000000000000000000000000000081565b34801561045057600080fd5b5061024160065481565b34801561046657600080fd5b5061024160055481565b34801561047c57600080fd5b506102416113fa565b34801561049157600080fd5b506102997f000000000000000000000000000000000000000000000000000000000000000081565b6102296104c7366004612370565b611467565b3480156104d857600080fd5b5061024160075481565b3480156104ee57600080fd5b50610241600b5481565b34801561050457600080fd5b506102296105133660046122be565b611902565b34801561052457600080fd5b506102296119d9565b34801561053957600080fd5b5061024161054836600461224f565b611ace565b600c602052816000526040600020818154811061056957600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b6105a3611cbb565b6105ad3382611d14565b6105b73382611dd4565b6105c16001600055565b50565b6105cc611cbb565b6001546001600160a01b0316331461063e5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b60648201526084015b60405180910390fd5b4283116106bf5760405162461bcd60e51b815260206004820152604360248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f7374617274734174206d75737420626520696e207468652066757460648201526275726560e81b608482015260a401610635565b600082116107355760405162461bcd60e51b815260206004820152603860248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f726577617264734475726174696f6e203d203000000000000000006064820152608401610635565b600081116107ab5760405162461bcd60e51b815260206004820152602f60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f616d6f756e74203d203000000000000000000000000000000000006064820152608401610635565b600354156108215760405162461bcd60e51b815260206004820152603b60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a207374616b696e6720616c7265616479207374617274656400000000006064820152608401610635565b61082c600080611d14565b6002829055600383905561084082846123a8565b60049081556040516370a0823160e01b815230918101919091526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906123bb565b90506109096001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611ed6565b6040516370a0823160e01b815230600482015260009082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099691906123bb565b6109a091906123d4565b600981905590506109b184826123e7565b60065550506008805460ff191690556109ca6001600055565b505050565b6001546001600160a01b03163314610a3c5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b600060065411610ab45760405162461bcd60e51b815260206004820152602e60248201527f456c6f6e5374616b696e67506f6f6c3a3a73746172745374616b696e673a207260448201527f65776172642072617465203d20300000000000000000000000000000000000006064820152608401610635565b60085460ff16610b2c5760405162461bcd60e51b815260206004820152603660248201527f456c6f6e5374616b696e67506f6f6c3a3a73746172745374616b696e673a207360448201527f74616b696e6720616c72656164792073746172746564000000000000000000006064820152608401610635565b6008805460ff19169055565b60006004544210610b4a575060045490565b504290565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610beb57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610b87565b505050509050919050565b6001546001600160a01b03163314610c635760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b6001600160a01b038216610cb1576001546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cab573d6000803e3d6000fd5b50610ccb565b600154610ccb906001600160a01b03848116911683611f74565b604080516001600160a01b0384168152602081018390527f4590b594be6fdef6bd5e18792a2494ddf2156b618c7bbe48d13a92831208af05910160405180910390a15050565b610d19611cbb565b60008211610d755760405162461bcd60e51b8152602060048201526024808201527f456c6f6e5374616b696e67506f6f6c3a3a756e7374616b653a20616d6f756e746044820152630203d20360e41b6064820152608401610635565b336000908152600c60205260409020805482908110610d9657610d96612409565b906000526020600020906005020160000154821115610e1d5760405162461bcd60e51b815260206004820152602c60248201527f456c6f6e5374616b696e67506f6f6c3a3a756e7374616b653a206e6f7420656e60448201527f6f7567682062616c616e636500000000000000000000000000000000000000006064820152608401610635565b610e273382611d14565b336000908152600c6020526040812080546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163457b08099185908110610e7957610e79612409565b60009182526020808320600590920290910154338352600c9091526040909120805486908110610eab57610eab612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401610ee3929190918252602082015260400190565b602060405180830381865afa158015610f00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2491906123bb565b905080600b6000828254610f3891906123d4565b9250508190555082600a6000828254610f5191906123d4565b9091555050336000908152600c60205260408120805484908110610f7757610f77612409565b90600052602060002090600502016001015442101561108957336000908152600c6020526040902080546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163b2c0f3cb9187919087908110610fe557610fe5612409565b60009182526020909120600260059092020101546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526024820152306044820152606401602060405180830381865afa158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906123bb565b9050838111156110895750825b336000908152600c602052604090208054859190859081106110ad576110ad612409565b906000526020600020906005020160000160008282546110cd91906123d4565b9091555050336000908152600c602052604090208054849081106110f3576110f3612409565b90600052602060002090600502016000015460000361121b576111163384611dd4565b336000908152600c602052604090208054611133906001906123d4565b8154811061114357611143612409565b9060005260206000209060050201600c6000336001600160a01b03166001600160a01b03168152602001908152602001600020848154811061118757611187612409565b6000918252602080832084546005909302019182556001808501549083015560028085015490830155600380850154908301556004938401549390910192909255338152600c909152604090208054806111e3576111e361241f565b600082815260208120600560001990930192830201818155600181018290556002810182905560038101829055600401559055611333565b336000908152600c6020526040812080546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163457b0809918790811061126d5761126d612409565b60009182526020808320600590920290910154338352600c909152604090912080548890811061129f5761129f612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b81526004016112d7929190918252602082015260400190565b602060405180830381865afa1580156112f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131891906123bb565b905080600b600082825461132c91906123a8565b9091555050505b8015611381576001546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611373573d6000803e3d6000fd5b5061137e81856123d4565b93505b604051339085156108fc029086906000818181858888f193505050501580156113ae573d6000803e3d6000fd5b50604080518481526020810186905233917f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e910160405180910390a250506113f66001600055565b5050565b6000600a5460000361140d575060075490565b600060055461141a610b38565b61142491906123d4565b9050600b54670de0b6b3a7640000826006546114409190612435565b61144a9190612435565b61145491906123e7565b60075461146191906123a8565b91505090565b61146f611cbb565b60085460ff16156114e85760405162461bcd60e51b815260206004820152602f60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a65643a20737460448201527f616b696e672069732070617573656400000000000000000000000000000000006064820152608401610635565b4260035411156115605760405162461bcd60e51b815260206004820152603960248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a65643a20737460448201527f616b696e6720686173206e6f74207374617274656420796574000000000000006064820152608401610635565b42600454116115d75760405162461bcd60e51b815260206004820152603260248201527f456c6f6e5374616b696e67506f6f6c3a3a6e6f7446696e69736865643a20737460448201527f616b696e67206861732066696e697368656400000000000000000000000000006064820152608401610635565b34806116305760405162461bcd60e51b815260206004820152602260248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a20616d6f756e74203d604482015261020360f41b6064820152608401610635565b6000808460018111156116455761164561244c565b14611650578261165a565b61165a83426123a8565b905060035481116116d35760405162461bcd60e51b815260206004820152603a60248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d756d60448201527f5374616b6554696d657374616d70203c3d2073746172747341740000000000006064820152608401610635565b4281116117525760405162461bcd60e51b815260206004820152604160248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d756d60448201527f5374616b6554696d657374616d70203c3d20626c6f636b2e74696d657374616d6064820152600760fc1b608482015260a401610635565b600061175e42836123d4565b905061176b600080611d14565b6040805160a08101825284815260208082018581528284018581526007546060850190815260006080860181815233808352600c875297822080546001818101835582855297842089516005909202019081559551868801559351600286015591516003850155905160049093019290925593815292549192916117ef91906123d4565b60405163457b080960e01b815260048101879052602481018590529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063457b080990604401602060405180830381865afa158015611861573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188591906123bb565b905080600b600082825461189991906123a8565b9250508190555085600a60008282546118b291906123a8565b9091555050604080518381526020810188905233917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a25050505050506113f66001600055565b6001546001600160a01b0316331461196f5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001546001600160a01b03163314611a465760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b60085460ff1615611abf5760405162461bcd60e51b815260206004820152603560248201527f456c6f6e5374616b696e67506f6f6c3a3a70617573655374616b696e673a207360448201527f74616b696e6720616c72656164792070617573656400000000000000000000006064820152608401610635565b6008805460ff19166001179055565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663457b0809600c6000876001600160a01b03166001600160a01b031681526020019081526020016000208581548110611b3657611b36612409565b600091825260208083206005909202909101546001600160a01b0389168352600c9091526040909120805487908110611b7157611b71612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401611ba9929190918252602082015260400190565b602060405180830381865afa158015611bc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bea91906123bb565b90506000670de0b6b3a7640000600c6000876001600160a01b03166001600160a01b031681526020019081526020016000208581548110611c2d57611c2d612409565b906000526020600020906005020160030154611c476113fa565b611c5191906123d4565b611c5b9084612435565b611c6591906123e7565b6001600160a01b0386166000908152600c6020526040902080549192509085908110611c9357611c93612409565b90600052602060002090600502016004015481611cb091906123a8565b925050505b92915050565b600260005403611d0d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610635565b6002600055565b611d1c6113fa565b600755611d27610b38565b6005556001600160a01b038216156113f657611d438282611ace565b6001600160a01b0383166000908152600c60205260409020805483908110611d6d57611d6d612409565b906000526020600020906005020160040181905550600754600c6000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110611dbb57611dbb612409565b9060005260206000209060050201600301819055505050565b6001600160a01b0382166000908152600c60205260408120805483908110611dfe57611dfe612409565b906000526020600020906005020160040154905060008111156109ca576001600160a01b0383166000908152600c60205260408120805484908110611e4557611e45612409565b6000918252602090912060046005909202010155611e8d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168483611f74565b60408051838152602081018390526001600160a01b038516917fd6f2c8500df5b44f11e9e48b91ff9f1b9d81bc496d55570c2b1b75bf65243f51910160405180910390a2505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611f6e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611fa4565b50505050565b6040516001600160a01b0383166024820152604481018290526109ca90849063a9059cbb60e01b90606401611f0a565b6000611ff9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661208c9092919063ffffffff16565b905080516000148061201a57508080602001905181019061201a9190612462565b6109ca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610635565b606061209b84846000856120a3565b949350505050565b60608247101561211b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610635565b600080866001600160a01b0316858760405161213791906124a8565b60006040518083038185875af1925050503d8060008114612174576040519150601f19603f3d011682016040523d82523d6000602084013e612179565b606091505b509150915061218a87838387612195565b979650505050505050565b606083156122045782516000036121fd576001600160a01b0385163b6121fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610635565b508161209b565b61209b83838151156122195781518083602001fd5b8060405162461bcd60e51b815260040161063591906124c4565b80356001600160a01b038116811461224a57600080fd5b919050565b6000806040838503121561226257600080fd5b61226b83612233565b946020939093013593505050565b60006020828403121561228b57600080fd5b5035919050565b6000806000606084860312156122a757600080fd5b505081359360208301359350604090920135919050565b6000602082840312156122d057600080fd5b6122d982612233565b9392505050565b602080825282518282018190526000919060409081850190868401855b828110156123415781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016122fd565b5091979650505050505050565b6000806040838503121561236157600080fd5b50508035926020909101359150565b6000806040838503121561238357600080fd5b82356002811061226b57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611cb557611cb5612392565b6000602082840312156123cd57600080fd5b5051919050565b81810381811115611cb557611cb5612392565b60008261240457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8082028115828204841417611cb557611cb5612392565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561247457600080fd5b815180151581146122d957600080fd5b60005b8381101561249f578181015183820152602001612487565b50506000910152565b600082516124ba818460208701612484565b9190910192915050565b60208152600082518060208401526124e3816040850160208701612484565b601f01601f1916919091016040019291505056fea164736f6c6343000812000a0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f000000000000000000000000c049e0951dc66e5af49bf27f0ad305ed2eab2cbc
Deployed ByteCode
0x6080604052600436106101b75760003560e01c80639e2c8a5b116100ec578063d1af0c7d1161008a578063eed9da1f11610064578063eed9da1f146104e2578063f2fde38b146104f8578063f999c50614610518578063fff0c5361461052d57600080fd5b8063d1af0c7d14610485578063dd752e55146104b9578063df136d65146104cc57600080fd5b8063b6d7dc5c116100c6578063b6d7dc5c14610410578063bddff59214610444578063c8f33c911461045a578063cd3daf9d1461047057600080fd5b80639e2c8a5b146103b0578063af468682146103d0578063b187bd26146103e657600080fd5b80637475f91311610159578063842e298111610133578063842e2981146103275780638980f11f146103545780638da5cb5b14610374578063957577a91461039457600080fd5b80637475f913146102e757806380faa57d146102fc578063817b1cd21461031157600080fd5b80630e15561a116101955780630e15561a1461024f57806323a592771461026557806331d94f89146102b1578063386a9525146102d157600080fd5b806304d978f1146101bc5780630962ef79146102095780630a09284a1461022b575b600080fd5b3480156101c857600080fd5b506101dc6101d736600461224f565b61054d565b604080519586526020860194909452928401919091526060830152608082015260a0015b60405180910390f35b34801561021557600080fd5b50610229610224366004612279565b61059b565b005b34801561023757600080fd5b5061024160045481565b604051908152602001610200565b34801561025b57600080fd5b5061024160095481565b34801561027157600080fd5b506102997f000000000000000000000000c049e0951dc66e5af49bf27f0ad305ed2eab2cbc81565b6040516001600160a01b039091168152602001610200565b3480156102bd57600080fd5b506102296102cc366004612292565b6105c4565b3480156102dd57600080fd5b5061024160025481565b3480156102f357600080fd5b506102296109cf565b34801561030857600080fd5b50610241610b38565b34801561031d57600080fd5b50610241600a5481565b34801561033357600080fd5b506103476103423660046122be565b610b4f565b60405161020091906122e0565b34801561036057600080fd5b5061022961036f36600461224f565b610bf6565b34801561038057600080fd5b50600154610299906001600160a01b031681565b3480156103a057600080fd5b50610241670de0b6b3a764000081565b3480156103bc57600080fd5b506102296103cb36600461234e565b610d11565b3480156103dc57600080fd5b5061024160035481565b3480156103f257600080fd5b506008546104009060ff1681565b6040519015158152602001610200565b34801561041c57600080fd5b506102997f0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f81565b34801561045057600080fd5b5061024160065481565b34801561046657600080fd5b5061024160055481565b34801561047c57600080fd5b506102416113fa565b34801561049157600080fd5b506102997f0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc81565b6102296104c7366004612370565b611467565b3480156104d857600080fd5b5061024160075481565b3480156104ee57600080fd5b50610241600b5481565b34801561050457600080fd5b506102296105133660046122be565b611902565b34801561052457600080fd5b506102296119d9565b34801561053957600080fd5b5061024161054836600461224f565b611ace565b600c602052816000526040600020818154811061056957600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b6105a3611cbb565b6105ad3382611d14565b6105b73382611dd4565b6105c16001600055565b50565b6105cc611cbb565b6001546001600160a01b0316331461063e5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b60648201526084015b60405180910390fd5b4283116106bf5760405162461bcd60e51b815260206004820152604360248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f7374617274734174206d75737420626520696e207468652066757460648201526275726560e81b608482015260a401610635565b600082116107355760405162461bcd60e51b815260206004820152603860248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f726577617264734475726174696f6e203d203000000000000000006064820152608401610635565b600081116107ab5760405162461bcd60e51b815260206004820152602f60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a205f616d6f756e74203d203000000000000000000000000000000000006064820152608401610635565b600354156108215760405162461bcd60e51b815260206004820152603b60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a655374616b6960448201527f6e673a207374616b696e6720616c7265616479207374617274656400000000006064820152608401610635565b61082c600080611d14565b6002829055600383905561084082846123a8565b60049081556040516370a0823160e01b815230918101919091526000907f0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc6001600160a01b0316906370a0823190602401602060405180830381865afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d291906123bb565b90506109096001600160a01b037f0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc16333085611ed6565b6040516370a0823160e01b815230600482015260009082906001600160a01b037f0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc16906370a0823190602401602060405180830381865afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099691906123bb565b6109a091906123d4565b600981905590506109b184826123e7565b60065550506008805460ff191690556109ca6001600055565b505050565b6001546001600160a01b03163314610a3c5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b600060065411610ab45760405162461bcd60e51b815260206004820152602e60248201527f456c6f6e5374616b696e67506f6f6c3a3a73746172745374616b696e673a207260448201527f65776172642072617465203d20300000000000000000000000000000000000006064820152608401610635565b60085460ff16610b2c5760405162461bcd60e51b815260206004820152603660248201527f456c6f6e5374616b696e67506f6f6c3a3a73746172745374616b696e673a207360448201527f74616b696e6720616c72656164792073746172746564000000000000000000006064820152608401610635565b6008805460ff19169055565b60006004544210610b4a575060045490565b504290565b6001600160a01b0381166000908152600c60209081526040808320805482518185028101850190935280835260609492939192909184015b82821015610beb57838290600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505081526020019060010190610b87565b505050509050919050565b6001546001600160a01b03163314610c635760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b6001600160a01b038216610cb1576001546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cab573d6000803e3d6000fd5b50610ccb565b600154610ccb906001600160a01b03848116911683611f74565b604080516001600160a01b0384168152602081018390527f4590b594be6fdef6bd5e18792a2494ddf2156b618c7bbe48d13a92831208af05910160405180910390a15050565b610d19611cbb565b60008211610d755760405162461bcd60e51b8152602060048201526024808201527f456c6f6e5374616b696e67506f6f6c3a3a756e7374616b653a20616d6f756e746044820152630203d20360e41b6064820152608401610635565b336000908152600c60205260409020805482908110610d9657610d96612409565b906000526020600020906005020160000154821115610e1d5760405162461bcd60e51b815260206004820152602c60248201527f456c6f6e5374616b696e67506f6f6c3a3a756e7374616b653a206e6f7420656e60448201527f6f7567682062616c616e636500000000000000000000000000000000000000006064820152608401610635565b610e273382611d14565b336000908152600c6020526040812080546001600160a01b037f0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f169163457b08099185908110610e7957610e79612409565b60009182526020808320600590920290910154338352600c9091526040909120805486908110610eab57610eab612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401610ee3929190918252602082015260400190565b602060405180830381865afa158015610f00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2491906123bb565b905080600b6000828254610f3891906123d4565b9250508190555082600a6000828254610f5191906123d4565b9091555050336000908152600c60205260408120805484908110610f7757610f77612409565b90600052602060002090600502016001015442101561108957336000908152600c6020526040902080546001600160a01b037f000000000000000000000000c049e0951dc66e5af49bf27f0ad305ed2eab2cbc169163b2c0f3cb9187919087908110610fe557610fe5612409565b60009182526020909120600260059092020101546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815260048101929092526024820152306044820152606401602060405180830381865afa158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c91906123bb565b9050838111156110895750825b336000908152600c602052604090208054859190859081106110ad576110ad612409565b906000526020600020906005020160000160008282546110cd91906123d4565b9091555050336000908152600c602052604090208054849081106110f3576110f3612409565b90600052602060002090600502016000015460000361121b576111163384611dd4565b336000908152600c602052604090208054611133906001906123d4565b8154811061114357611143612409565b9060005260206000209060050201600c6000336001600160a01b03166001600160a01b03168152602001908152602001600020848154811061118757611187612409565b6000918252602080832084546005909302019182556001808501549083015560028085015490830155600380850154908301556004938401549390910192909255338152600c909152604090208054806111e3576111e361241f565b600082815260208120600560001990930192830201818155600181018290556002810182905560038101829055600401559055611333565b336000908152600c6020526040812080546001600160a01b037f0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f169163457b0809918790811061126d5761126d612409565b60009182526020808320600590920290910154338352600c909152604090912080548890811061129f5761129f612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b81526004016112d7929190918252602082015260400190565b602060405180830381865afa1580156112f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131891906123bb565b905080600b600082825461132c91906123a8565b9091555050505b8015611381576001546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611373573d6000803e3d6000fd5b5061137e81856123d4565b93505b604051339085156108fc029086906000818181858888f193505050501580156113ae573d6000803e3d6000fd5b50604080518481526020810186905233917f7fc4727e062e336010f2c282598ef5f14facb3de68cf8195c2f23e1454b2b74e910160405180910390a250506113f66001600055565b5050565b6000600a5460000361140d575060075490565b600060055461141a610b38565b61142491906123d4565b9050600b54670de0b6b3a7640000826006546114409190612435565b61144a9190612435565b61145491906123e7565b60075461146191906123a8565b91505090565b61146f611cbb565b60085460ff16156114e85760405162461bcd60e51b815260206004820152602f60248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a65643a20737460448201527f616b696e672069732070617573656400000000000000000000000000000000006064820152608401610635565b4260035411156115605760405162461bcd60e51b815260206004820152603960248201527f456c6f6e5374616b696e67506f6f6c3a3a696e697469616c697a65643a20737460448201527f616b696e6720686173206e6f74207374617274656420796574000000000000006064820152608401610635565b42600454116115d75760405162461bcd60e51b815260206004820152603260248201527f456c6f6e5374616b696e67506f6f6c3a3a6e6f7446696e69736865643a20737460448201527f616b696e67206861732066696e697368656400000000000000000000000000006064820152608401610635565b34806116305760405162461bcd60e51b815260206004820152602260248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a20616d6f756e74203d604482015261020360f41b6064820152608401610635565b6000808460018111156116455761164561244c565b14611650578261165a565b61165a83426123a8565b905060035481116116d35760405162461bcd60e51b815260206004820152603a60248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d756d60448201527f5374616b6554696d657374616d70203c3d2073746172747341740000000000006064820152608401610635565b4281116117525760405162461bcd60e51b815260206004820152604160248201527f456c6f6e5374616b696e67506f6f6c3a3a7374616b653a205f6d696e696d756d60448201527f5374616b6554696d657374616d70203c3d20626c6f636b2e74696d657374616d6064820152600760fc1b608482015260a401610635565b600061175e42836123d4565b905061176b600080611d14565b6040805160a08101825284815260208082018581528284018581526007546060850190815260006080860181815233808352600c875297822080546001818101835582855297842089516005909202019081559551868801559351600286015591516003850155905160049093019290925593815292549192916117ef91906123d4565b60405163457b080960e01b815260048101879052602481018590529091506000906001600160a01b037f0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f169063457b080990604401602060405180830381865afa158015611861573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061188591906123bb565b905080600b600082825461189991906123a8565b9250508190555085600a60008282546118b291906123a8565b9091555050604080518381526020810188905233917f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90910160405180910390a25050505050506113f66001600055565b6001546001600160a01b0316331461196f5760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001546001600160a01b03163314611a465760405162461bcd60e51b815260206004820152602a60248201527f456c6f6e5374616b696e67506f6f6c3a3a6f6e6c794f776e65723a206e6f7420604482015269185d5d1a1bdc9a5e995960b21b6064820152608401610635565b60085460ff1615611abf5760405162461bcd60e51b815260206004820152603560248201527f456c6f6e5374616b696e67506f6f6c3a3a70617573655374616b696e673a207360448201527f74616b696e6720616c72656164792070617573656400000000000000000000006064820152608401610635565b6008805460ff19166001179055565b6000807f0000000000000000000000001faa6e5913e5fdfc85d961e86f7aacfc9a7e6c3f6001600160a01b031663457b0809600c6000876001600160a01b03166001600160a01b031681526020019081526020016000208581548110611b3657611b36612409565b600091825260208083206005909202909101546001600160a01b0389168352600c9091526040909120805487908110611b7157611b71612409565b9060005260206000209060050201600201546040518363ffffffff1660e01b8152600401611ba9929190918252602082015260400190565b602060405180830381865afa158015611bc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bea91906123bb565b90506000670de0b6b3a7640000600c6000876001600160a01b03166001600160a01b031681526020019081526020016000208581548110611c2d57611c2d612409565b906000526020600020906005020160030154611c476113fa565b611c5191906123d4565b611c5b9084612435565b611c6591906123e7565b6001600160a01b0386166000908152600c6020526040902080549192509085908110611c9357611c93612409565b90600052602060002090600502016004015481611cb091906123a8565b925050505b92915050565b600260005403611d0d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610635565b6002600055565b611d1c6113fa565b600755611d27610b38565b6005556001600160a01b038216156113f657611d438282611ace565b6001600160a01b0383166000908152600c60205260409020805483908110611d6d57611d6d612409565b906000526020600020906005020160040181905550600754600c6000846001600160a01b03166001600160a01b031681526020019081526020016000208281548110611dbb57611dbb612409565b9060005260206000209060050201600301819055505050565b6001600160a01b0382166000908152600c60205260408120805483908110611dfe57611dfe612409565b906000526020600020906005020160040154905060008111156109ca576001600160a01b0383166000908152600c60205260408120805484908110611e4557611e45612409565b6000918252602090912060046005909202010155611e8d6001600160a01b037f0000000000000000000000003a2561721fc9765b6b599dfea71c9b9e708dfddc168483611f74565b60408051838152602081018390526001600160a01b038516917fd6f2c8500df5b44f11e9e48b91ff9f1b9d81bc496d55570c2b1b75bf65243f51910160405180910390a2505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611f6e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611fa4565b50505050565b6040516001600160a01b0383166024820152604481018290526109ca90849063a9059cbb60e01b90606401611f0a565b6000611ff9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661208c9092919063ffffffff16565b905080516000148061201a57508080602001905181019061201a9190612462565b6109ca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610635565b606061209b84846000856120a3565b949350505050565b60608247101561211b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610635565b600080866001600160a01b0316858760405161213791906124a8565b60006040518083038185875af1925050503d8060008114612174576040519150601f19603f3d011682016040523d82523d6000602084013e612179565b606091505b509150915061218a87838387612195565b979650505050505050565b606083156122045782516000036121fd576001600160a01b0385163b6121fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610635565b508161209b565b61209b83838151156122195781518083602001fd5b8060405162461bcd60e51b815260040161063591906124c4565b80356001600160a01b038116811461224a57600080fd5b919050565b6000806040838503121561226257600080fd5b61226b83612233565b946020939093013593505050565b60006020828403121561228b57600080fd5b5035919050565b6000806000606084860312156122a757600080fd5b505081359360208301359350604090920135919050565b6000602082840312156122d057600080fd5b6122d982612233565b9392505050565b602080825282518282018190526000919060409081850190868401855b828110156123415781518051855286810151878601528581015186860152606080820151908601526080908101519085015260a090930192908501906001016122fd565b5091979650505050505050565b6000806040838503121561236157600080fd5b50508035926020909101359150565b6000806040838503121561238357600080fd5b82356002811061226b57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115611cb557611cb5612392565b6000602082840312156123cd57600080fd5b5051919050565b81810381811115611cb557611cb5612392565b60008261240457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b8082028115828204841417611cb557611cb5612392565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561247457600080fd5b815180151581146122d957600080fd5b60005b8381101561249f578181015183820152602001612487565b50506000910152565b600082516124ba818460208701612484565b9190910192915050565b60208152600082518060208401526124e3816040850160208701612484565b601f01601f1916919091016040019291505056fea164736f6c6343000812000a