More Info
Private Name Tags
ContractCreator
Latest 15 from a total of 15 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Stake | 21564473 | 33 hrs ago | IN | 0 ETH | 0.00439267 | ||||
Stake | 21557432 | 2 days ago | IN | 0 ETH | 0.00299 | ||||
Claim Rewards | 21530741 | 6 days ago | IN | 0 ETH | 0.00749769 | ||||
Stake | 21466894 | 15 days ago | IN | 0 ETH | 0.00654632 | ||||
Stake | 21466877 | 15 days ago | IN | 0 ETH | 0.00708429 | ||||
Claim Rewards | 21466859 | 15 days ago | IN | 0 ETH | 0.00282925 | ||||
Claimed Rewards | 21464007 | 15 days ago | IN | 0 ETH | 0.00013509 | ||||
Claimed Rewards | 21460688 | 15 days ago | IN | 0 ETH | 0.0001688 | ||||
Claimed Rewards | 21460670 | 15 days ago | IN | 0 ETH | 0.00015852 | ||||
Stake | 21404311 | 23 days ago | IN | 0 ETH | 0.00315787 | ||||
Stake | 21394557 | 25 days ago | IN | 0 ETH | 0.00904395 | ||||
Boost Position | 21394342 | 25 days ago | IN | 0 ETH | 0.00362006 | ||||
Stake | 21394331 | 25 days ago | IN | 0 ETH | 0.00796947 | ||||
Stake | 21393153 | 25 days ago | IN | 0 ETH | 0.00799063 | ||||
Stake | 21388344 | 26 days ago | IN | 0 ETH | 0.01373651 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21387332 | 26 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
LiquidityStakingPool
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./libraries/coeffMath.sol" as Math; using SafeERC20 for IERC20; interface ITokenPrices { function prices(address token) external view returns (uint256); } interface IPool { function getPoolId() external view returns (bytes32); function getVault() external view returns(address); function totalSupply() external view returns (uint256); } interface IVault { function getPoolTokens(bytes32 poolId) external view returns ( IERC20[] memory tokens, uint256[] memory balances, uint256 lastChangeBlock ); } contract LiquidityStakingPool is Ownable { struct Stake { uint256 startDate; uint256 endDate; uint256 amount; address staker; uint256 boostPoints; uint256 reducePoints; uint256 beginningEpoch; bool unstaked; uint256 unstakedEpoch; } struct EpochParams { uint256 rewardsPerEpoch; uint256 poolLimitPerEpoch; uint256 stakedPerEpoch; } address public liquidityPool; uint256 public totalStaked; uint256 public stakesCount; uint256 public startDate; address public rewardToken; uint256 public epochDuration = 10 days; //days count ITokenPrices public pricesContract; mapping(uint256 => Stake) public stakes; mapping(address => uint256) public claimedRewards; mapping(uint256 => EpochParams) public epoch; event Staked(uint256 stakeId, uint256 amount, uint256 startDate, uint256 endDate); event Boosted(uint256 stakeId, uint256 endDate); event Unstaked(uint256 stakeId); constructor(address _liquidityPool, address _rewardToken, address _prices, uint256 _startDate, uint256 _epochPoolLimit, uint256 _epochRewards) { require(_startDate == 0 || _startDate >= block.timestamp); liquidityPool = _liquidityPool; rewardToken = _rewardToken; pricesContract = ITokenPrices(_prices); if (_startDate == 0) { startDate = block.timestamp; } else { startDate = _startDate; } EpochParams memory e = EpochParams({ poolLimitPerEpoch: _epochPoolLimit, rewardsPerEpoch: _epochRewards, stakedPerEpoch: 0 }); epoch[1] = e; } function getPoolTokenPrice() public view returns(uint256){ address vault = IPool(liquidityPool).getVault(); bytes32 poolID = IPool(liquidityPool).getPoolId(); uint256 price1 = 0; uint256 price2 = 0; (IERC20[] memory tokens, uint256[] memory balances, ) = IVault(vault).getPoolTokens(poolID); price1 = pricesContract.prices(address(tokens[0])); price2 = pricesContract.prices(address(tokens[1])); uint256 poolTokenPrice = (price1 * balances[0] / 1e6 + price2 * balances[1] / 1e18) * 1e18 / IPool(liquidityPool).totalSupply(); return poolTokenPrice; } function stakedInUSD() public view returns (uint256) { return (totalStaked * getPoolTokenPrice()) / 1e18; } function poolLimit() public view returns (uint256) { (uint256 currentEpoch,,) = getCurrentEpoch(); return epoch[currentEpoch].poolLimitPerEpoch; } function rewardsPerEpoch() public view returns (uint256) { (uint256 currentEpoch,,) = getCurrentEpoch(); return epoch[currentEpoch].rewardsPerEpoch; } function setNextEpoch(uint256 _poolLimit, uint256 _rewards) public onlyOwner { (uint256 currentEpoch,,) = getCurrentEpoch(); EpochParams memory e = EpochParams({ poolLimitPerEpoch: _poolLimit, rewardsPerEpoch: _rewards, stakedPerEpoch: 0 }); IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), _rewards); epoch[currentEpoch + 1] = e; } function stake(uint256 _amount, uint16 _days) public { require(block.timestamp >= startDate, "staking program not started"); require(_days >= 5, "too short period"); require(_days <= 365, "too long period"); uint256 poolTokenPrice = getPoolTokenPrice(); (uint256 currentEpoch,,) = getCurrentEpoch(); totalStaked += _amount; require(stakedInUSD() <= epoch[currentEpoch].poolLimitPerEpoch, "pool is full"); epoch[currentEpoch].stakedPerEpoch += _amount; uint256 boostPoints = getBoostPoints(_days); Stake memory st = Stake({ staker: msg.sender, amount: _amount, startDate: block.timestamp, endDate: block.timestamp + uint256(_days) * 1 days, boostPoints: boostPoints, reducePoints: getReductionFactor(), beginningEpoch: currentEpoch, unstaked: false, unstakedEpoch: 0 }); stakesCount++; stakes[stakesCount] = st; IERC20(liquidityPool).safeTransferFrom(msg.sender, address(this), _amount); emit Staked(stakesCount, _amount, st.startDate, st.endDate); } function unstake(uint256 stakeID) public { require(stakes[stakeID].unstaked == false, "already unstaked"); require(stakes[stakeID].staker == msg.sender, "not stake owner"); require(stakes[stakeID].endDate <= block.timestamp, "too early"); (uint256 currentEpoch,,) = getCurrentEpoch(); totalStaked -= stakes[stakeID].amount; stakes[stakeID].unstaked = true; stakes[stakeID].unstakedEpoch = currentEpoch; IERC20(liquidityPool).safeTransfer(msg.sender, stakes[stakeID].amount); claimRewards(msg.sender); emit Unstaked(stakeID); } function unstakePreview(uint256 _stakeID) public view returns(uint256, uint256) { return (availableRewards(stakes[_stakeID].staker), getLostRewards(_stakeID)); } function claimRewards(address _wallet) public { uint256 rewards = availableRewards(_wallet); claimedRewards[_wallet] += rewards; IERC20(rewardToken).safeTransfer(_wallet, rewards); } function availableRewards(address _wallet) public view returns(uint256) { uint256 rewards = 0; (uint256 currentEpoch,,) = getCurrentEpoch(); for (uint256 i=1; i<=stakesCount; i++) { if (stakes[i].staker == _wallet) { if (stakes[i].beginningEpoch < currentEpoch) { for (uint256 j=stakes[i].beginningEpoch; j<currentEpoch; j++) { rewards += getWeight(i, j) * epoch[j].rewardsPerEpoch / 1e18; } } } } return rewards - claimedRewards[_wallet]; } function getLostRewards(uint256 _stakeID) internal view returns(uint256) { return getRewards(_stakeID); } //rewards of current epoch function getRewards(uint256 _stakeID) public view returns(uint256) { (uint256 currentEpoch,,) = getCurrentEpoch(); uint256 rewards = getWeight(_stakeID, currentEpoch) * epoch[currentEpoch].rewardsPerEpoch / 1e18; return rewards; } function boostPosition(uint256 stakeID, uint16 _days) public { require(stakes[stakeID].unstaked == false, "already unstaked"); require(stakes[stakeID].staker == msg.sender, "not stake owner"); require((stakes[stakeID].endDate - stakes[stakeID].startDate + uint256(_days) * 1 days) <= (365 days), "lock period too long"); stakes[stakeID].endDate += uint256(_days) * 1 days; stakes[stakeID].boostPoints = getBoostPoints(uint16((stakes[stakeID].endDate - stakes[stakeID].startDate)/1 days) + _days); emit Boosted(stakeID, stakes[stakeID].endDate); } function getBoostPoints(uint16 _days) public pure returns(uint256) { return Math.CoefficientMath.getBoostPoints(_days); } function getTotalScoreOfEpoch(uint256 epochID) public view returns(uint256) { uint256 epochScore = 0; for (uint256 i=1; i<=stakesCount; i++) { if (stakes[i].beginningEpoch == epochID) { epochScore += stakes[i].amount * stakes[i].boostPoints / 1e18 * stakes[i].reducePoints / 1e18; } if (stakes[i].beginningEpoch < epochID && (stakes[i].unstakedEpoch == 0 || stakes[i].unstakedEpoch > epochID)) { epochScore += stakes[i].amount * stakes[i].boostPoints / 1e18; } } return epochScore; } function getWeight(uint256 stakeID, uint256 epochID) public view returns(uint256) { uint256 weight = 0; uint256 score = 0; uint256 totalScoresOfEpoch = 0; if (stakes[stakeID].unstaked == true) { if (stakes[stakeID].unstakedEpoch == epochID || stakes[stakeID].unstakedEpoch < epochID) { return weight; } } if (stakes[stakeID].beginningEpoch == epochID) { score = stakes[stakeID].amount * stakes[stakeID].boostPoints / 1e18 * stakes[stakeID].reducePoints / 1e18; } if (stakes[stakeID].beginningEpoch < epochID) { score = stakes[stakeID].amount * stakes[stakeID].boostPoints / 1e18; } totalScoresOfEpoch = getTotalScoreOfEpoch(epochID); if (totalScoresOfEpoch == 0) { return weight; } weight = score * 1e18 / totalScoresOfEpoch ; return weight; } function getReductionFactor() public view returns(uint256) { ( , , uint256 currentEpochEnd) = getCurrentEpoch(); return Math.CoefficientMath.getReduceFactor(currentEpochEnd - block.timestamp); } function getCurrentEpoch() public view returns(uint256, uint256, uint256) { uint256 currentEpoch = (block.timestamp - startDate) / epochDuration + 1; uint256 epochStartDate = startDate + (currentEpoch - 1) * epochDuration; uint256 epochEndDate = startDate + currentEpoch * epochDuration; return (currentEpoch, epochStartDate, epochEndDate); } function setTokenPricesContract(address _prices) public onlyOwner { pricesContract = ITokenPrices(_prices); } //for emergency or undistributed rewards function reclaimToken(IERC20 token) public onlyOwner { require(address(token) != address(0)); uint256 balance = token.balanceOf(address(this)); token.transfer(msg.sender, balance); } }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (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. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ 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)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @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. */ abstract 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() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@prb/math/src/Common.sol" as PRB; library CoefficientMath { uint256 public constant boostMultiplier = 1001500000000000000; uint256 public constant reduceFactor = 1110000000000000000; uint256 public constant secondsPerEpoch = 864000; // calculate boost points function getBoostPoints(uint16 _days) external pure returns(uint256) { uint256 boostPoints = boostMultiplier; for (uint256 i = 2; i <= _days; i++) { boostPoints = PRB.mulDiv18(boostPoints, boostMultiplier); } return boostPoints; } function getReduceFactor(uint256 _seconds) public pure returns(uint256) { uint256 exponent = cubicRoot(_seconds); uint256 rFactor = reduceFactor; for (uint256 i = 2; i <= exponent; i++) { rFactor = PRB.mulDiv18(rFactor, reduceFactor); } uint256 exponent2 = cubicRoot(secondsPerEpoch); uint256 rFactor2 = reduceFactor; for (uint256 i = 2; i <= exponent2; i++) { rFactor2 = PRB.mulDiv18(rFactor2, reduceFactor); } return rFactor * 1e18 / rFactor2; } function cubicRoot(uint256 x) internal pure returns (uint256) { uint256 z = (x + 1) / 2; uint256 y = x; while (z < y) { y = z; z = (x / (z * z) + 2 * z) / 3; } return y; } }
// 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); }
// 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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.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 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) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.19; // Common.sol // // Common mathematical functions used in both SD59x18 and UD60x18. Note that these global functions do not // always operate with SD59x18 and UD60x18 numbers. /*////////////////////////////////////////////////////////////////////////// CUSTOM ERRORS //////////////////////////////////////////////////////////////////////////*/ /// @notice Thrown when the resultant value in {mulDiv} overflows uint256. error PRBMath_MulDiv_Overflow(uint256 x, uint256 y, uint256 denominator); /// @notice Thrown when the resultant value in {mulDiv18} overflows uint256. error PRBMath_MulDiv18_Overflow(uint256 x, uint256 y); /// @notice Thrown when one of the inputs passed to {mulDivSigned} is `type(int256).min`. error PRBMath_MulDivSigned_InputTooSmall(); /// @notice Thrown when the resultant value in {mulDivSigned} overflows int256. error PRBMath_MulDivSigned_Overflow(int256 x, int256 y); /*////////////////////////////////////////////////////////////////////////// CONSTANTS //////////////////////////////////////////////////////////////////////////*/ /// @dev The maximum value a uint128 number can have. uint128 constant MAX_UINT128 = type(uint128).max; /// @dev The maximum value a uint40 number can have. uint40 constant MAX_UINT40 = type(uint40).max; /// @dev The maximum value a uint64 number can have. uint64 constant MAX_UINT64 = type(uint64).max; /// @dev The unit number, which the decimal precision of the fixed-point types. uint256 constant UNIT = 1e18; /// @dev The unit number inverted mod 2^256. uint256 constant UNIT_INVERSE = 78156646155174841979727994598816262306175212592076161876661_508869554232690281; /// @dev The the largest power of two that divides the decimal value of `UNIT`. The logarithm of this value is the least significant /// bit in the binary representation of `UNIT`. uint256 constant UNIT_LPOTD = 262144; /*////////////////////////////////////////////////////////////////////////// FUNCTIONS //////////////////////////////////////////////////////////////////////////*/ /// @notice Calculates the binary exponent of x using the binary fraction method. /// @dev Has to use 192.64-bit fixed-point numbers. See https://ethereum.stackexchange.com/a/96594/24693. /// @param x The exponent as an unsigned 192.64-bit fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. /// @custom:smtchecker abstract-function-nondet function exp2(uint256 x) pure returns (uint256 result) { unchecked { // Start from 0.5 in the 192.64-bit fixed-point format. result = 0x800000000000000000000000000000000000000000000000; // The following logic multiplies the result by $\sqrt{2^{-i}}$ when the bit at position i is 1. Key points: // // 1. Intermediate results will not overflow, as the starting point is 2^191 and all magic factors are under 2^65. // 2. The rationale for organizing the if statements into groups of 8 is gas savings. If the result of performing // a bitwise AND operation between x and any value in the array [0x80; 0x40; 0x20; 0x10; 0x08; 0x04; 0x02; 0x01] is 1, // we know that `x & 0xFF` is also 1. if (x & 0xFF00000000000000 > 0) { if (x & 0x8000000000000000 > 0) { result = (result * 0x16A09E667F3BCC909) >> 64; } if (x & 0x4000000000000000 > 0) { result = (result * 0x1306FE0A31B7152DF) >> 64; } if (x & 0x2000000000000000 > 0) { result = (result * 0x1172B83C7D517ADCE) >> 64; } if (x & 0x1000000000000000 > 0) { result = (result * 0x10B5586CF9890F62A) >> 64; } if (x & 0x800000000000000 > 0) { result = (result * 0x1059B0D31585743AE) >> 64; } if (x & 0x400000000000000 > 0) { result = (result * 0x102C9A3E778060EE7) >> 64; } if (x & 0x200000000000000 > 0) { result = (result * 0x10163DA9FB33356D8) >> 64; } if (x & 0x100000000000000 > 0) { result = (result * 0x100B1AFA5ABCBED61) >> 64; } } if (x & 0xFF000000000000 > 0) { if (x & 0x80000000000000 > 0) { result = (result * 0x10058C86DA1C09EA2) >> 64; } if (x & 0x40000000000000 > 0) { result = (result * 0x1002C605E2E8CEC50) >> 64; } if (x & 0x20000000000000 > 0) { result = (result * 0x100162F3904051FA1) >> 64; } if (x & 0x10000000000000 > 0) { result = (result * 0x1000B175EFFDC76BA) >> 64; } if (x & 0x8000000000000 > 0) { result = (result * 0x100058BA01FB9F96D) >> 64; } if (x & 0x4000000000000 > 0) { result = (result * 0x10002C5CC37DA9492) >> 64; } if (x & 0x2000000000000 > 0) { result = (result * 0x1000162E525EE0547) >> 64; } if (x & 0x1000000000000 > 0) { result = (result * 0x10000B17255775C04) >> 64; } } if (x & 0xFF0000000000 > 0) { if (x & 0x800000000000 > 0) { result = (result * 0x1000058B91B5BC9AE) >> 64; } if (x & 0x400000000000 > 0) { result = (result * 0x100002C5C89D5EC6D) >> 64; } if (x & 0x200000000000 > 0) { result = (result * 0x10000162E43F4F831) >> 64; } if (x & 0x100000000000 > 0) { result = (result * 0x100000B1721BCFC9A) >> 64; } if (x & 0x80000000000 > 0) { result = (result * 0x10000058B90CF1E6E) >> 64; } if (x & 0x40000000000 > 0) { result = (result * 0x1000002C5C863B73F) >> 64; } if (x & 0x20000000000 > 0) { result = (result * 0x100000162E430E5A2) >> 64; } if (x & 0x10000000000 > 0) { result = (result * 0x1000000B172183551) >> 64; } } if (x & 0xFF00000000 > 0) { if (x & 0x8000000000 > 0) { result = (result * 0x100000058B90C0B49) >> 64; } if (x & 0x4000000000 > 0) { result = (result * 0x10000002C5C8601CC) >> 64; } if (x & 0x2000000000 > 0) { result = (result * 0x1000000162E42FFF0) >> 64; } if (x & 0x1000000000 > 0) { result = (result * 0x10000000B17217FBB) >> 64; } if (x & 0x800000000 > 0) { result = (result * 0x1000000058B90BFCE) >> 64; } if (x & 0x400000000 > 0) { result = (result * 0x100000002C5C85FE3) >> 64; } if (x & 0x200000000 > 0) { result = (result * 0x10000000162E42FF1) >> 64; } if (x & 0x100000000 > 0) { result = (result * 0x100000000B17217F8) >> 64; } } if (x & 0xFF000000 > 0) { if (x & 0x80000000 > 0) { result = (result * 0x10000000058B90BFC) >> 64; } if (x & 0x40000000 > 0) { result = (result * 0x1000000002C5C85FE) >> 64; } if (x & 0x20000000 > 0) { result = (result * 0x100000000162E42FF) >> 64; } if (x & 0x10000000 > 0) { result = (result * 0x1000000000B17217F) >> 64; } if (x & 0x8000000 > 0) { result = (result * 0x100000000058B90C0) >> 64; } if (x & 0x4000000 > 0) { result = (result * 0x10000000002C5C860) >> 64; } if (x & 0x2000000 > 0) { result = (result * 0x1000000000162E430) >> 64; } if (x & 0x1000000 > 0) { result = (result * 0x10000000000B17218) >> 64; } } if (x & 0xFF0000 > 0) { if (x & 0x800000 > 0) { result = (result * 0x1000000000058B90C) >> 64; } if (x & 0x400000 > 0) { result = (result * 0x100000000002C5C86) >> 64; } if (x & 0x200000 > 0) { result = (result * 0x10000000000162E43) >> 64; } if (x & 0x100000 > 0) { result = (result * 0x100000000000B1721) >> 64; } if (x & 0x80000 > 0) { result = (result * 0x10000000000058B91) >> 64; } if (x & 0x40000 > 0) { result = (result * 0x1000000000002C5C8) >> 64; } if (x & 0x20000 > 0) { result = (result * 0x100000000000162E4) >> 64; } if (x & 0x10000 > 0) { result = (result * 0x1000000000000B172) >> 64; } } if (x & 0xFF00 > 0) { if (x & 0x8000 > 0) { result = (result * 0x100000000000058B9) >> 64; } if (x & 0x4000 > 0) { result = (result * 0x10000000000002C5D) >> 64; } if (x & 0x2000 > 0) { result = (result * 0x1000000000000162E) >> 64; } if (x & 0x1000 > 0) { result = (result * 0x10000000000000B17) >> 64; } if (x & 0x800 > 0) { result = (result * 0x1000000000000058C) >> 64; } if (x & 0x400 > 0) { result = (result * 0x100000000000002C6) >> 64; } if (x & 0x200 > 0) { result = (result * 0x10000000000000163) >> 64; } if (x & 0x100 > 0) { result = (result * 0x100000000000000B1) >> 64; } } if (x & 0xFF > 0) { if (x & 0x80 > 0) { result = (result * 0x10000000000000059) >> 64; } if (x & 0x40 > 0) { result = (result * 0x1000000000000002C) >> 64; } if (x & 0x20 > 0) { result = (result * 0x10000000000000016) >> 64; } if (x & 0x10 > 0) { result = (result * 0x1000000000000000B) >> 64; } if (x & 0x8 > 0) { result = (result * 0x10000000000000006) >> 64; } if (x & 0x4 > 0) { result = (result * 0x10000000000000003) >> 64; } if (x & 0x2 > 0) { result = (result * 0x10000000000000001) >> 64; } if (x & 0x1 > 0) { result = (result * 0x10000000000000001) >> 64; } } // In the code snippet below, two operations are executed simultaneously: // // 1. The result is multiplied by $(2^n + 1)$, where $2^n$ represents the integer part, and the additional 1 // accounts for the initial guess of 0.5. This is achieved by subtracting from 191 instead of 192. // 2. The result is then converted to an unsigned 60.18-decimal fixed-point format. // // The underlying logic is based on the relationship $2^{191-ip} = 2^{ip} / 2^{191}$, where $ip$ denotes the, // integer part, $2^n$. result *= UNIT; result >>= (191 - (x >> 64)); } } /// @notice Finds the zero-based index of the first 1 in the binary representation of x. /// /// @dev See the note on "msb" in this Wikipedia article: https://en.wikipedia.org/wiki/Find_first_set /// /// Each step in this implementation is equivalent to this high-level code: /// /// ```solidity /// if (x >= 2 ** 128) { /// x >>= 128; /// result += 128; /// } /// ``` /// /// Where 128 is replaced with each respective power of two factor. See the full high-level implementation here: /// https://gist.github.com/PaulRBerg/f932f8693f2733e30c4d479e8e980948 /// /// The Yul instructions used below are: /// /// - "gt" is "greater than" /// - "or" is the OR bitwise operator /// - "shl" is "shift left" /// - "shr" is "shift right" /// /// @param x The uint256 number for which to find the index of the most significant bit. /// @return result The index of the most significant bit as a uint256. /// @custom:smtchecker abstract-function-nondet function msb(uint256 x) pure returns (uint256 result) { // 2^128 assembly ("memory-safe") { let factor := shl(7, gt(x, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) x := shr(factor, x) result := or(result, factor) } // 2^64 assembly ("memory-safe") { let factor := shl(6, gt(x, 0xFFFFFFFFFFFFFFFF)) x := shr(factor, x) result := or(result, factor) } // 2^32 assembly ("memory-safe") { let factor := shl(5, gt(x, 0xFFFFFFFF)) x := shr(factor, x) result := or(result, factor) } // 2^16 assembly ("memory-safe") { let factor := shl(4, gt(x, 0xFFFF)) x := shr(factor, x) result := or(result, factor) } // 2^8 assembly ("memory-safe") { let factor := shl(3, gt(x, 0xFF)) x := shr(factor, x) result := or(result, factor) } // 2^4 assembly ("memory-safe") { let factor := shl(2, gt(x, 0xF)) x := shr(factor, x) result := or(result, factor) } // 2^2 assembly ("memory-safe") { let factor := shl(1, gt(x, 0x3)) x := shr(factor, x) result := or(result, factor) } // 2^1 // No need to shift x any more. assembly ("memory-safe") { let factor := gt(x, 0x1) result := or(result, factor) } } /// @notice Calculates x*y÷denominator with 512-bit precision. /// /// @dev Credits to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv. /// /// Notes: /// - The result is rounded toward zero. /// /// Requirements: /// - The denominator must not be zero. /// - The result must fit in uint256. /// /// @param x The multiplicand as a uint256. /// @param y The multiplier as a uint256. /// @param denominator The divisor as a uint256. /// @return result The result as a uint256. /// @custom:smtchecker abstract-function-nondet function mulDiv(uint256 x, uint256 y, uint256 denominator) pure returns (uint256 result) { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512-bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly ("memory-safe") { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { unchecked { return prod0 / denominator; } } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (prod1 >= denominator) { revert PRBMath_MulDiv_Overflow(x, y, denominator); } //////////////////////////////////////////////////////////////////////////// // 512 by 256 division //////////////////////////////////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly ("memory-safe") { // Compute remainder using the mulmod Yul instruction. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512-bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } unchecked { // Calculate the largest power of two divisor of the denominator using the unary operator ~. This operation cannot overflow // because the denominator cannot be zero at this point in the function execution. The result is always >= 1. // For more detail, see https://cs.stackexchange.com/q/138556/92363. uint256 lpotdod = denominator & (~denominator + 1); uint256 flippedLpotdod; assembly ("memory-safe") { // Factor powers of two out of denominator. denominator := div(denominator, lpotdod) // Divide [prod1 prod0] by lpotdod. prod0 := div(prod0, lpotdod) // Get the flipped value `2^256 / lpotdod`. If the `lpotdod` is zero, the flipped value is one. // `sub(0, lpotdod)` produces the two's complement version of `lpotdod`, which is equivalent to flipping all the bits. // However, `div` interprets this value as an unsigned value: https://ethereum.stackexchange.com/q/147168/24693 flippedLpotdod := add(div(sub(0, lpotdod), lpotdod), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * flippedLpotdod; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; } } /// @notice Calculates x*y÷1e18 with 512-bit precision. /// /// @dev A variant of {mulDiv} with constant folding, i.e. in which the denominator is hard coded to 1e18. /// /// Notes: /// - The body is purposely left uncommented; to understand how this works, see the documentation in {mulDiv}. /// - The result is rounded toward zero. /// - We take as an axiom that the result cannot be `MAX_UINT256` when x and y solve the following system of equations: /// /// $$ /// \begin{cases} /// x * y = MAX\_UINT256 * UNIT \\ /// (x * y) \% UNIT \geq \frac{UNIT}{2} /// \end{cases} /// $$ /// /// Requirements: /// - Refer to the requirements in {mulDiv}. /// - The result must fit in uint256. /// /// @param x The multiplicand as an unsigned 60.18-decimal fixed-point number. /// @param y The multiplier as an unsigned 60.18-decimal fixed-point number. /// @return result The result as an unsigned 60.18-decimal fixed-point number. /// @custom:smtchecker abstract-function-nondet function mulDiv18(uint256 x, uint256 y) pure returns (uint256 result) { uint256 prod0; uint256 prod1; assembly ("memory-safe") { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } if (prod1 == 0) { unchecked { return prod0 / UNIT; } } if (prod1 >= UNIT) { revert PRBMath_MulDiv18_Overflow(x, y); } uint256 remainder; assembly ("memory-safe") { remainder := mulmod(x, y, UNIT) result := mul( or( div(sub(prod0, remainder), UNIT_LPOTD), mul(sub(prod1, gt(remainder, prod0)), add(div(sub(0, UNIT_LPOTD), UNIT_LPOTD), 1)) ), UNIT_INVERSE ) } } /// @notice Calculates x*y÷denominator with 512-bit precision. /// /// @dev This is an extension of {mulDiv} for signed numbers, which works by computing the signs and the absolute values separately. /// /// Notes: /// - The result is rounded toward zero. /// /// Requirements: /// - Refer to the requirements in {mulDiv}. /// - None of the inputs can be `type(int256).min`. /// - The result must fit in int256. /// /// @param x The multiplicand as an int256. /// @param y The multiplier as an int256. /// @param denominator The divisor as an int256. /// @return result The result as an int256. /// @custom:smtchecker abstract-function-nondet function mulDivSigned(int256 x, int256 y, int256 denominator) pure returns (int256 result) { if (x == type(int256).min || y == type(int256).min || denominator == type(int256).min) { revert PRBMath_MulDivSigned_InputTooSmall(); } // Get hold of the absolute values of x, y and the denominator. uint256 xAbs; uint256 yAbs; uint256 dAbs; unchecked { xAbs = x < 0 ? uint256(-x) : uint256(x); yAbs = y < 0 ? uint256(-y) : uint256(y); dAbs = denominator < 0 ? uint256(-denominator) : uint256(denominator); } // Compute the absolute value of x*y÷denominator. The result must fit in int256. uint256 resultAbs = mulDiv(xAbs, yAbs, dAbs); if (resultAbs > uint256(type(int256).max)) { revert PRBMath_MulDivSigned_Overflow(x, y); } // Get the signs of x, y and the denominator. uint256 sx; uint256 sy; uint256 sd; assembly ("memory-safe") { // "sgt" is the "signed greater than" assembly instruction and "sub(0,1)" is -1 in two's complement. sx := sgt(x, sub(0, 1)) sy := sgt(y, sub(0, 1)) sd := sgt(denominator, sub(0, 1)) } // XOR over sx, sy and sd. What this does is to check whether there are 1 or 3 negative signs in the inputs. // If there are, the result should be negative. Otherwise, it should be positive. unchecked { result = sx ^ sy ^ sd == 0 ? -int256(resultAbs) : int256(resultAbs); } } /// @notice Calculates the square root of x using the Babylonian method. /// /// @dev See https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method. /// /// Notes: /// - If x is not a perfect square, the result is rounded down. /// - Credits to OpenZeppelin for the explanations in comments below. /// /// @param x The uint256 number for which to calculate the square root. /// @return result The result as a uint256. /// @custom:smtchecker abstract-function-nondet function sqrt(uint256 x) pure returns (uint256 result) { if (x == 0) { return 0; } // For our first guess, we calculate the biggest power of 2 which is smaller than the square root of x. // // We know that the "msb" (most significant bit) of x is a power of 2 such that we have: // // $$ // msb(x) <= x <= 2*msb(x)$ // $$ // // We write $msb(x)$ as $2^k$, and we get: // // $$ // k = log_2(x) // $$ // // Thus, we can write the initial inequality as: // // $$ // 2^{log_2(x)} <= x <= 2*2^{log_2(x)+1} \\ // sqrt(2^k) <= sqrt(x) < sqrt(2^{k+1}) \\ // 2^{k/2} <= sqrt(x) < 2^{(k+1)/2} <= 2^{(k/2)+1} // $$ // // Consequently, $2^{log_2(x) /2} is a good first approximation of sqrt(x) with at least one correct bit. uint256 xAux = uint256(x); result = 1; if (xAux >= 2 ** 128) { xAux >>= 128; result <<= 64; } if (xAux >= 2 ** 64) { xAux >>= 64; result <<= 32; } if (xAux >= 2 ** 32) { xAux >>= 32; result <<= 16; } if (xAux >= 2 ** 16) { xAux >>= 16; result <<= 8; } if (xAux >= 2 ** 8) { xAux >>= 8; result <<= 4; } if (xAux >= 2 ** 4) { xAux >>= 4; result <<= 2; } if (xAux >= 2 ** 2) { result <<= 1; } // At this point, `result` is an estimation with at least one bit of precision. We know the true value has at // most 128 bits, since it is the square root of a uint256. Newton's method converges quadratically (precision // doubles at every iteration). We thus need at most 7 iteration to turn our partial result with one bit of // precision into the expected uint128 result. unchecked { result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; result = (result + x / result) >> 1; // If x is not a perfect square, round the result toward zero. uint256 roundedResult = x / result; if (result >= roundedResult) { result = roundedResult; } } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": { "contracts/libraries/coeffMath.sol": { "CoefficientMath": "0x872cd17541098a397b749f734d31e0f4abd08b10" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_liquidityPool","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_prices","type":"address"},{"internalType":"uint256","name":"_startDate","type":"uint256"},{"internalType":"uint256","name":"_epochPoolLimit","type":"uint256"},{"internalType":"uint256","name":"_epochRewards","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endDate","type":"uint256"}],"name":"Boosted","type":"event"},{"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":false,"internalType":"uint256","name":"stakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startDate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endDate","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"availableRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeID","type":"uint256"},{"internalType":"uint16","name":"_days","type":"uint16"}],"name":"boostPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epoch","outputs":[{"internalType":"uint256","name":"rewardsPerEpoch","type":"uint256"},{"internalType":"uint256","name":"poolLimitPerEpoch","type":"uint256"},{"internalType":"uint256","name":"stakedPerEpoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_days","type":"uint16"}],"name":"getBoostPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTokenPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReductionFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakeID","type":"uint256"}],"name":"getRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epochID","type":"uint256"}],"name":"getTotalScoreOfEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeID","type":"uint256"},{"internalType":"uint256","name":"epochID","type":"uint256"}],"name":"getWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricesContract","outputs":[{"internalType":"contract ITokenPrices","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"reclaimToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsPerEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolLimit","type":"uint256"},{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"setNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_prices","type":"address"}],"name":"setTokenPricesContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint16","name":"_days","type":"uint16"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakedInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"uint256","name":"startDate","type":"uint256"},{"internalType":"uint256","name":"endDate","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"staker","type":"address"},{"internalType":"uint256","name":"boostPoints","type":"uint256"},{"internalType":"uint256","name":"reducePoints","type":"uint256"},{"internalType":"uint256","name":"beginningEpoch","type":"uint256"},{"internalType":"bool","name":"unstaked","type":"bool"},{"internalType":"uint256","name":"unstakedEpoch","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startDate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","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":"stakeID","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_stakeID","type":"uint256"}],"name":"unstakePreview","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052620d2f0060065534801562000017575f80fd5b50604051620039ea380380620039ea83398181016040528101906200003d919062000314565b6200005d62000051620001af60201b60201c565b620001b660201b60201c565b5f8314806200006c5750428310155b62000075575f80fd5b8560015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508460055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f83036200014a574260048190555062000152565b826004819055505b5f60405180606001604052808381526020018481526020015f815250905080600a5f600181526020019081526020015f205f820151815f0155602082015181600101556040820151816002015590505050505050505050620003ac565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f620002a6826200027b565b9050919050565b620002b8816200029a565b8114620002c3575f80fd5b50565b5f81519050620002d681620002ad565b92915050565b5f819050919050565b620002f081620002dc565b8114620002fb575f80fd5b50565b5f815190506200030e81620002e5565b92915050565b5f805f805f8060c0878903121562000331576200033062000277565b5b5f6200034089828a01620002c6565b96505060206200035389828a01620002c6565b95505060406200036689828a01620002c6565b94505060606200037989828a01620002fe565b93505060806200038c89828a01620002fe565b92505060a06200039f89828a01620002fe565b9150509295509295509295565b61363080620003ba5f395ff3fe608060405234801561000f575f80fd5b50600436106101ee575f3560e01c8063817b1cd21161010d578063d5a44f86116100a0578063f2fde38b1161006f578063f2fde38b146105b5578063f7c618c1146105d1578063f854a27f146105ef578063ff35d9af1461061f576101ee565b8063d5a44f8614610527578063e5331f171461055f578063e9b36d511461057d578063ef5cfb8c14610599576101ee565b8063bd834345116100dc578063bd8343451461048d578063c012c22b146104bd578063c0d8012c146104d9578063d59baa0314610509576101ee565b8063817b1cd2146104155780638da5cb5b14610433578063a820103614610451578063b97dd9e21461046d576101ee565b8063360a7f32116101855780635487c577116101545780635487c5771461039d578063665a11ca146103cf5780636939c380146103ed578063715018a61461040b576101ee565b8063360a7f321461032757806342ea02c1146103455780634721563c146103615780634ff0876a1461037f576101ee565b806316650bd2116101c157806316650bd21461028e57806317ffc320146102be5780631d5dd82a146102da5780632e17de781461030b576101ee565b80630b97bc86146101f25780630f39ee72146102105780631387a98f14610240578063147ab0c51461025e575b5f80fd5b6101fa61063d565b6040516102079190612499565b60405180910390f35b61022a600480360381019061022591906124ed565b610643565b6040516102379190612499565b60405180910390f35b610248610804565b6040516102559190612499565b60405180910390f35b6102786004803603810190610273919061252b565b610c41565b6040516102859190612499565b60405180910390f35b6102a860048036038101906102a3919061258d565b610dc2565b6040516102b59190612499565b60405180910390f35b6102d860048036038101906102d39190612623565b610e40565b005b6102f460048036038101906102ef919061252b565b610f7a565b60405161030292919061264e565b60405180910390f35b6103256004803603810190610320919061252b565b610fca565b005b61032f61124a565b60405161033c9190612499565b60405180910390f35b61035f600480360381019061035a9190612675565b611272565b005b6103696115ff565b6040516103769190612499565b60405180910390f35b61038761162d565b6040516103949190612499565b60405180910390f35b6103b760048036038101906103b2919061252b565b611633565b6040516103c6939291906126b3565b60405180910390f35b6103d7611659565b6040516103e491906126f7565b60405180910390f35b6103f561167e565b604051610402919061276b565b60405180910390f35b6104136116a3565b005b61041d6116b6565b60405161042a9190612499565b60405180910390f35b61043b6116bc565b60405161044891906126f7565b60405180910390f35b61046b60048036038101906104669190612675565b6116e3565b005b610475611979565b604051610484939291906126b3565b60405180910390f35b6104a760048036038101906104a291906127ae565b6119ff565b6040516104b49190612499565b60405180910390f35b6104d760048036038101906104d291906124ed565b611a14565b005b6104f360048036038101906104ee919061252b565b611ad8565b6040516105009190612499565b60405180910390f35b610511611b2e565b60405161051e9190612499565b60405180910390f35b610541600480360381019061053c919061252b565b611b57565b604051610556999897969594939291906127f3565b60405180910390f35b610567611bcc565b6040516105749190612499565b60405180910390f35b610597600480360381019061059291906127ae565b611bd2565b005b6105b360048036038101906105ae91906127ae565b611c1d565b005b6105cf60048036038101906105ca91906127ae565b611ccc565b005b6105d9611d4e565b6040516105e691906126f7565b60405180910390f35b610609600480360381019061060491906127ae565b611d73565b6040516106169190612499565b60405180910390f35b610627611efb565b6040516106349190612499565b60405180910390f35b60045481565b5f805f90505f806001151560085f8881526020019081526020015f206007015f9054906101000a900460ff161515036106bc578460085f8881526020019081526020015f206008015414806106ab57508460085f8881526020019081526020015f2060080154105b156106bb578293505050506107fe565b5b8460085f8881526020019081526020015f20600601540361075357670de0b6b3a764000060085f8881526020019081526020015f2060050154670de0b6b3a764000060085f8a81526020019081526020015f206004015460085f8b81526020019081526020015f206002015461073291906128ab565b61073c9190612919565b61074691906128ab565b6107509190612919565b91505b8460085f8881526020019081526020015f206006015410156107b957670de0b6b3a764000060085f8881526020019081526020015f206004015460085f8981526020019081526020015f20600201546107ac91906128ab565b6107b69190612919565b91505b6107c285610c41565b90505f81036107d6578293505050506107fe565b80670de0b6b3a7640000836107eb91906128ab565b6107f59190612919565b92508293505050505b92915050565b5f8060015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638d928af86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610870573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610894919061295d565b90505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338fff2d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610901573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061092591906129bb565b90505f805f808573ffffffffffffffffffffffffffffffffffffffff1663f94d4668866040518263ffffffff1660e01b815260040161096491906129f5565b5f60405180830381865afa15801561097e573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906109a69190612c46565b509150915060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfed246b835f815181106109fb576109fa612cce565b5b60200260200101516040518263ffffffff1660e01b8152600401610a1f91906126f7565b602060405180830381865afa158015610a3a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a5e9190612cfb565b935060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfed246b83600181518110610ab157610ab0612cce565b5b60200260200101516040518263ffffffff1660e01b8152600401610ad591906126f7565b602060405180830381865afa158015610af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b149190612cfb565b92505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ba59190612cfb565b670de0b6b3a76400008084600181518110610bc357610bc2612cce565b5b602002602001015187610bd691906128ab565b610be09190612919565b620f4240855f81518110610bf757610bf6612cce565b5b602002602001015189610c0a91906128ab565b610c149190612919565b610c1e9190612d26565b610c2891906128ab565b610c329190612919565b90508097505050505050505090565b5f805f90505f600190505b6003548111610db8578360085f8381526020019081526020015f206006015403610cf757670de0b6b3a764000060085f8381526020019081526020015f2060050154670de0b6b3a764000060085f8581526020019081526020015f206004015460085f8681526020019081526020015f2060020154610ccb91906128ab565b610cd59190612919565b610cdf91906128ab565b610ce99190612919565b82610cf49190612d26565b91505b8360085f8381526020019081526020015f2060060154108015610d4b57505f60085f8381526020019081526020015f20600801541480610d4a57508360085f8381526020019081526020015f2060080154115b5b15610da557670de0b6b3a764000060085f8381526020019081526020015f206004015460085f8481526020019081526020015f2060020154610d8d91906128ab565b610d979190612919565b82610da29190612d26565b91505b8080610db090612d59565b915050610c4c565b5080915050919050565b5f73872cd17541098a397b749f734d31e0f4abd08b106316650bd2836040518263ffffffff1660e01b8152600401610dfa9190612daf565b602060405180830381865af4158015610e15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e399190612cfb565b9050919050565b610e48611f90565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e7f575f80fd5b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610eb991906126f7565b602060405180830381865afa158015610ed4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ef89190612cfb565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610f35929190612dc8565b6020604051808303815f875af1158015610f51573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f759190612e19565b505050565b5f80610fb860085f8581526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d73565b610fc18461200e565b91509150915091565b5f151560085f8381526020019081526020015f206007015f9054906101000a900460ff16151514611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102790612e9e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1660085f8381526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890612f06565b60405180910390fd5b4260085f8381526020019081526020015f20600101541115611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f90612f6e565b60405180910390fd5b5f611131611979565b5050905060085f8381526020019081526020015f206002015460025f82825461115a9190612f8c565b92505081905550600160085f8481526020019081526020015f206007015f6101000a81548160ff0219169083151502179055508060085f8481526020019081526020015f20600801819055506112063360085f8581526020019081526020015f206002015460015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661201f9092919063ffffffff16565b61120f33611c1d565b7f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b28260405161123e9190612499565b60405180910390a15050565b5f80611254611979565b50509050600a5f8281526020019081526020015f205f015491505090565b6004544210156112b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ae90613009565b60405180910390fd5b60058161ffff1610156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690613071565b60405180910390fd5b61016d8161ffff161115611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133f906130d9565b60405180910390fd5b5f611351610804565b90505f61135c611979565b505090508360025f8282546113719190612d26565b92505081905550600a5f8281526020019081526020015f20600101546113956115ff565b11156113d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cd90613141565b60405180910390fd5b83600a5f8381526020019081526020015f206002015f8282546113f99190612d26565b925050819055505f61140a84610dc2565b90505f604051806101200160405280428152602001620151808761ffff1661143291906128ab565b4261143d9190612d26565b81526020018781526020013373ffffffffffffffffffffffffffffffffffffffff168152602001838152602001611472611efb565b81526020018481526020015f151581526020015f815250905060035f81548092919061149d90612d59565b91905055508060085f60035481526020019081526020015f205f820151815f015560208201518160010155604082015181600201556060820151816003015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015f6101000a81548160ff02191690831515021790555061010082015181600801559050506115b133308860015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120a5909392919063ffffffff16565b7fdba8695183e3f1b4ce564b1f4a4dd836148b716417fc2ffef448202386d7103360035487835f015184602001516040516115ef949392919061315f565b60405180910390a1505050505050565b5f670de0b6b3a7640000611611610804565b60025461161e91906128ab565b6116289190612919565b905090565b60065481565b600a602052805f5260405f205f91509050805f0154908060010154908060020154905083565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116ab611f90565b6116b45f61212e565b565b60025481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f151560085f8481526020019081526020015f206007015f9054906101000a900460ff16151514611749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174090612e9e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1660085f8481526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e190612f06565b60405180910390fd5b6301e13380620151808261ffff1661180291906128ab565b60085f8581526020019081526020015f205f015460085f8681526020019081526020015f20600101546118359190612f8c565b61183f9190612d26565b1115611880576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611877906131ec565b60405180910390fd5b620151808161ffff1661189391906128ab565b60085f8481526020019081526020015f206001015f8282546118b59190612d26565b92505081905550611910816201518060085f8681526020019081526020015f205f015460085f8781526020019081526020015f20600101546118f79190612f8c565b6119019190612919565b61190b919061320a565b610dc2565b60085f8481526020019081526020015f20600401819055507ff4376ca7916fb933e83704a24839eb65cbfdc82f2ab94fd369d427878b20e2dc8260085f8581526020019081526020015f206001015460405161196d92919061264e565b60405180910390a15050565b5f805f806001600654600454426119909190612f8c565b61199a9190612919565b6119a49190612d26565b90505f6006546001836119b79190612f8c565b6119c191906128ab565b6004546119ce9190612d26565b90505f600654836119df91906128ab565b6004546119ec9190612d26565b9050828282955095509550505050909192565b6009602052805f5260405f205f915090505481565b611a1c611f90565b5f611a25611979565b505090505f60405180606001604052808481526020018581526020015f8152509050611a9533308560055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120a5909392919063ffffffff16565b80600a5f600185611aa69190612d26565b81526020019081526020015f205f820151815f0155602082015181600101556040820151816002015590505050505050565b5f80611ae2611979565b505090505f670de0b6b3a7640000600a5f8481526020019081526020015f205f0154611b0e8685610643565b611b1891906128ab565b611b229190612919565b90508092505050919050565b5f80611b38611979565b50509050600a5f8281526020019081526020015f206001015491505090565b6008602052805f5260405f205f91509050805f015490806001015490806002015490806003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806004015490806005015490806006015490806007015f9054906101000a900460ff16908060080154905089565b60035481565b611bda611f90565b8060075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f611c2782611d73565b90508060095f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254611c759190612d26565b92505081905550611cc8828260055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661201f9092919063ffffffff16565b5050565b611cd4611f90565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611d42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d39906132af565b60405180910390fd5b611d4b8161212e565b50565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f805f90505f611d81611979565b505090505f600190505b6003548111611ea8578473ffffffffffffffffffffffffffffffffffffffff1660085f8381526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611e95578160085f8381526020019081526020015f20600601541015611e94575f60085f8381526020019081526020015f206006015490505b82811015611e9257670de0b6b3a7640000600a5f8381526020019081526020015f205f0154611e5e8484610643565b611e6891906128ab565b611e729190612919565b84611e7d9190612d26565b93508080611e8a90612d59565b915050611e2f565b505b5b8080611ea090612d59565b915050611d8b565b5060095f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205482611ef29190612f8c565b92505050919050565b5f80611f05611979565b9250505073872cd17541098a397b749f734d31e0f4abd08b106328dd7d504283611f2f9190612f8c565b6040518263ffffffff1660e01b8152600401611f4b91906132dc565b602060405180830381865af4158015611f66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f8a9190612cfb565b91505090565b611f986121ef565b73ffffffffffffffffffffffffffffffffffffffff16611fb66116bc565b73ffffffffffffffffffffffffffffffffffffffff161461200c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120039061333f565b60405180910390fd5b565b5f61201882611ad8565b9050919050565b6120a08363a9059cbb60e01b848460405160240161203e929190612dc8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121f6565b505050565b612128846323b872dd60e01b8585856040516024016120c69392919061335d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121f6565b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f612257826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166122bc9092919063ffffffff16565b90505f815114806122785750808060200190518101906122779190612e19565b5b6122b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ae90613402565b60405180910390fd5b505050565b60606122ca84845f856122d3565b90509392505050565b606082471015612318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230f90613490565b60405180910390fd5b5f808673ffffffffffffffffffffffffffffffffffffffff168587604051612340919061351a565b5f6040518083038185875af1925050503d805f811461237a576040519150601f19603f3d011682016040523d82523d5f602084013e61237f565b606091505b50915091506123908783838761239c565b92505050949350505050565b606083156123fd575f8351036123f5576123b585612410565b6123f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123eb9061357a565b60405180910390fd5b5b829050612408565b6124078383612432565b5b949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f825111156124445781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247891906135da565b60405180910390fd5b5f819050919050565b61249381612481565b82525050565b5f6020820190506124ac5f83018461248a565b92915050565b5f604051905090565b5f80fd5b5f80fd5b6124cc81612481565b81146124d6575f80fd5b50565b5f813590506124e7816124c3565b92915050565b5f8060408385031215612503576125026124bb565b5b5f612510858286016124d9565b9250506020612521858286016124d9565b9150509250929050565b5f602082840312156125405761253f6124bb565b5b5f61254d848285016124d9565b91505092915050565b5f61ffff82169050919050565b61256c81612556565b8114612576575f80fd5b50565b5f8135905061258781612563565b92915050565b5f602082840312156125a2576125a16124bb565b5b5f6125af84828501612579565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6125e1826125b8565b9050919050565b5f6125f2826125d7565b9050919050565b612602816125e8565b811461260c575f80fd5b50565b5f8135905061261d816125f9565b92915050565b5f60208284031215612638576126376124bb565b5b5f6126458482850161260f565b91505092915050565b5f6040820190506126615f83018561248a565b61266e602083018461248a565b9392505050565b5f806040838503121561268b5761268a6124bb565b5b5f612698858286016124d9565b92505060206126a985828601612579565b9150509250929050565b5f6060820190506126c65f83018661248a565b6126d3602083018561248a565b6126e0604083018461248a565b949350505050565b6126f1816125d7565b82525050565b5f60208201905061270a5f8301846126e8565b92915050565b5f819050919050565b5f61273361272e612729846125b8565b612710565b6125b8565b9050919050565b5f61274482612719565b9050919050565b5f6127558261273a565b9050919050565b6127658161274b565b82525050565b5f60208201905061277e5f83018461275c565b92915050565b61278d816125d7565b8114612797575f80fd5b50565b5f813590506127a881612784565b92915050565b5f602082840312156127c3576127c26124bb565b5b5f6127d08482850161279a565b91505092915050565b5f8115159050919050565b6127ed816127d9565b82525050565b5f610120820190506128075f83018c61248a565b612814602083018b61248a565b612821604083018a61248a565b61282e60608301896126e8565b61283b608083018861248a565b61284860a083018761248a565b61285560c083018661248a565b61286260e08301856127e4565b61287061010083018461248a565b9a9950505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128b582612481565b91506128c083612481565b92508282026128ce81612481565b915082820484148315176128e5576128e461287e565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61292382612481565b915061292e83612481565b92508261293e5761293d6128ec565b5b828204905092915050565b5f8151905061295781612784565b92915050565b5f60208284031215612972576129716124bb565b5b5f61297f84828501612949565b91505092915050565b5f819050919050565b61299a81612988565b81146129a4575f80fd5b50565b5f815190506129b581612991565b92915050565b5f602082840312156129d0576129cf6124bb565b5b5f6129dd848285016129a7565b91505092915050565b6129ef81612988565b82525050565b5f602082019050612a085f8301846129e6565b92915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612a5882612a12565b810181811067ffffffffffffffff82111715612a7757612a76612a22565b5b80604052505050565b5f612a896124b2565b9050612a958282612a4f565b919050565b5f67ffffffffffffffff821115612ab457612ab3612a22565b5b602082029050602081019050919050565b5f80fd5b5f81519050612ad7816125f9565b92915050565b5f612aef612aea84612a9a565b612a80565b90508083825260208201905060208402830185811115612b1257612b11612ac5565b5b835b81811015612b3b5780612b278882612ac9565b845260208401935050602081019050612b14565b5050509392505050565b5f82601f830112612b5957612b58612a0e565b5b8151612b69848260208601612add565b91505092915050565b5f67ffffffffffffffff821115612b8c57612b8b612a22565b5b602082029050602081019050919050565b5f81519050612bab816124c3565b92915050565b5f612bc3612bbe84612b72565b612a80565b90508083825260208201905060208402830185811115612be657612be5612ac5565b5b835b81811015612c0f5780612bfb8882612b9d565b845260208401935050602081019050612be8565b5050509392505050565b5f82601f830112612c2d57612c2c612a0e565b5b8151612c3d848260208601612bb1565b91505092915050565b5f805f60608486031215612c5d57612c5c6124bb565b5b5f84015167ffffffffffffffff811115612c7a57612c796124bf565b5b612c8686828701612b45565b935050602084015167ffffffffffffffff811115612ca757612ca66124bf565b5b612cb386828701612c19565b9250506040612cc486828701612b9d565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215612d1057612d0f6124bb565b5b5f612d1d84828501612b9d565b91505092915050565b5f612d3082612481565b9150612d3b83612481565b9250828201905080821115612d5357612d5261287e565b5b92915050565b5f612d6382612481565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d9557612d9461287e565b5b600182019050919050565b612da981612556565b82525050565b5f602082019050612dc25f830184612da0565b92915050565b5f604082019050612ddb5f8301856126e8565b612de8602083018461248a565b9392505050565b612df8816127d9565b8114612e02575f80fd5b50565b5f81519050612e1381612def565b92915050565b5f60208284031215612e2e57612e2d6124bb565b5b5f612e3b84828501612e05565b91505092915050565b5f82825260208201905092915050565b7f616c726561647920756e7374616b6564000000000000000000000000000000005f82015250565b5f612e88601083612e44565b9150612e9382612e54565b602082019050919050565b5f6020820190508181035f830152612eb581612e7c565b9050919050565b7f6e6f74207374616b65206f776e657200000000000000000000000000000000005f82015250565b5f612ef0600f83612e44565b9150612efb82612ebc565b602082019050919050565b5f6020820190508181035f830152612f1d81612ee4565b9050919050565b7f746f6f206561726c7900000000000000000000000000000000000000000000005f82015250565b5f612f58600983612e44565b9150612f6382612f24565b602082019050919050565b5f6020820190508181035f830152612f8581612f4c565b9050919050565b5f612f9682612481565b9150612fa183612481565b9250828203905081811115612fb957612fb861287e565b5b92915050565b7f7374616b696e672070726f6772616d206e6f74207374617274656400000000005f82015250565b5f612ff3601b83612e44565b9150612ffe82612fbf565b602082019050919050565b5f6020820190508181035f83015261302081612fe7565b9050919050565b7f746f6f2073686f727420706572696f64000000000000000000000000000000005f82015250565b5f61305b601083612e44565b915061306682613027565b602082019050919050565b5f6020820190508181035f8301526130888161304f565b9050919050565b7f746f6f206c6f6e6720706572696f6400000000000000000000000000000000005f82015250565b5f6130c3600f83612e44565b91506130ce8261308f565b602082019050919050565b5f6020820190508181035f8301526130f0816130b7565b9050919050565b7f706f6f6c2069732066756c6c00000000000000000000000000000000000000005f82015250565b5f61312b600c83612e44565b9150613136826130f7565b602082019050919050565b5f6020820190508181035f8301526131588161311f565b9050919050565b5f6080820190506131725f83018761248a565b61317f602083018661248a565b61318c604083018561248a565b613199606083018461248a565b95945050505050565b7f6c6f636b20706572696f6420746f6f206c6f6e670000000000000000000000005f82015250565b5f6131d6601483612e44565b91506131e1826131a2565b602082019050919050565b5f6020820190508181035f830152613203816131ca565b9050919050565b5f61321482612556565b915061321f83612556565b9250828201905061ffff8111156132395761323861287e565b5b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f613299602683612e44565b91506132a48261323f565b604082019050919050565b5f6020820190508181035f8301526132c68161328d565b9050919050565b6132d681612481565b82525050565b5f6020820190506132ef5f8301846132cd565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f613329602083612e44565b9150613334826132f5565b602082019050919050565b5f6020820190508181035f8301526133568161331d565b9050919050565b5f6060820190506133705f8301866126e8565b61337d60208301856126e8565b61338a604083018461248a565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e5f8201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b5f6133ec602a83612e44565b91506133f782613392565b604082019050919050565b5f6020820190508181035f830152613419816133e0565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f5f8201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b5f61347a602683612e44565b915061348582613420565b604082019050919050565b5f6020820190508181035f8301526134a78161346e565b9050919050565b5f81519050919050565b5f81905092915050565b5f5b838110156134df5780820151818401526020810190506134c4565b5f8484015250505050565b5f6134f4826134ae565b6134fe81856134b8565b935061350e8185602086016134c2565b80840191505092915050565b5f61352582846134ea565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000005f82015250565b5f613564601d83612e44565b915061356f82613530565b602082019050919050565b5f6020820190508181035f83015261359181613558565b9050919050565b5f81519050919050565b5f6135ac82613598565b6135b68185612e44565b93506135c68185602086016134c2565b6135cf81612a12565b840191505092915050565b5f6020820190508181035f8301526135f281846135a2565b90509291505056fea2646970667358221220c7700545016090e49d0bb2a9c8b0b616f5a04ff1c41596305e285f48d9cf101464736f6c634300081400330000000000000000000000002b6af1b557c4f81a238a38f1c2dc51cda0ceb45b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005f8d60bc49393a5b1fd159ef7b366a9fd31460640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000174876e8000000000000000000000000000000000000000000000000000000000059c3bc80
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106101ee575f3560e01c8063817b1cd21161010d578063d5a44f86116100a0578063f2fde38b1161006f578063f2fde38b146105b5578063f7c618c1146105d1578063f854a27f146105ef578063ff35d9af1461061f576101ee565b8063d5a44f8614610527578063e5331f171461055f578063e9b36d511461057d578063ef5cfb8c14610599576101ee565b8063bd834345116100dc578063bd8343451461048d578063c012c22b146104bd578063c0d8012c146104d9578063d59baa0314610509576101ee565b8063817b1cd2146104155780638da5cb5b14610433578063a820103614610451578063b97dd9e21461046d576101ee565b8063360a7f32116101855780635487c577116101545780635487c5771461039d578063665a11ca146103cf5780636939c380146103ed578063715018a61461040b576101ee565b8063360a7f321461032757806342ea02c1146103455780634721563c146103615780634ff0876a1461037f576101ee565b806316650bd2116101c157806316650bd21461028e57806317ffc320146102be5780631d5dd82a146102da5780632e17de781461030b576101ee565b80630b97bc86146101f25780630f39ee72146102105780631387a98f14610240578063147ab0c51461025e575b5f80fd5b6101fa61063d565b6040516102079190612499565b60405180910390f35b61022a600480360381019061022591906124ed565b610643565b6040516102379190612499565b60405180910390f35b610248610804565b6040516102559190612499565b60405180910390f35b6102786004803603810190610273919061252b565b610c41565b6040516102859190612499565b60405180910390f35b6102a860048036038101906102a3919061258d565b610dc2565b6040516102b59190612499565b60405180910390f35b6102d860048036038101906102d39190612623565b610e40565b005b6102f460048036038101906102ef919061252b565b610f7a565b60405161030292919061264e565b60405180910390f35b6103256004803603810190610320919061252b565b610fca565b005b61032f61124a565b60405161033c9190612499565b60405180910390f35b61035f600480360381019061035a9190612675565b611272565b005b6103696115ff565b6040516103769190612499565b60405180910390f35b61038761162d565b6040516103949190612499565b60405180910390f35b6103b760048036038101906103b2919061252b565b611633565b6040516103c6939291906126b3565b60405180910390f35b6103d7611659565b6040516103e491906126f7565b60405180910390f35b6103f561167e565b604051610402919061276b565b60405180910390f35b6104136116a3565b005b61041d6116b6565b60405161042a9190612499565b60405180910390f35b61043b6116bc565b60405161044891906126f7565b60405180910390f35b61046b60048036038101906104669190612675565b6116e3565b005b610475611979565b604051610484939291906126b3565b60405180910390f35b6104a760048036038101906104a291906127ae565b6119ff565b6040516104b49190612499565b60405180910390f35b6104d760048036038101906104d291906124ed565b611a14565b005b6104f360048036038101906104ee919061252b565b611ad8565b6040516105009190612499565b60405180910390f35b610511611b2e565b60405161051e9190612499565b60405180910390f35b610541600480360381019061053c919061252b565b611b57565b604051610556999897969594939291906127f3565b60405180910390f35b610567611bcc565b6040516105749190612499565b60405180910390f35b610597600480360381019061059291906127ae565b611bd2565b005b6105b360048036038101906105ae91906127ae565b611c1d565b005b6105cf60048036038101906105ca91906127ae565b611ccc565b005b6105d9611d4e565b6040516105e691906126f7565b60405180910390f35b610609600480360381019061060491906127ae565b611d73565b6040516106169190612499565b60405180910390f35b610627611efb565b6040516106349190612499565b60405180910390f35b60045481565b5f805f90505f806001151560085f8881526020019081526020015f206007015f9054906101000a900460ff161515036106bc578460085f8881526020019081526020015f206008015414806106ab57508460085f8881526020019081526020015f2060080154105b156106bb578293505050506107fe565b5b8460085f8881526020019081526020015f20600601540361075357670de0b6b3a764000060085f8881526020019081526020015f2060050154670de0b6b3a764000060085f8a81526020019081526020015f206004015460085f8b81526020019081526020015f206002015461073291906128ab565b61073c9190612919565b61074691906128ab565b6107509190612919565b91505b8460085f8881526020019081526020015f206006015410156107b957670de0b6b3a764000060085f8881526020019081526020015f206004015460085f8981526020019081526020015f20600201546107ac91906128ab565b6107b69190612919565b91505b6107c285610c41565b90505f81036107d6578293505050506107fe565b80670de0b6b3a7640000836107eb91906128ab565b6107f59190612919565b92508293505050505b92915050565b5f8060015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638d928af86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610870573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610894919061295d565b90505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338fff2d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610901573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061092591906129bb565b90505f805f808573ffffffffffffffffffffffffffffffffffffffff1663f94d4668866040518263ffffffff1660e01b815260040161096491906129f5565b5f60405180830381865afa15801561097e573d5f803e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906109a69190612c46565b509150915060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfed246b835f815181106109fb576109fa612cce565b5b60200260200101516040518263ffffffff1660e01b8152600401610a1f91906126f7565b602060405180830381865afa158015610a3a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a5e9190612cfb565b935060075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfed246b83600181518110610ab157610ab0612cce565b5b60200260200101516040518263ffffffff1660e01b8152600401610ad591906126f7565b602060405180830381865afa158015610af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b149190612cfb565b92505f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ba59190612cfb565b670de0b6b3a76400008084600181518110610bc357610bc2612cce565b5b602002602001015187610bd691906128ab565b610be09190612919565b620f4240855f81518110610bf757610bf6612cce565b5b602002602001015189610c0a91906128ab565b610c149190612919565b610c1e9190612d26565b610c2891906128ab565b610c329190612919565b90508097505050505050505090565b5f805f90505f600190505b6003548111610db8578360085f8381526020019081526020015f206006015403610cf757670de0b6b3a764000060085f8381526020019081526020015f2060050154670de0b6b3a764000060085f8581526020019081526020015f206004015460085f8681526020019081526020015f2060020154610ccb91906128ab565b610cd59190612919565b610cdf91906128ab565b610ce99190612919565b82610cf49190612d26565b91505b8360085f8381526020019081526020015f2060060154108015610d4b57505f60085f8381526020019081526020015f20600801541480610d4a57508360085f8381526020019081526020015f2060080154115b5b15610da557670de0b6b3a764000060085f8381526020019081526020015f206004015460085f8481526020019081526020015f2060020154610d8d91906128ab565b610d979190612919565b82610da29190612d26565b91505b8080610db090612d59565b915050610c4c565b5080915050919050565b5f73872cd17541098a397b749f734d31e0f4abd08b106316650bd2836040518263ffffffff1660e01b8152600401610dfa9190612daf565b602060405180830381865af4158015610e15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e399190612cfb565b9050919050565b610e48611f90565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e7f575f80fd5b5f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610eb991906126f7565b602060405180830381865afa158015610ed4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ef89190612cfb565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401610f35929190612dc8565b6020604051808303815f875af1158015610f51573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f759190612e19565b505050565b5f80610fb860085f8581526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d73565b610fc18461200e565b91509150915091565b5f151560085f8381526020019081526020015f206007015f9054906101000a900460ff16151514611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102790612e9e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1660085f8381526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890612f06565b60405180910390fd5b4260085f8381526020019081526020015f20600101541115611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f90612f6e565b60405180910390fd5b5f611131611979565b5050905060085f8381526020019081526020015f206002015460025f82825461115a9190612f8c565b92505081905550600160085f8481526020019081526020015f206007015f6101000a81548160ff0219169083151502179055508060085f8481526020019081526020015f20600801819055506112063360085f8581526020019081526020015f206002015460015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661201f9092919063ffffffff16565b61120f33611c1d565b7f11725367022c3ff288940f4b5473aa61c2da6a24af7363a1128ee2401e8983b28260405161123e9190612499565b60405180910390a15050565b5f80611254611979565b50509050600a5f8281526020019081526020015f205f015491505090565b6004544210156112b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ae90613009565b60405180910390fd5b60058161ffff1610156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690613071565b60405180910390fd5b61016d8161ffff161115611348576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133f906130d9565b60405180910390fd5b5f611351610804565b90505f61135c611979565b505090508360025f8282546113719190612d26565b92505081905550600a5f8281526020019081526020015f20600101546113956115ff565b11156113d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cd90613141565b60405180910390fd5b83600a5f8381526020019081526020015f206002015f8282546113f99190612d26565b925050819055505f61140a84610dc2565b90505f604051806101200160405280428152602001620151808761ffff1661143291906128ab565b4261143d9190612d26565b81526020018781526020013373ffffffffffffffffffffffffffffffffffffffff168152602001838152602001611472611efb565b81526020018481526020015f151581526020015f815250905060035f81548092919061149d90612d59565b91905055508060085f60035481526020019081526020015f205f820151815f015560208201518160010155604082015181600201556060820151816003015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015f6101000a81548160ff02191690831515021790555061010082015181600801559050506115b133308860015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120a5909392919063ffffffff16565b7fdba8695183e3f1b4ce564b1f4a4dd836148b716417fc2ffef448202386d7103360035487835f015184602001516040516115ef949392919061315f565b60405180910390a1505050505050565b5f670de0b6b3a7640000611611610804565b60025461161e91906128ab565b6116289190612919565b905090565b60065481565b600a602052805f5260405f205f91509050805f0154908060010154908060020154905083565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116ab611f90565b6116b45f61212e565b565b60025481565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b5f151560085f8481526020019081526020015f206007015f9054906101000a900460ff16151514611749576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174090612e9e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff1660085f8481526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e190612f06565b60405180910390fd5b6301e13380620151808261ffff1661180291906128ab565b60085f8581526020019081526020015f205f015460085f8681526020019081526020015f20600101546118359190612f8c565b61183f9190612d26565b1115611880576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611877906131ec565b60405180910390fd5b620151808161ffff1661189391906128ab565b60085f8481526020019081526020015f206001015f8282546118b59190612d26565b92505081905550611910816201518060085f8681526020019081526020015f205f015460085f8781526020019081526020015f20600101546118f79190612f8c565b6119019190612919565b61190b919061320a565b610dc2565b60085f8481526020019081526020015f20600401819055507ff4376ca7916fb933e83704a24839eb65cbfdc82f2ab94fd369d427878b20e2dc8260085f8581526020019081526020015f206001015460405161196d92919061264e565b60405180910390a15050565b5f805f806001600654600454426119909190612f8c565b61199a9190612919565b6119a49190612d26565b90505f6006546001836119b79190612f8c565b6119c191906128ab565b6004546119ce9190612d26565b90505f600654836119df91906128ab565b6004546119ec9190612d26565b9050828282955095509550505050909192565b6009602052805f5260405f205f915090505481565b611a1c611f90565b5f611a25611979565b505090505f60405180606001604052808481526020018581526020015f8152509050611a9533308560055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120a5909392919063ffffffff16565b80600a5f600185611aa69190612d26565b81526020019081526020015f205f820151815f0155602082015181600101556040820151816002015590505050505050565b5f80611ae2611979565b505090505f670de0b6b3a7640000600a5f8481526020019081526020015f205f0154611b0e8685610643565b611b1891906128ab565b611b229190612919565b90508092505050919050565b5f80611b38611979565b50509050600a5f8281526020019081526020015f206001015491505090565b6008602052805f5260405f205f91509050805f015490806001015490806002015490806003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806004015490806005015490806006015490806007015f9054906101000a900460ff16908060080154905089565b60035481565b611bda611f90565b8060075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f611c2782611d73565b90508060095f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254611c759190612d26565b92505081905550611cc8828260055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661201f9092919063ffffffff16565b5050565b611cd4611f90565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611d42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d39906132af565b60405180910390fd5b611d4b8161212e565b50565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f805f90505f611d81611979565b505090505f600190505b6003548111611ea8578473ffffffffffffffffffffffffffffffffffffffff1660085f8381526020019081526020015f206003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603611e95578160085f8381526020019081526020015f20600601541015611e94575f60085f8381526020019081526020015f206006015490505b82811015611e9257670de0b6b3a7640000600a5f8381526020019081526020015f205f0154611e5e8484610643565b611e6891906128ab565b611e729190612919565b84611e7d9190612d26565b93508080611e8a90612d59565b915050611e2f565b505b5b8080611ea090612d59565b915050611d8b565b5060095f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205482611ef29190612f8c565b92505050919050565b5f80611f05611979565b9250505073872cd17541098a397b749f734d31e0f4abd08b106328dd7d504283611f2f9190612f8c565b6040518263ffffffff1660e01b8152600401611f4b91906132dc565b602060405180830381865af4158015611f66573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f8a9190612cfb565b91505090565b611f986121ef565b73ffffffffffffffffffffffffffffffffffffffff16611fb66116bc565b73ffffffffffffffffffffffffffffffffffffffff161461200c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120039061333f565b60405180910390fd5b565b5f61201882611ad8565b9050919050565b6120a08363a9059cbb60e01b848460405160240161203e929190612dc8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121f6565b505050565b612128846323b872dd60e01b8585856040516024016120c69392919061335d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121f6565b50505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f612257826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166122bc9092919063ffffffff16565b90505f815114806122785750808060200190518101906122779190612e19565b5b6122b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122ae90613402565b60405180910390fd5b505050565b60606122ca84845f856122d3565b90509392505050565b606082471015612318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230f90613490565b60405180910390fd5b5f808673ffffffffffffffffffffffffffffffffffffffff168587604051612340919061351a565b5f6040518083038185875af1925050503d805f811461237a576040519150601f19603f3d011682016040523d82523d5f602084013e61237f565b606091505b50915091506123908783838761239c565b92505050949350505050565b606083156123fd575f8351036123f5576123b585612410565b6123f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123eb9061357a565b60405180910390fd5b5b829050612408565b6124078383612432565b5b949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f825111156124445781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247891906135da565b60405180910390fd5b5f819050919050565b61249381612481565b82525050565b5f6020820190506124ac5f83018461248a565b92915050565b5f604051905090565b5f80fd5b5f80fd5b6124cc81612481565b81146124d6575f80fd5b50565b5f813590506124e7816124c3565b92915050565b5f8060408385031215612503576125026124bb565b5b5f612510858286016124d9565b9250506020612521858286016124d9565b9150509250929050565b5f602082840312156125405761253f6124bb565b5b5f61254d848285016124d9565b91505092915050565b5f61ffff82169050919050565b61256c81612556565b8114612576575f80fd5b50565b5f8135905061258781612563565b92915050565b5f602082840312156125a2576125a16124bb565b5b5f6125af84828501612579565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6125e1826125b8565b9050919050565b5f6125f2826125d7565b9050919050565b612602816125e8565b811461260c575f80fd5b50565b5f8135905061261d816125f9565b92915050565b5f60208284031215612638576126376124bb565b5b5f6126458482850161260f565b91505092915050565b5f6040820190506126615f83018561248a565b61266e602083018461248a565b9392505050565b5f806040838503121561268b5761268a6124bb565b5b5f612698858286016124d9565b92505060206126a985828601612579565b9150509250929050565b5f6060820190506126c65f83018661248a565b6126d3602083018561248a565b6126e0604083018461248a565b949350505050565b6126f1816125d7565b82525050565b5f60208201905061270a5f8301846126e8565b92915050565b5f819050919050565b5f61273361272e612729846125b8565b612710565b6125b8565b9050919050565b5f61274482612719565b9050919050565b5f6127558261273a565b9050919050565b6127658161274b565b82525050565b5f60208201905061277e5f83018461275c565b92915050565b61278d816125d7565b8114612797575f80fd5b50565b5f813590506127a881612784565b92915050565b5f602082840312156127c3576127c26124bb565b5b5f6127d08482850161279a565b91505092915050565b5f8115159050919050565b6127ed816127d9565b82525050565b5f610120820190506128075f83018c61248a565b612814602083018b61248a565b612821604083018a61248a565b61282e60608301896126e8565b61283b608083018861248a565b61284860a083018761248a565b61285560c083018661248a565b61286260e08301856127e4565b61287061010083018461248a565b9a9950505050505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6128b582612481565b91506128c083612481565b92508282026128ce81612481565b915082820484148315176128e5576128e461287e565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61292382612481565b915061292e83612481565b92508261293e5761293d6128ec565b5b828204905092915050565b5f8151905061295781612784565b92915050565b5f60208284031215612972576129716124bb565b5b5f61297f84828501612949565b91505092915050565b5f819050919050565b61299a81612988565b81146129a4575f80fd5b50565b5f815190506129b581612991565b92915050565b5f602082840312156129d0576129cf6124bb565b5b5f6129dd848285016129a7565b91505092915050565b6129ef81612988565b82525050565b5f602082019050612a085f8301846129e6565b92915050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b612a5882612a12565b810181811067ffffffffffffffff82111715612a7757612a76612a22565b5b80604052505050565b5f612a896124b2565b9050612a958282612a4f565b919050565b5f67ffffffffffffffff821115612ab457612ab3612a22565b5b602082029050602081019050919050565b5f80fd5b5f81519050612ad7816125f9565b92915050565b5f612aef612aea84612a9a565b612a80565b90508083825260208201905060208402830185811115612b1257612b11612ac5565b5b835b81811015612b3b5780612b278882612ac9565b845260208401935050602081019050612b14565b5050509392505050565b5f82601f830112612b5957612b58612a0e565b5b8151612b69848260208601612add565b91505092915050565b5f67ffffffffffffffff821115612b8c57612b8b612a22565b5b602082029050602081019050919050565b5f81519050612bab816124c3565b92915050565b5f612bc3612bbe84612b72565b612a80565b90508083825260208201905060208402830185811115612be657612be5612ac5565b5b835b81811015612c0f5780612bfb8882612b9d565b845260208401935050602081019050612be8565b5050509392505050565b5f82601f830112612c2d57612c2c612a0e565b5b8151612c3d848260208601612bb1565b91505092915050565b5f805f60608486031215612c5d57612c5c6124bb565b5b5f84015167ffffffffffffffff811115612c7a57612c796124bf565b5b612c8686828701612b45565b935050602084015167ffffffffffffffff811115612ca757612ca66124bf565b5b612cb386828701612c19565b9250506040612cc486828701612b9d565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215612d1057612d0f6124bb565b5b5f612d1d84828501612b9d565b91505092915050565b5f612d3082612481565b9150612d3b83612481565b9250828201905080821115612d5357612d5261287e565b5b92915050565b5f612d6382612481565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d9557612d9461287e565b5b600182019050919050565b612da981612556565b82525050565b5f602082019050612dc25f830184612da0565b92915050565b5f604082019050612ddb5f8301856126e8565b612de8602083018461248a565b9392505050565b612df8816127d9565b8114612e02575f80fd5b50565b5f81519050612e1381612def565b92915050565b5f60208284031215612e2e57612e2d6124bb565b5b5f612e3b84828501612e05565b91505092915050565b5f82825260208201905092915050565b7f616c726561647920756e7374616b6564000000000000000000000000000000005f82015250565b5f612e88601083612e44565b9150612e9382612e54565b602082019050919050565b5f6020820190508181035f830152612eb581612e7c565b9050919050565b7f6e6f74207374616b65206f776e657200000000000000000000000000000000005f82015250565b5f612ef0600f83612e44565b9150612efb82612ebc565b602082019050919050565b5f6020820190508181035f830152612f1d81612ee4565b9050919050565b7f746f6f206561726c7900000000000000000000000000000000000000000000005f82015250565b5f612f58600983612e44565b9150612f6382612f24565b602082019050919050565b5f6020820190508181035f830152612f8581612f4c565b9050919050565b5f612f9682612481565b9150612fa183612481565b9250828203905081811115612fb957612fb861287e565b5b92915050565b7f7374616b696e672070726f6772616d206e6f74207374617274656400000000005f82015250565b5f612ff3601b83612e44565b9150612ffe82612fbf565b602082019050919050565b5f6020820190508181035f83015261302081612fe7565b9050919050565b7f746f6f2073686f727420706572696f64000000000000000000000000000000005f82015250565b5f61305b601083612e44565b915061306682613027565b602082019050919050565b5f6020820190508181035f8301526130888161304f565b9050919050565b7f746f6f206c6f6e6720706572696f6400000000000000000000000000000000005f82015250565b5f6130c3600f83612e44565b91506130ce8261308f565b602082019050919050565b5f6020820190508181035f8301526130f0816130b7565b9050919050565b7f706f6f6c2069732066756c6c00000000000000000000000000000000000000005f82015250565b5f61312b600c83612e44565b9150613136826130f7565b602082019050919050565b5f6020820190508181035f8301526131588161311f565b9050919050565b5f6080820190506131725f83018761248a565b61317f602083018661248a565b61318c604083018561248a565b613199606083018461248a565b95945050505050565b7f6c6f636b20706572696f6420746f6f206c6f6e670000000000000000000000005f82015250565b5f6131d6601483612e44565b91506131e1826131a2565b602082019050919050565b5f6020820190508181035f830152613203816131ca565b9050919050565b5f61321482612556565b915061321f83612556565b9250828201905061ffff8111156132395761323861287e565b5b92915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f613299602683612e44565b91506132a48261323f565b604082019050919050565b5f6020820190508181035f8301526132c68161328d565b9050919050565b6132d681612481565b82525050565b5f6020820190506132ef5f8301846132cd565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f613329602083612e44565b9150613334826132f5565b602082019050919050565b5f6020820190508181035f8301526133568161331d565b9050919050565b5f6060820190506133705f8301866126e8565b61337d60208301856126e8565b61338a604083018461248a565b949350505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e5f8201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b5f6133ec602a83612e44565b91506133f782613392565b604082019050919050565b5f6020820190508181035f830152613419816133e0565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f5f8201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b5f61347a602683612e44565b915061348582613420565b604082019050919050565b5f6020820190508181035f8301526134a78161346e565b9050919050565b5f81519050919050565b5f81905092915050565b5f5b838110156134df5780820151818401526020810190506134c4565b5f8484015250505050565b5f6134f4826134ae565b6134fe81856134b8565b935061350e8185602086016134c2565b80840191505092915050565b5f61352582846134ea565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000005f82015250565b5f613564601d83612e44565b915061356f82613530565b602082019050919050565b5f6020820190508181035f83015261359181613558565b9050919050565b5f81519050919050565b5f6135ac82613598565b6135b68185612e44565b93506135c68185602086016134c2565b6135cf81612a12565b840191505092915050565b5f6020820190508181035f8301526135f281846135a2565b90509291505056fea2646970667358221220c7700545016090e49d0bb2a9c8b0b616f5a04ff1c41596305e285f48d9cf101464736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002b6af1b557c4f81a238a38f1c2dc51cda0ceb45b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000005f8d60bc49393a5b1fd159ef7b366a9fd31460640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000174876e8000000000000000000000000000000000000000000000000000000000059c3bc80
-----Decoded View---------------
Arg [0] : _liquidityPool (address): 0x2b6Af1B557c4f81A238a38f1C2DC51Cda0cEb45b
Arg [1] : _rewardToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _prices (address): 0x5F8D60BC49393a5B1fD159eF7b366A9Fd3146064
Arg [3] : _startDate (uint256): 0
Arg [4] : _epochPoolLimit (uint256): 100000000000
Arg [5] : _epochRewards (uint256): 1506000000
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000002b6af1b557c4f81a238a38f1c2dc51cda0ceb45b
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 0000000000000000000000005f8d60bc49393a5b1fd159ef7b366a9fd3146064
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 000000000000000000000000000000000000000000000000000000174876e800
Arg [5] : 0000000000000000000000000000000000000000000000000000000059c3bc80
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.999754 | 2,875.9008 | $2,875.19 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.