More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,858 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Eth | 21584077 | 29 hrs ago | IN | 0 ETH | 0.00045321 | ||||
Cache | 21568142 | 3 days ago | IN | 0 ETH | 0.00306372 | ||||
Claim Eth | 21566493 | 3 days ago | IN | 0 ETH | 0.00242011 | ||||
Claim Eth | 21560999 | 4 days ago | IN | 0 ETH | 0.00057915 | ||||
Claim Eth And Pr... | 21553273 | 5 days ago | IN | 0 ETH | 0.00093633 | ||||
Claim Eth | 21546114 | 6 days ago | IN | 0 ETH | 0.00120113 | ||||
Withdraw | 21539518 | 7 days ago | IN | 0 ETH | 0.00125453 | ||||
Claim Eth | 21531750 | 8 days ago | IN | 0 ETH | 0.00224024 | ||||
Claim Eth | 21502922 | 12 days ago | IN | 0 ETH | 0.00045688 | ||||
Claim Eth | 21489717 | 14 days ago | IN | 0 ETH | 0.0003791 | ||||
Claim Eth | 21488110 | 14 days ago | IN | 0 ETH | 0.00070495 | ||||
Cache | 21476238 | 16 days ago | IN | 0 ETH | 0.00066764 | ||||
Claim Eth | 21475663 | 16 days ago | IN | 0 ETH | 0.00026512 | ||||
Withdraw | 21470265 | 17 days ago | IN | 0 ETH | 0.0007718 | ||||
Withdraw | 21470263 | 17 days ago | IN | 0 ETH | 0.00073676 | ||||
Claim Eth | 21425125 | 23 days ago | IN | 0 ETH | 0.001412 | ||||
Claim Eth | 21425083 | 23 days ago | IN | 0 ETH | 0.00127447 | ||||
Cache | 21416150 | 24 days ago | IN | 0 ETH | 0.00442869 | ||||
Withdraw | 21403440 | 26 days ago | IN | 0 ETH | 0.00111902 | ||||
Claim Eth And Pr... | 21403425 | 26 days ago | IN | 0 ETH | 0.00101009 | ||||
Claim Eth | 21399318 | 27 days ago | IN | 0 ETH | 0.0007245 | ||||
Withdraw | 21390101 | 28 days ago | IN | 0 ETH | 0.00171433 | ||||
Claim Eth | 21390095 | 28 days ago | IN | 0 ETH | 0.00103044 | ||||
Cache | 21389155 | 28 days ago | IN | 0 ETH | 0.00355974 | ||||
Withdraw | 21389012 | 28 days ago | IN | 0 ETH | 0.00305538 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21584077 | 29 hrs ago | 0.01091083 ETH | ||||
21566493 | 3 days ago | 0.01126037 ETH | ||||
21560999 | 4 days ago | 0.00984332 ETH | ||||
21553273 | 5 days ago | 0.03466462 ETH | ||||
21546114 | 6 days ago | 0.01012769 ETH | ||||
21531750 | 8 days ago | 0.02108398 ETH | ||||
21502922 | 12 days ago | 0.00000011 ETH | ||||
21489717 | 14 days ago | 0.01255223 ETH | ||||
21488110 | 14 days ago | 0.02056596 ETH | ||||
21475663 | 16 days ago | 0.00577046 ETH | ||||
21425125 | 23 days ago | 0.00635199 ETH | ||||
21425083 | 23 days ago | 0.01126037 ETH | ||||
21403425 | 26 days ago | 0.01256001 ETH | ||||
21399318 | 27 days ago | 0.0112565 ETH | ||||
21390095 | 28 days ago | 0.07882261 ETH | ||||
21341065 | 35 days ago | 0.01072112 ETH | ||||
21335599 | 35 days ago | 0.01126037 ETH | ||||
21322973 | 37 days ago | 0.01126037 ETH | ||||
21314553 | 38 days ago | 0.03574424 ETH | ||||
21294543 | 41 days ago | 0.02252074 ETH | ||||
21292176 | 42 days ago | 0.01022669 ETH | ||||
21280826 | 43 days ago | 0.00760195 ETH | ||||
21274340 | 44 days ago | 0.02814114 ETH | ||||
21209492 | 53 days ago | 0.01126037 ETH | ||||
21203296 | 54 days ago | 0.01126037 ETH |
Loading...
Loading
Contract Name:
EthAndPrimeRewards
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "./PrimeRewards.sol"; /// @title The EthAndPrimeRewards caching contract /// @notice Caching contract for The Core. It allows for fixed ETH /// rewards distributed evenly across all cached tokens per second. contract EthAndPrimeRewards is PrimeRewards { using SafeERC20 for IERC20; using SafeCast for uint256; using SafeCast for int256; /// @notice Info of each Cache. /// `rewardDebt` The amount of ETH not entitled to the user. struct EthCacheInfo { int256 rewardDebt; } /// @notice Info of each ethPool. EthPoolInfo is independent of PoolInfo. /// Contains the start and end timestamps of the rewards struct EthPoolInfo { uint256 accEthPerShare; // The amount of accumulated ETH per share in wei uint256 allocPoint; // share of the contract's per second rewards to that pool uint256 lastRewardTimestamp; // last time stamp at which rewards were assigned } /// @notice Info of each ethPool. EthPoolInfo[] public ethPoolInfo; /// @notice Eth amount distributed for given period. ethAmountPerSecond = ethAmount / (ethEndTimestamp - ethStartTimestamp) uint256 public ethStartTimestamp; // caching start timestamp. uint256 public ethEndTimestamp; // caching end timestamp. uint256 public ethAmount; // the amount of ETH to give out as rewards. uint256 public ethAmountPerSecond; // the amount of ETH to give out as rewards per second. uint256 public constant ethAmountPerSecondPrecision = 1e18; // ethAmountPerSecond is carried around with extra precision to reduce rounding errors /// @dev Total allocation points. Must be the sum of all allocation points (i.e. multipliers) in all ethPools. uint256 public ethTotalAllocPoint; /// @notice Cache info of each user that caches NFT sets. // ethPoolID(per set) => user address => cache info mapping(uint256 => mapping(address => EthCacheInfo)) public ethCacheInfo; /// @param _prime The PRIME token contract address. /// @param _parallelAlpha The Parallel Alpha contract address. constructor(IERC20 _prime, IERC1155 _parallelAlpha) PrimeRewards(_prime, _parallelAlpha) {} /// @notice Add a new tokenIds ethPool. Only owner. /// DO NOT add the same token id more than once or rewards will be inaccurate. /// @param _allocPoint Allocation Point (i.e. multiplier) of the new ethPool. /// @param _tokenIds TokenIds for a ParallelAlpha ERC1155 tokens. function addPool(uint256 _allocPoint, uint256[] memory _tokenIds) public override onlyOwner { // Update all pool information before adding the AllocPoint for new pool for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); } ethTotalAllocPoint += _allocPoint; ethPoolInfo.push( EthPoolInfo({ accEthPerShare: 0, allocPoint: _allocPoint, lastRewardTimestamp: Math.max( block.timestamp, ethStartTimestamp ) }) ); PrimeRewards.addPool(_allocPoint, _tokenIds); emit LogPoolSetAllocPoint( ethPoolInfo.length - 1, _allocPoint, ethTotalAllocPoint, ID_ETH ); } /// @notice Set new period to distribute rewards between ethStartTimestamp and ethEndTimestamp /// evenly per second. ethAmountPerSecond = msg.value / (_ethEndTimestamp - _ethStartTimestamp) /// Can only be set once any existing setEthPerSecond regime has concluded (ethEndTimestamp < block.timestamp) /// @param _ethStartTimestamp Timestamp for caching period start /// @param _ethEndTimestamp Timestamp for caching period end function setEthPerSecond( uint256 _ethStartTimestamp, uint256 _ethEndTimestamp ) external payable onlyOwner { require( _ethStartTimestamp < _ethEndTimestamp, "endTimestamp cant be less than startTimestamp" ); require( block.timestamp < ethStartTimestamp || ethEndTimestamp < block.timestamp, "Only updates after ethEndTimestamp or before ethStartTimestamp" ); // Update all ethPools, ensure rewards are calculated up to this timestamp for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); ethPoolInfo[i].lastRewardTimestamp = _ethStartTimestamp; } ethAmount = msg.value; ethStartTimestamp = _ethStartTimestamp; ethEndTimestamp = _ethEndTimestamp; ethAmountPerSecond = (msg.value * ethAmountPerSecondPrecision) / (_ethEndTimestamp - _ethStartTimestamp); emit LogSetPerSecond( msg.value, _ethStartTimestamp, _ethEndTimestamp, ID_ETH ); } /// @notice Update ethEndTimestamp, only possible to call this when caching for /// a period has already begun. New ethEndTimestamp can't be in the past /// @param _ethEndTimestamp New timestamp for caching period to end at function setEthEndTimestamp(uint256 _ethEndTimestamp) external onlyOwner { require( ethStartTimestamp < block.timestamp, "Caching period has not started" ); require(block.timestamp < _ethEndTimestamp, "invalid end timestamp"); for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); } // Update ethAmountPerSecond based on new ethEndTimestamp ethStartTimestamp = block.timestamp; ethEndTimestamp = _ethEndTimestamp; ethAmountPerSecond = (ethAmount * ethAmountPerSecondPrecision) / (ethEndTimestamp - ethStartTimestamp); emit EndTimestampUpdated(_ethEndTimestamp, ID_ETH); } /// @notice Function for 'Top Ups', adds additional ETH to distribute for remaining time /// in the period. function addEthAmount() external payable onlyOwner { require( ethStartTimestamp < block.timestamp && block.timestamp < ethEndTimestamp, "Can only addEthAmount during period" ); // Update all ethPools for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); } // Top up current period's ETH ethAmount += msg.value; ethAmountPerSecond = (ethAmount * ethAmountPerSecondPrecision) / (ethEndTimestamp - block.timestamp); emit RewardIncrease(msg.value, ID_ETH); } /// @notice Function for 'Top Downs', removes additional ETH to distribute for remaining time /// in the period. /// @param _removeEthAmount Amount of ETH to remove from the remaining reward pool function removeEthAmount(uint256 _removeEthAmount) external onlyOwner { require( ethStartTimestamp < block.timestamp && block.timestamp < ethEndTimestamp, "Can only removeEthAmount during period" ); // Update all ethPools for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); } // Top up current period's ETH _removeEthAmount = Math.min(_removeEthAmount, ethAmount); ethAmount -= _removeEthAmount; ethAmountPerSecond = (ethAmount * ethAmountPerSecondPrecision) / (ethEndTimestamp - block.timestamp); (bool sent, ) = msg.sender.call{ value: _removeEthAmount }(""); require(sent, "Failed to send Ether"); emit RewardDecrease(_removeEthAmount, ID_ETH); } /// @notice Update the given ethPool's ETH allocation point. Only owner. /// @param _pid The index of the ethPool. See `ethPoolInfo`. /// @param _allocPoint New Allocation Point (i.e. multiplier) of the ethPool. function setEthPoolAllocPoint(uint256 _pid, uint256 _allocPoint) external onlyOwner { // Update all ethPools for (uint256 i = 0; i < ethPoolInfo.length; ++i) { updateEthPool(i); } ethTotalAllocPoint = ethTotalAllocPoint - ethPoolInfo[_pid].allocPoint + _allocPoint; ethPoolInfo[_pid].allocPoint = _allocPoint; emit LogPoolSetAllocPoint( _pid, _allocPoint, ethTotalAllocPoint, ID_ETH ); } /// @notice View function to see pending ETH on frontend. /// @param _pid The index of the ethPool. See `ethPoolInfo`. /// @param _user Address of user. /// @return pending ETH reward for a given user. function pendingEth(uint256 _pid, address _user) external view returns (uint256 pending) { PoolInfo memory pool = poolInfo[_pid]; CacheInfo storage cache_ = cacheInfo[_pid][_user]; EthPoolInfo memory ethPool = ethPoolInfo[_pid]; EthCacheInfo storage ethCache = ethCacheInfo[_pid][_user]; uint256 accEthPerShare = ethPool.accEthPerShare; uint256 totalSupply = pool.totalSupply; if ( ethStartTimestamp <= block.timestamp && ethPool.lastRewardTimestamp < block.timestamp && totalSupply > 0 ) { uint256 updateToTimestamp = Math.min( block.timestamp, ethEndTimestamp ); uint256 seconds_ = updateToTimestamp - ethPool.lastRewardTimestamp; uint256 ethReward = (seconds_ * ethAmountPerSecond * ethPool.allocPoint) / ethTotalAllocPoint; accEthPerShare += ethReward / totalSupply; } pending = ((cache_.amount * accEthPerShare).toInt256() - ethCache.rewardDebt) .toUint256() / ethAmountPerSecondPrecision; } /// @notice Update reward variables for all ethPools. Be careful of gas required. /// @param _pids Pool IDs of all to be updated. Update all active ethPools. function massUpdateEthPools(uint256[] calldata _pids) external { uint256 len = _pids.length; for (uint256 i = 0; i < len; ++i) { updateEthPool(_pids[i]); } } /// @notice Update reward variables of the given ethPool. /// @param _pid The index of the ethPool. See `ethPoolInfo`. function updateEthPool(uint256 _pid) public { PoolInfo memory pool = poolInfo[_pid]; EthPoolInfo storage ethPool = ethPoolInfo[_pid]; uint256 totalSupply = pool.totalSupply; if ( ethStartTimestamp > block.timestamp || ethPool.lastRewardTimestamp >= block.timestamp || (ethStartTimestamp == 0 && ethEndTimestamp == 0) ) { return; } uint256 updateToTimestamp = Math.min(block.timestamp, ethEndTimestamp); uint256 seconds_ = updateToTimestamp - ethPool.lastRewardTimestamp; uint256 ethReward = (seconds_ * ethAmountPerSecond * ethPool.allocPoint) / ethTotalAllocPoint; ethAmount -= ethReward / ethAmountPerSecondPrecision; if (totalSupply > 0) { ethPool.accEthPerShare += ethReward / totalSupply; } ethPool.lastRewardTimestamp = updateToTimestamp; emit LogUpdatePool( _pid, ethPool.lastRewardTimestamp, totalSupply, ethPool.accEthPerShare, ID_ETH ); } /// @notice Cache tokens for ETH & PRIME allocation. /// @param _pid The index of the ethPool. See `ethPoolInfo`. /// @param _amount Amount of tokens to cache for _pid. function cache(uint256 _pid, uint256 _amount) public virtual override { require(_amount > 0, "Specify valid token amount to cache"); updateEthPool(_pid); EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; // Effects ethCache.rewardDebt += (_amount * ethPoolInfo[_pid].accEthPerShare) .toInt256(); PrimeRewards.cache(_pid, _amount); } /// @notice Withdraw tokens. /// @param _pid The index of the ethPool. See `ethPoolInfo`. /// @param _amount amount to withdraw from the pool function withdraw(uint256 _pid, uint256 _amount) public virtual override { updateEthPool(_pid); EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; // Effects ethCache.rewardDebt -= (_amount * ethPoolInfo[_pid].accEthPerShare) .toInt256(); PrimeRewards.withdraw(_pid, _amount); } /// @notice Claim accumulated eth rewards. /// @param _pid The index of the ethPool. See `ethPoolInfo`. function claimEth(uint256 _pid) public { updateEthPool(_pid); CacheInfo storage cache_ = cacheInfo[_pid][msg.sender]; EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; int256 accumulatedEth = (cache_.amount * ethPoolInfo[_pid].accEthPerShare).toInt256(); uint256 _pendingEth = (accumulatedEth - ethCache.rewardDebt) .toUint256() / ethAmountPerSecondPrecision; // Effects ethCache.rewardDebt = accumulatedEth; // Interactions if (_pendingEth != 0) { (bool sent, ) = msg.sender.call{ value: _pendingEth }(""); require(sent, "Failed to send Ether"); } emit Claim(msg.sender, _pid, _pendingEth, ID_ETH); } /// @notice ClaimPrime and ClaimETH a pool /// @param _pid Pool IDs of all to be claimed function claimEthAndPrime(uint256 _pid) public virtual { PrimeRewards.claimPrime(_pid); claimEth(_pid); } /// @notice ClaimPrime multiple ethPools /// @param _pids Pool IDs of all to be claimed function claimPools(uint256[] calldata _pids) external virtual { for (uint256 i = 0; i < _pids.length; ++i) { claimEthAndPrime(_pids[i]); } } /// @notice Withdraw and claim prime rewards, update eth reward debt so that user can claim eth after. /// @param _pid The index of the pool. See `poolInfo`. /// @param _amount Amount of tokenId sets to withdraw. function withdrawAndClaimPrime(uint256 _pid, uint256 _amount) public virtual override { updateEthPool(_pid); EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; // Effects ethCache.rewardDebt -= (_amount * ethPoolInfo[_pid].accEthPerShare) .toInt256(); PrimeRewards.withdrawAndClaimPrime(_pid, _amount); } /// @notice Withdraw and claim prime & eth rewards. /// @param _pid The index of the ethPool. See `ethPoolInfo`. /// @param _amount tokens amount to withdraw. function withdrawAndClaimEthAndPrime(uint256 _pid, uint256 _amount) external virtual { // Claim ETH updateEthPool(_pid); CacheInfo storage cache_ = cacheInfo[_pid][msg.sender]; EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; int256 accumulatedEth = (cache_.amount * ethPoolInfo[_pid].accEthPerShare).toInt256(); uint256 _pendingEth = (accumulatedEth - ethCache.rewardDebt) .toUint256() / ethAmountPerSecondPrecision; // Effects ethCache.rewardDebt = accumulatedEth - (_amount * ethPoolInfo[_pid].accEthPerShare).toInt256(); if (_pendingEth != 0) { (bool sent, ) = msg.sender.call{ value: _pendingEth }(""); require(sent, "Error sending eth"); } // Withdraw and claim PRIME PrimeRewards.withdrawAndClaimPrime(_pid, _amount); emit Claim(msg.sender, _pid, _pendingEth, ID_ETH); } /// @notice Withdraw and forgo rewards. EMERGENCY ONLY. /// @param _pid The index of the pool. See `poolInfo`. function emergencyWithdraw(uint256 _pid) public virtual override { EthCacheInfo storage ethCache = ethCacheInfo[_pid][msg.sender]; // Effects ethCache.rewardDebt = 0; PrimeRewards.emergencyWithdraw(_pid); } /// @notice Sweep function to transfer ETH out of contract. /// @param to address to sweep to /// @param amount Amount to withdraw function sweepETH(address payable to, uint256 amount) public onlyOwner { (bool sent, ) = to.call{ value: amount }(""); require(sent, "Failed to send Ether"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } 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"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; /// @title The PrimeRewards caching contract /// @notice Caching for PrimeKey, PrimeSets, CatalystDrive. It allows for a fixed PRIME token /// rewards distributed evenly across all cached tokens per second. contract PrimeRewards is Ownable, ERC1155Holder { using SafeERC20 for IERC20; using SafeCast for uint256; using SafeCast for int256; /// @notice Info of each Cache. /// `amount` Number of NFT sets the user has provided. /// `rewardDebt` The amount of PRIME the user is not eligible for either from /// having already harvesting or from not caching in the past. struct CacheInfo { uint256 amount; int256 rewardDebt; } /// @notice Info of each pool. /// Contains the weighted allocation of the reward pool /// as well as the ParallelAlpha tokenIds required to cache in the pool struct PoolInfo { uint256 accPrimePerShare; // The amount of accumulated PRIME per share uint256 allocPoint; // share of the contract's per second rewards to that pool uint256 lastRewardTimestamp; // last time stamp at which rewards were assigned uint256[] tokenIds; // ParallelAlpha tokenIds required to cache in the pool uint256 totalSupply; // Total number of cached sets in pool } /// @notice Address of PRIME contract. IERC20 public PRIME; /// @notice Address of Parallel Alpha erc1155 IERC1155 public immutable parallelAlpha; /// @notice Info of each pool. PoolInfo[] public poolInfo; /// @notice Cache info of each user that caches NFT sets. // poolID(per set) => user address => cache info mapping(uint256 => mapping(address => CacheInfo)) public cacheInfo; /// @notice Prime amount distributed for given period. primeAmountPerSecond = primeAmount / (endTimestamp - startTimestamp) uint256 public startTimestamp; // caching start timestamp. uint256 public endTimestamp; // caching end timestamp. uint256 public primeAmount; // the amount of PRIME to give out as rewards. uint256 public primeAmountPerSecond; // the amount of PRIME to give out as rewards per second. uint256 public constant primeAmountPerSecondPrecision = 1e18; // primeAmountPerSecond is carried around with extra precision to reduce rounding errors /// @dev PRIME token will be minted after this contract is deployed, but should not be changeable forever uint256 public primeUpdateCutoff = 1667304000; /// @dev Limit number of pools that can be added uint256 public maxNumPools = 500; /// @dev Total allocation points. Must be the sum of all allocation points (i.e. multipliers) in all pools. uint256 public totalAllocPoint; /// @dev Caching functionality flag bool public cachingPaused; /// @dev Constants passed into event data uint256 public constant ID_PRIME = 0; uint256 public constant ID_ETH = 1; /// @dev internal lock for receiving ERC1155 tokens. Only allow during cache calls bool public onReceiveLocked = true; // @dev Fire when user has cached an asset (or set of assets) to the contract // @param user Address that has cached an asset // @param pid Pool ID that the user has caches assets to // @param amount Number of assets cached event Cache(address indexed user, uint256 indexed pid, uint256 amount); // @dev Fire when user withdraws asset (or set of assets) from contract // @param user Address that has withdrawn an asset // @param pid Pool ID of the withdrawn assets // @param amount Number of assets withdrawn event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); // @dev Fire if an emergency withdrawal of assets occurs // @param user Address that has withdrawn an asset // @param pid Pool ID of the withdrawn assets // @param amount Number of assets withdrawn event EmergencyWithdraw( address indexed user, uint256 indexed pid, uint256 amount ); // @dev Fire when user claims their rewards from the contract // @param user Address claiming rewards // @param pid Pool ID from which the user has claimed rewards // @param amount Amount of rewards claimed // @param currencyId Reward currency - 1 = ETH, 2 = PRIME event Claim( address indexed user, uint256 indexed pid, uint256 amount, uint256 indexed currencyId ); // @dev Fire when a new pool is added to the contract // @param pid Pool ID of the new pool // @param tokenIds ERC1155 token ids of pool assets event LogPoolAddition(uint256 indexed pid, uint256[] tokenIds); // @dev Fire when the end of a rewards regime has been updated // @param endTimestamp New end time for a pool rewards // @param currencyId Reward currency - 1 = ETH, 2 = PRIME event EndTimestampUpdated(uint256 endTimestamp, uint256 indexed currencyID); // @dev Fire when additional rewards are added to a pool's rewards regime // @param amount Amount of new rewards added // @param currencyID Reward currency - 1 = ETH, 2 = PRIME event RewardIncrease(uint256 amount, uint256 indexed currencyID); // @dev Fire when rewards are removed from a pool's rewards regime // @param amount Amount of new rewards added // @param currencyID Reward currency - 1 = ETH, 2 = PRIME event RewardDecrease(uint256 amount, uint256 indexed currencyID); // @dev Fire when caching is paused for the contract // @param cachingPaused True if caching is paused event CachingPaused(bool cachingPaused); // @dev Fire when there has been a change to the allocation points of a pool // @param pid Pool ID for which the allocation points have changed // @param totalAllocPoint the new total allocation points of all pools // @param currencyID Reward currency - 1 = ETH, 2 = PRIME event LogPoolSetAllocPoint( uint256 indexed pid, uint256 allocPoint, uint256 totalAllocPoint, uint256 indexed currencyId ); // @dev Fire when rewards are recalculated in the pool // @param pid Pool ID for which the update occurred // @param lastRewardTimestamp The timestamp at which rewards have been recalculated for // @param supply The amount of assets staked to that pool // @param currencyID Reward currency - 1 = ETH, 2 = PRIME event LogUpdatePool( uint256 indexed pid, uint256 lastRewardTimestamp, uint256 supply, uint256 accPerShare, uint256 indexed currencyId ); // @dev Fire when the rewards rate has been changed // @param amount Amount of rewards // @param startTimestamp Begin time of the reward period // @param startTimestamp End time of the reward period // @param currencyID Reward currency - 1 = ETH, 2 = PRIME event LogSetPerSecond( uint256 amount, uint256 startTimestamp, uint256 endTimestamp, uint256 indexed currencyId ); /// @param _prime The PRIME token contract address. /// @param _parallelAlpha The Parallel Alpha contract address. constructor(IERC20 _prime, IERC1155 _parallelAlpha) { parallelAlpha = _parallelAlpha; PRIME = _prime; } /// @notice Sets new prime token address /// @param _prime The PRIME token contract address. function setPrimeTokenAddress(IERC20 _prime) external onlyOwner { require( block.timestamp < primeUpdateCutoff, "PRIME address update window has has passed" ); PRIME = _prime; } /// @notice Sets new max number of pools. New max cannot be less than /// current number of pools. /// @param _maxNumPools The new max number of pools. function setMaxNumPools(uint256 _maxNumPools) external onlyOwner { require( _maxNumPools >= poolLength(), "Can't set maxNumPools less than poolLength" ); maxNumPools = _maxNumPools; } /// @notice Returns the number of pools. function poolLength() public view returns (uint256 pools) { pools = poolInfo.length; } /// @param _pid Pool to get IDs for function getPoolTokenIds(uint256 _pid) external view returns (uint256[] memory) { return poolInfo[_pid].tokenIds; } function updateAllPools() internal { uint256 len = poolLength(); for (uint256 i = 0; i < len; ++i) { updatePool(i); } } /// @notice Add a new set of tokenIds as a new pool. Can only be called by the owner. /// DO NOT add the same token id more than once or rewards will be inaccurate. /// @param _allocPoint Allocation Point (i.e. multiplier) of the new pool. /// @param _tokenIds TokenIds for ParallelAlpha ERC1155, set of tokenIds for pool. function addPool(uint256 _allocPoint, uint256[] memory _tokenIds) public virtual onlyOwner { require(poolInfo.length < maxNumPools, "Max num pools reached"); require(_tokenIds.length > 0, "TokenIds cannot be empty"); require(_allocPoint > 0, "Allocation point cannot be 0 or negative"); // Update all pool information before adding the AllocPoint for new pool for (uint256 i = 0; i < poolInfo.length; ++i) { updatePool(i); require( keccak256(abi.encodePacked(poolInfo[i].tokenIds)) != keccak256(abi.encodePacked(_tokenIds)), "Pool with same tokenIds exists" ); } totalAllocPoint += _allocPoint; poolInfo.push( PoolInfo({ accPrimePerShare: 0, allocPoint: _allocPoint, lastRewardTimestamp: Math.max(block.timestamp, startTimestamp), tokenIds: _tokenIds, totalSupply: 0 }) ); emit LogPoolAddition(poolInfo.length - 1, _tokenIds); emit LogPoolSetAllocPoint( poolInfo.length - 1, _allocPoint, totalAllocPoint, ID_PRIME ); } /// @notice Set new period to distribute rewards between endTimestamp-startTimestamp /// evenly per second. primeAmountPerSecond = _primeAmount / (_endTimestamp - _startTimestamp) /// Can only be set once any existing setPrimePerSecond regime has concluded (ethEndTimestamp < block.timestamp) /// @param _startTimestamp Timestamp for caching period to start at /// @param _endTimestamp Timestamp for caching period to end at /// @param _primeAmount Amount of Prime to distribute evenly across whole period function setPrimePerSecond( uint256 _startTimestamp, uint256 _endTimestamp, uint256 _primeAmount ) external onlyOwner { require( _startTimestamp < _endTimestamp, "endTimestamp cant be less than startTimestamp" ); require( block.timestamp < startTimestamp || endTimestamp < block.timestamp, "Only updates after endTimestamp or before startTimestamp" ); // Update all pools, ensure rewards are calculated up to this timestamp for (uint256 i = 0; i < poolInfo.length; ++i) { updatePool(i); poolInfo[i].lastRewardTimestamp = _startTimestamp; } primeAmount = _primeAmount; startTimestamp = _startTimestamp; endTimestamp = _endTimestamp; primeAmountPerSecond = (_primeAmount * primeAmountPerSecondPrecision) / (_endTimestamp - _startTimestamp); emit LogSetPerSecond( _primeAmount, _startTimestamp, _endTimestamp, ID_PRIME ); } /// @notice Update endTimestamp, only possible to call this when caching for /// a period has already begun. New endTimestamp must be in the future /// @param _endTimestamp New timestamp for caching period to end at function setEndTimestamp(uint256 _endTimestamp) external onlyOwner { require( startTimestamp < block.timestamp, "caching period has not started yet" ); require(block.timestamp < _endTimestamp, "invalid end timestamp"); updateAllPools(); // Update primeAmountPerSecond based on the new endTimestamp startTimestamp = block.timestamp; endTimestamp = _endTimestamp; primeAmountPerSecond = (primeAmount * primeAmountPerSecondPrecision) / (endTimestamp - startTimestamp); emit EndTimestampUpdated(_endTimestamp, ID_PRIME); } /// @notice Function for 'Top Ups', adds additional prime to distribute for remaining time /// in the period. /// @param _addPrimeAmount Amount of Prime to add to the reward pool function addPrimeAmount(uint256 _addPrimeAmount) external onlyOwner { require( startTimestamp < block.timestamp && block.timestamp < endTimestamp, "Can only addPrimeAmount during period" ); // Update all pools updateAllPools(); // Top up current period's PRIME primeAmount += _addPrimeAmount; primeAmountPerSecond = (primeAmount * primeAmountPerSecondPrecision) / (endTimestamp - block.timestamp); emit RewardIncrease(_addPrimeAmount, ID_PRIME); } /// @notice Function for 'Top Downs', removes prime distributed for remaining time /// in the period. /// @param _removePrimeAmount Amount of Prime to remove from the remaining reward pool function removePrimeAmount(uint256 _removePrimeAmount) external onlyOwner { require( startTimestamp < block.timestamp && block.timestamp < endTimestamp, "Can only removePrimeAmount during a period" ); // Update all pools updateAllPools(); // Adjust current period's PRIME // Using min to make sure primeAmount can only be reduced to zero _removePrimeAmount = Math.min(_removePrimeAmount, primeAmount); primeAmount -= _removePrimeAmount; primeAmountPerSecond = (primeAmount * primeAmountPerSecondPrecision) / (endTimestamp - block.timestamp); emit RewardDecrease(_removePrimeAmount, ID_PRIME); } /// @notice Update the given pool's PRIME allocation point (i.e. multiplier). Only owner. /// @param _pid The index of the pool. See `poolInfo`. /// @param _allocPoint New allocation point (i.e. multiplier) of the pool. function setPoolAllocPoint(uint256 _pid, uint256 _allocPoint) external onlyOwner { // Update all pools updateAllPools(); totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint; poolInfo[_pid].allocPoint = _allocPoint; emit LogPoolSetAllocPoint(_pid, _allocPoint, totalAllocPoint, ID_PRIME); } /// @notice Enable/disable caching for pools. Only owner. /// @param _cachingPaused boolean value to set function setCachingPaused(bool _cachingPaused) external onlyOwner { cachingPaused = _cachingPaused; emit CachingPaused(cachingPaused); } /// @notice View function to see cache amounts for pools. /// @param _pids List of pool index ids. See `poolInfo`. /// @param _addresses List of user addresses. /// @return amounts List of cache amounts. function getPoolCacheAmounts( uint256[] calldata _pids, address[] calldata _addresses ) external view returns (uint256[] memory) { require( _pids.length == _addresses.length, "pids and addresses length mismatch" ); uint256[] memory amounts = new uint256[](_pids.length); for (uint256 i = 0; i < _pids.length; ++i) { amounts[i] = cacheInfo[_pids[i]][_addresses[i]].amount; } return amounts; } /// @notice View function to see pending PRIME on frontend. /// @param _pid The index of the pool. See `poolInfo`. /// @param _user Address of user. /// @return pending PRIME reward for a given user. function pendingPrime(uint256 _pid, address _user) external view returns (uint256 pending) { PoolInfo memory pool = poolInfo[_pid]; CacheInfo storage _cache = cacheInfo[_pid][_user]; uint256 accPrimePerShare = pool.accPrimePerShare; uint256 totalSupply = pool.totalSupply; if ( startTimestamp <= block.timestamp && pool.lastRewardTimestamp < block.timestamp && totalSupply > 0 ) { uint256 updateToTimestamp = Math.min(block.timestamp, endTimestamp); uint256 seconds_ = updateToTimestamp - pool.lastRewardTimestamp; uint256 primeReward = (seconds_ * primeAmountPerSecond * pool.allocPoint) / totalAllocPoint; accPrimePerShare += primeReward / totalSupply; } pending = ((_cache.amount * accPrimePerShare).toInt256() - _cache.rewardDebt) .toUint256() / primeAmountPerSecondPrecision; } /// @notice Update reward variables for all pools. Be careful of gas required. /// @param _pids Pool IDs of all to be updated. Make sure to update all active pools. function massUpdatePools(uint256[] calldata _pids) external { uint256 len = _pids.length; for (uint256 i = 0; i < len; ++i) { updatePool(_pids[i]); } } /// @notice Update reward variables for the given pool. /// @param _pid The index of the pool. See `poolInfo`. function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if ( startTimestamp > block.timestamp || pool.lastRewardTimestamp >= block.timestamp || (startTimestamp == 0 && endTimestamp == 0) ) { return; } uint256 updateToTimestamp = Math.min(block.timestamp, endTimestamp); uint256 totalSupply = pool.totalSupply; uint256 seconds_ = updateToTimestamp - pool.lastRewardTimestamp; uint256 primeReward = (seconds_ * primeAmountPerSecond * pool.allocPoint) / totalAllocPoint; primeAmount -= primeReward / primeAmountPerSecondPrecision; if (totalSupply > 0) { pool.accPrimePerShare += primeReward / totalSupply; } pool.lastRewardTimestamp = updateToTimestamp; emit LogUpdatePool( _pid, pool.lastRewardTimestamp, totalSupply, pool.accPrimePerShare, ID_PRIME ); } /// @notice Cache NFTs for PRIME rewards. /// @param _pid The index of the pool. See `poolInfo`. /// @param _amount Amount of 'tokenIds sets' to cache for _pid. function cache(uint256 _pid, uint256 _amount) public virtual { require(!cachingPaused, "Caching is paused"); require(_amount > 0, "Specify valid amount to cache"); updatePool(_pid); CacheInfo storage _cache = cacheInfo[_pid][msg.sender]; // Create amounts array for tokenIds BatchTransfer uint256[] memory amounts = new uint256[]( poolInfo[_pid].tokenIds.length ); for (uint256 i = 0; i < amounts.length; i++) { amounts[i] = _amount; } // Effects poolInfo[_pid].totalSupply += _amount; _cache.amount += _amount; _cache.rewardDebt += (_amount * poolInfo[_pid].accPrimePerShare) .toInt256(); onReceiveLocked = false; parallelAlpha.safeBatchTransferFrom( msg.sender, address(this), poolInfo[_pid].tokenIds, amounts, bytes("") ); onReceiveLocked = true; emit Cache(msg.sender, _pid, _amount); } /// @notice Withdraw from pool /// @param _pid The index of the pool. See `poolInfo`. /// @param _amount Amount of tokenId sets to withdraw from the pool function withdraw(uint256 _pid, uint256 _amount) public virtual { updatePool(_pid); CacheInfo storage _cache = cacheInfo[_pid][msg.sender]; // Create amounts array for tokenIds BatchTransfer uint256[] memory amounts = new uint256[]( poolInfo[_pid].tokenIds.length ); for (uint256 i = 0; i < amounts.length; i++) { amounts[i] = _amount; } // Effects poolInfo[_pid].totalSupply -= _amount; _cache.rewardDebt -= (_amount * poolInfo[_pid].accPrimePerShare) .toInt256(); _cache.amount -= _amount; parallelAlpha.safeBatchTransferFrom( address(this), msg.sender, poolInfo[_pid].tokenIds, amounts, bytes("") ); emit Withdraw(msg.sender, _pid, _amount); } /// @notice Claim accumulated PRIME rewards. /// @param _pid The index of the pool. See `poolInfo`. function claimPrime(uint256 _pid) public { updatePool(_pid); CacheInfo storage _cache = cacheInfo[_pid][msg.sender]; int256 accumulatedPrime = (_cache.amount * poolInfo[_pid].accPrimePerShare).toInt256(); uint256 _pendingPrime = (accumulatedPrime - _cache.rewardDebt) .toUint256() / primeAmountPerSecondPrecision; // Effects _cache.rewardDebt = accumulatedPrime; // Interactions if (_pendingPrime != 0) { PRIME.safeTransfer(msg.sender, _pendingPrime); } emit Claim(msg.sender, _pid, _pendingPrime, ID_PRIME); } /// @notice claimPrime multiple pools /// @param _pids Pool IDs of all to be claimed function claimPrimePools(uint256[] calldata _pids) external virtual { for (uint256 i = 0; i < _pids.length; ++i) { claimPrime(_pids[i]); } } /// @notice Withdraw and claim PRIME rewards. /// @param _pid The index of the pool. See `poolInfo`. /// @param _amount Amount of tokenId sets to withdraw. function withdrawAndClaimPrime(uint256 _pid, uint256 _amount) public virtual { updatePool(_pid); CacheInfo storage _cache = cacheInfo[_pid][msg.sender]; int256 accumulatedPrime = (_cache.amount * poolInfo[_pid].accPrimePerShare).toInt256(); uint256 _pendingPrime = (accumulatedPrime - _cache.rewardDebt) .toUint256() / primeAmountPerSecondPrecision; // Create amounts array for tokenIds BatchTransfer uint256[] memory amounts = new uint256[]( poolInfo[_pid].tokenIds.length ); for (uint256 i = 0; i < amounts.length; i++) { amounts[i] = _amount; } // Effects poolInfo[_pid].totalSupply -= _amount; _cache.rewardDebt = accumulatedPrime - (_amount * poolInfo[_pid].accPrimePerShare).toInt256(); _cache.amount -= _amount; if (_pendingPrime != 0) { PRIME.safeTransfer(msg.sender, _pendingPrime); } parallelAlpha.safeBatchTransferFrom( address(this), msg.sender, poolInfo[_pid].tokenIds, amounts, bytes("") ); emit Withdraw(msg.sender, _pid, _amount); emit Claim(msg.sender, _pid, _pendingPrime, ID_PRIME); } /// @notice Withdraw and forgo rewards. EMERGENCY ONLY. /// @param _pid The index of the pool. See `poolInfo`. function emergencyWithdraw(uint256 _pid) public virtual { CacheInfo storage _cache = cacheInfo[_pid][msg.sender]; uint256 amount = _cache.amount; // Create amounts array for tokenIds BatchTransfer uint256[] memory amounts = new uint256[]( poolInfo[_pid].tokenIds.length ); for (uint256 i = 0; i < amounts.length; i++) { amounts[i] = amount; } // Effects poolInfo[_pid].totalSupply -= amount; _cache.rewardDebt = 0; _cache.amount = 0; parallelAlpha.safeBatchTransferFrom( address(this), msg.sender, poolInfo[_pid].tokenIds, amounts, bytes("") ); emit EmergencyWithdraw(msg.sender, _pid, amount); } /// @notice Sweep function to transfer erc20 tokens out of contract. Only owner. /// @param erc20 Token to transfer out /// @param to address to sweep to /// @param amount Amount to withdraw function sweepERC20( IERC20 erc20, address to, uint256 amount ) external onlyOwner { erc20.transfer(to, amount); } /// @notice Disable renounceOwnership. Only callable by owner. function renounceOwnership() public virtual override onlyOwner { revert("Ownership cannot be renounced"); } /// @notice Revert for calls outside of cache method function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { require(onReceiveLocked == false, "onReceive is locked"); return this.onERC1155Received.selector; } /// @notice Revert for calls outside of cache method function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { require(onReceiveLocked == false, "onReceive is locked"); return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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.5.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 * ==== * * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public 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 // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_prime","type":"address"},{"internalType":"contract IERC1155","name":"_parallelAlpha","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Cache","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"cachingPaused","type":"bool"}],"name":"CachingPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyId","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyID","type":"uint256"}],"name":"EndTimestampUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"LogPoolAddition","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalAllocPoint","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyId","type":"uint256"}],"name":"LogPoolSetAllocPoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyId","type":"uint256"}],"name":"LogSetPerSecond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastRewardTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accPerShare","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyId","type":"uint256"}],"name":"LogUpdatePool","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":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyID","type":"uint256"}],"name":"RewardDecrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"currencyID","type":"uint256"}],"name":"RewardIncrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ID_ETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ID_PRIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRIME","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addEthAmount","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_addPrimeAmount","type":"uint256"}],"name":"addPrimeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"cache","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"cacheInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"int256","name":"rewardDebt","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cachingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimEthAndPrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"claimPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"claimPrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"claimPrimePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethAmountPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethAmountPerSecondPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"ethCacheInfo","outputs":[{"internalType":"int256","name":"rewardDebt","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethEndTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ethPoolInfo","outputs":[{"internalType":"uint256","name":"accEthPerShare","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethStartTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethTotalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"getPoolCacheAmounts","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getPoolTokenIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"massUpdateEthPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_pids","type":"uint256[]"}],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxNumPools","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"onReceiveLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"parallelAlpha","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingEth","outputs":[{"internalType":"uint256","name":"pending","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingPrime","outputs":[{"internalType":"uint256","name":"pending","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"uint256","name":"accPrimePerShare","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTimestamp","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"pools","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primeAmountPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primeAmountPerSecondPrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"primeUpdateCutoff","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_removeEthAmount","type":"uint256"}],"name":"removeEthAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_removePrimeAmount","type":"uint256"}],"name":"removePrimeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_cachingPaused","type":"bool"}],"name":"setCachingPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTimestamp","type":"uint256"}],"name":"setEndTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethEndTimestamp","type":"uint256"}],"name":"setEthEndTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ethStartTimestamp","type":"uint256"},{"internalType":"uint256","name":"_ethEndTimestamp","type":"uint256"}],"name":"setEthPerSecond","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"setEthPoolAllocPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxNumPools","type":"uint256"}],"name":"setMaxNumPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"setPoolAllocPoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"uint256","name":"_primeAmount","type":"uint256"}],"name":"setPrimePerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_prime","type":"address"}],"name":"setPrimeTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"erc20","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAllocPoint","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":"_pid","type":"uint256"}],"name":"updateEthPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAndClaimEthAndPrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAndClaimPrime","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526363610a406008556101f4600955600b805461ff0019166101001790553480156200002e57600080fd5b5060405162004b7238038062004b728339810160408190526200005191620000e7565b81816200005e3362000097565b60601b6001600160601b031916608052600180546001600160a01b0319166001600160a01b0392909216919091179055506200013f9050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060408385031215620000fb57600080fd5b8251620001088162000126565b60208401519092506200011b8162000126565b809150509250929050565b6001600160a01b03811681146200013c57600080fd5b50565b60805160601c6149f86200017a600039600081816109c50152818161316101528181613403015281816136110152613c6c01526149f86000f3fe6080604052600436106103cc5760003560e01c80637df6a6c8116101fd578063cc8ba18811610118578063e6fd48bc116100ab578063f15d6f9d1161007a578063f15d6f9d14610b75578063f23a6e6114610b95578063f2fde38b14610bb5578063f928603e14610bd5578063facf0073146105ac57600080fd5b8063e6fd48bc14610aff578063e729499a14610b15578063e7bcdafd14610b35578063edc1e62f14610b5557600080fd5b8063dc628aa4116100e7578063dc628aa414610a8a578063ddcb4b6814610aaa578063e1df480f14610aca578063e4f3ae4314610aea57600080fd5b8063cc8ba18814610a07578063cdeccabf14610a27578063d0fcca4114610a54578063d402518714610a6a57600080fd5b8063bc197c8111610190578063c98166c01161015f578063c98166c01461097d578063c9af39e214610993578063ca7238f2146109b3578063cbd99868146109e757600080fd5b8063bc197c81146108fb578063bec4d45414610934578063bee208851461094a578063c273c1c91461096a57600080fd5b8063a49596fd116101cc578063a49596fd14610878578063a85adeab146108b0578063ae1f071d146108c6578063b588d1c9146108db57600080fd5b80637df6a6c8146107fb578063811822e61461081b5780638da5cb5b1461083b578063a339bb461461085957600080fd5b806349e0b22d116102ed5780635b116ab8116102805780636c3fe0491161024f5780636c3fe0491461079a578063715018a6146107b057806371993130146107c557806372838d19146107db57600080fd5b80635b116ab8146106e65780635c5709ca146107065780636297d9f81461075a5780636af84fc01461077a57600080fd5b80635312ea8e116102bc5780635312ea8e1461067e57806353ae82f31461069e57806357a5b58c146106a657806359594888146106c657600080fd5b806349e0b22d146106085780634f94a8cd1461061e578063503690d11461063e57806351eb05a61461065e57600080fd5b806316a88aa3116103655780632fee4c87116103345780632fee4c87146105965780633f3a1f50146105ac578063441a3e70146105c8578063446a3c1f146105e857600080fd5b806316a88aa31461053057806317caf6f1146105465780631cb819ad1461055c5780632138c1aa1461057657600080fd5b80630b79ca87116103a15780630b79ca871461049857806312446f49146104ba5780631526fe27146104d057806315e8c7411461051057600080fd5b806217cd8b146103d15780626d0c1a1461040e57806301ffc9a714610449578063081e3eda14610479575b600080fd5b3480156103dd57600080fd5b506001546103f1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561041a57600080fd5b5061042e61042936600461448a565b610bf5565b60408051938452602084019290925290820152606001610405565b34801561045557600080fd5b5061046961046436600461441f565b610c28565b6040519015158152602001610405565b34801561048557600080fd5b506002545b604051908152602001610405565b3480156104a457600080fd5b506104b86104b3366004614339565b610c5f565b005b3480156104c657600080fd5b5061048a60085481565b3480156104dc57600080fd5b506104f06104eb36600461448a565b610ca2565b604080519485526020850193909352918301526060820152608001610405565b34801561051c57600080fd5b506104b861052b366004614519565b610cdc565b34801561053c57600080fd5b5061048a600d5481565b34801561055257600080fd5b5061048a600a5481565b34801561056857600080fd5b50600b546104699060ff1681565b34801561058257600080fd5b5061048a6105913660046144a3565b610e9f565b3480156105a257600080fd5b5061048a60095481565b3480156105b857600080fd5b5061048a670de0b6b3a764000081565b3480156105d457600080fd5b506104b86105e3366004614519565b6110b9565b3480156105f457600080fd5b5061048a6106033660046144a3565b611139565b34801561061457600080fd5b5061048a600e5481565b34801561062a57600080fd5b506104b8610639366004614519565b6112e0565b34801561064a57600080fd5b506104b8610659366004614449565b61133e565b34801561066a57600080fd5b506104b861067936600461448a565b6113ea565b34801561068a57600080fd5b506104b861069936600461448a565b611542565b6104b861156b565b3480156106b257600080fd5b506104b86106c1366004614339565b6116a6565b3480156106d257600080fd5b506104b86106e136600461448a565b6116e3565b3480156106f257600080fd5b506104b86107013660046141f8565b61189e565b34801561071257600080fd5b506107456107213660046144a3565b60036020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610405565b34801561076657600080fd5b506104b861077536600461448a565b61193b565b34801561078657600080fd5b506104b861079536600461448a565b611b48565b3480156107a657600080fd5b5061048a60115481565b3480156107bc57600080fd5b506104b8611c68565b3480156107d157600080fd5b5061048a60075481565b3480156107e757600080fd5b506104b86107f636600461448a565b611cda565b34801561080757600080fd5b506104b861081636600461448a565b611e2e565b34801561082757600080fd5b506104b861083636600461448a565b611f6e565b34801561084757600080fd5b506000546001600160a01b03166103f1565b34801561086557600080fd5b50600b5461046990610100900460ff1681565b34801561088457600080fd5b5061048a6108933660046144a3565b601260209081526000928352604080842090915290825290205481565b3480156108bc57600080fd5b5061048a60055481565b3480156108d257600080fd5b5061048a600181565b3480156108e757600080fd5b506104b86108f63660046141db565b612002565b34801561090757600080fd5b5061091b610916366004614224565b6120b2565b6040516001600160e01b03199091168152602001610405565b34801561094057600080fd5b5061048a60065481565b34801561095657600080fd5b506104b86109653660046144d3565b612115565b6104b8610978366004614519565b612226565b34801561098957600080fd5b5061048a600f5481565b34801561099f57600080fd5b506104b86109ae366004614339565b6123b9565b3480156109bf57600080fd5b506103f17f000000000000000000000000000000000000000000000000000000000000000081565b3480156109f357600080fd5b506104b8610a0236600461448a565b6123f5565b348015610a1357600080fd5b506104b8610a2236600461453b565b612521565b348015610a3357600080fd5b50610a47610a4236600461437a565b6126bd565b60405161040591906146e0565b348015610a6057600080fd5b5061048a60105481565b348015610a7657600080fd5b506104b8610a85366004614339565b612819565b348015610a9657600080fd5b506104b8610aa5366004614519565b612855565b348015610ab657600080fd5b506104b8610ac53660046143e5565b612920565b348015610ad657600080fd5b506104b8610ae5366004614519565b612997565b348015610af657600080fd5b5061048a600081565b348015610b0b57600080fd5b5061048a60045481565b348015610b2157600080fd5b506104b8610b3036600461448a565b612a51565b348015610b4157600080fd5b506104b8610b5036600461448a565b612a66565b348015610b6157600080fd5b506104b8610b70366004614519565b612b4b565b348015610b8157600080fd5b50610a47610b9036600461448a565b612c35565b348015610ba157600080fd5b5061091b610bb03660046142d1565b612cb1565b348015610bc157600080fd5b506104b8610bd03660046141db565b612d14565b348015610be157600080fd5b506104b8610bf036600461448a565b612dac565b600c8181548110610c0557600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b60006001600160e01b03198216630271189760e51b1480610c5957506301ffc9a760e01b6001600160e01b03198316145b92915050565b8060005b81811015610c9c57610c8c848483818110610c8057610c80614933565b9050602002013561193b565b610c9581614902565b9050610c63565b50505050565b60028181548110610cb257600080fd5b60009182526020909120600590910201805460018201546002830154600490930154919350919084565b610ce58261193b565b6000828152600360209081526040808320338085529083528184208685526012845282852091855292528220600c805492939192610d50919087908110610d2e57610d2e614933565b60009182526020909120600390910201548454610d4b9190614861565b612ed8565b90506000670de0b6b3a7640000610d75846000015484610d709190614880565b612f46565b610d7f919061483f565b9050610db4600c8781548110610d9757610d97614933565b90600052602060002090600302016000015486610d4b9190614861565b610dbe9083614880565b83558015610e5957604051600090339083908381818185875af1925050503d8060008114610e08576040519150601f19603f3d011682016040523d82523d6000602084013e610e0d565b606091505b5050905080610e575760405162461bcd60e51b815260206004820152601160248201527008ae4e4dee440e6cadcc8d2dcce40cae8d607b1b60448201526064015b60405180910390fd5b505b610e638686612f98565b600186336001600160a01b03166000805160206149a383398151915284604051610e8f91815260200190565b60405180910390a4505050505050565b60008060028481548110610eb557610eb5614933565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015610f3b57602002820191906000526020600020905b815481526020019060010190808311610f27575b50505091835250506004919091015460209182015260008681526003825260408082206001600160a01b0388168352909252908120600c8054939450909287908110610f8957610f89614933565b60009182526020808320604080516060810182526003909402909101805484526001810154848401526002015483820152898452601282528084206001600160a01b038a16855290915290912081516080860151600d5493945091929091904210801590610ffa5750428460400151105b80156110065750600081115b1561107757600061101942600e5461327a565b9050600085604001518261102d91906148bf565b905060006011548760200151601054846110479190614861565b6110519190614861565b61105b919061483f565b9050611067848261483f565b6110719086614827565b94505050505b82548554670de0b6b3a7640000916110a29161109890610d4b908790614861565b610d709190614880565b6110ac919061483f565b9998505050505050505050565b6110c28261193b565b60008281526012602090815260408083203384529091529020600c80546111119190859081106110f4576110f4614933565b90600052602060002090600302016000015483610d4b9190614861565b8160000160008282546111249190614880565b9091555061113490508383613292565b505050565b6000806002848154811061114f5761114f614933565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156111d557602002820191906000526020600020905b8154815260200190600101908083116111c1575b505050918352505060049182015460209182015260008781526003825260408082206001600160a01b0389168352909252208251608084015192549394509092909190421080159061122a5750428460400151105b80156112365750600081115b156112a75760006112494260055461327a565b9050600085604001518261125d91906148bf565b90506000600a548760200151600754846112779190614861565b6112819190614861565b61128b919061483f565b9050611297848261483f565b6112a19086614827565b94505050505b670de0b6b3a76400006112cb8460010154611098858760000154610d4b9190614861565b6112d5919061483f565b979650505050505050565b6112e98261193b565b60008281526012602090815260408083203384529091529020600c805461131b9190859081106110f4576110f4614933565b81600001600082825461132e9190614880565b9091555061113490508383612f98565b6000546001600160a01b031633146113685760405162461bcd60e51b8152600401610e4e90614734565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9c9190614402565b6000600282815481106113ff576113ff614933565b90600052602060002090600502019050426004541180611423575042816002015410155b8061143957506004541580156114395750600554155b15611442575050565b60006114504260055461327a565b600483015460028401549192509060009061146b90846148bf565b90506000600a548560010154600754846114859190614861565b61148f9190614861565b611499919061483f565b90506114ad670de0b6b3a76400008261483f565b600660008282546114be91906148bf565b909155505082156114ec576114d3838261483f565b8560000160008282546114e69190614827565b90915550505b6002850184905584546040805186815260208101869052808201929092525160009188917fc75b283f14d0a806c63b93a3659ed39c43a20bf0fff8030465e93d79e91ca40f9181900360600190a3505050505050565b60008181526012602090815260408083203384529091528120908155611567826134f7565b5050565b6000546001600160a01b031633146115955760405162461bcd60e51b8152600401610e4e90614734565b42600d541080156115a75750600e5442105b6115ff5760405162461bcd60e51b815260206004820152602360248201527f43616e206f6e6c7920616464457468416d6f756e7420647572696e67207065726044820152621a5bd960ea1b6064820152608401610e4e565b60005b600c54811015611625576116158161193b565b61161e81614902565b9050611602565b5034600f60008282546116389190614827565b9091555050600e5461164b9042906148bf565b670de0b6b3a7640000600f546116619190614861565b61166b919061483f565b6010556040513481526001907f4dffb45d6f962f8af66e8c830a9a6027cea8919fd29147db4be34dadb0fb5f1e9060200160405180910390a2565b8060005b81811015610c9c576116d38484838181106116c7576116c7614933565b905060200201356113ea565b6116dc81614902565b90506116aa565b6000546001600160a01b0316331461170d5760405162461bcd60e51b8152600401610e4e90614734565b42600d5410801561171f5750600e5442105b61177a5760405162461bcd60e51b815260206004820152602660248201527f43616e206f6e6c792072656d6f7665457468416d6f756e7420647572696e67206044820152651c195c9a5bd960d21b6064820152608401610e4e565b60005b600c548110156117a0576117908161193b565b61179981614902565b905061177d565b506117ad81600f5461327a565b905080600f60008282546117c191906148bf565b9091555050600e546117d49042906148bf565b670de0b6b3a7640000600f546117ea9190614861565b6117f4919061483f565b601055604051600090339083908381818185875af1925050503d8060008114611839576040519150601f19603f3d011682016040523d82523d6000602084013e61183e565b606091505b505090508061185f5760405162461bcd60e51b8152600401610e4e90614706565b60017fb8f9e0ef8f651eda7570ff1a8ebe8a2acf07d57f7c18a9184d8e4395c2c82aa58360405161189291815260200190565b60405180910390a25050565b6000546001600160a01b031633146118c85760405162461bcd60e51b8152600401610e4e90614734565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611915576040519150601f19603f3d011682016040523d82523d6000602084013e61191a565b606091505b50509050806111345760405162461bcd60e51b8152600401610e4e90614706565b60006002828154811061195057611950614933565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156119d657602002820191906000526020600020905b8154815260200190600101908083116119c2575b5050505050815260200160048201548152505090506000600c8381548110611a0057611a00614933565b9060005260206000209060030201905060008260800151905042600d541180611a2d575042826002015410155b80611a435750600d54158015611a435750600e54155b15611a4e5750505050565b6000611a5c42600e5461327a565b90506000836002015482611a7091906148bf565b90506000601154856001015460105484611a8a9190614861565b611a949190614861565b611a9e919061483f565b9050611ab2670de0b6b3a76400008261483f565b600f6000828254611ac391906148bf565b90915550508315611af157611ad8848261483f565b856000016000828254611aeb9190614827565b90915550505b6002850183905584546040805185815260208101879052808201929092525160019189917fc75b283f14d0a806c63b93a3659ed39c43a20bf0fff8030465e93d79e91ca40f9181900360600190a350505050505050565b6000546001600160a01b03163314611b725760405162461bcd60e51b8152600401610e4e90614734565b42600454108015611b84575060055442105b611bde5760405162461bcd60e51b815260206004820152602560248201527f43616e206f6e6c79206164645072696d65416d6f756e7420647572696e672070604482015264195c9a5bd960da1b6064820152608401610e4e565b611be66136f4565b8060066000828254611bf89190614827565b9091555050600554611c0b9042906148bf565b670de0b6b3a7640000600654611c219190614861565b611c2b919061483f565b6007556040518181526000907f4dffb45d6f962f8af66e8c830a9a6027cea8919fd29147db4be34dadb0fb5f1e906020015b60405180910390a250565b6000546001600160a01b03163314611c925760405162461bcd60e51b8152600401610e4e90614734565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e6365640000006044820152606401610e4e565b6000546001600160a01b03163314611d045760405162461bcd60e51b8152600401610e4e90614734565b42600d5410611d555760405162461bcd60e51b815260206004820152601e60248201527f43616368696e6720706572696f6420686173206e6f74207374617274656400006044820152606401610e4e565b804210611d9c5760405162461bcd60e51b81526020600482015260156024820152740696e76616c696420656e642074696d657374616d7605c1b6044820152606401610e4e565b60005b600c54811015611dc257611db28161193b565b611dbb81614902565b9050611d9f565b5042600d819055600e829055611dd890826148bf565b670de0b6b3a7640000600f54611dee9190614861565b611df8919061483f565b6010556040518181526001907f7e9fbea655506e5a9e67dca69341fadbddee58b360cc1e2f888d0b5576febb8490602001611c5d565b6000546001600160a01b03163314611e585760405162461bcd60e51b8152600401610e4e90614734565b4260045410611eb45760405162461bcd60e51b815260206004820152602260248201527f63616368696e6720706572696f6420686173206e6f7420737461727465642079604482015261195d60f21b6064820152608401610e4e565b804210611efb5760405162461bcd60e51b81526020600482015260156024820152740696e76616c696420656e642074696d657374616d7605c1b6044820152606401610e4e565b611f036136f4565b4260048190556005829055611f1890826148bf565b670de0b6b3a7640000600654611f2e9190614861565b611f38919061483f565b6007556040518181526000907f7e9fbea655506e5a9e67dca69341fadbddee58b360cc1e2f888d0b5576febb8490602001611c5d565b6000546001600160a01b03163314611f985760405162461bcd60e51b8152600401610e4e90614734565b600254811015611ffd5760405162461bcd60e51b815260206004820152602a60248201527f43616e277420736574206d61784e756d506f6f6c73206c657373207468616e206044820152690e0deded898cadccee8d60b31b6064820152608401610e4e565b600955565b6000546001600160a01b0316331461202c5760405162461bcd60e51b8152600401610e4e90614734565b60085442106120905760405162461bcd60e51b815260206004820152602a60248201527f5052494d452061646472657373207570646174652077696e646f7720686173206044820152691a185cc81c185cdcd95960b21b6064820152608401610e4e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600b54600090610100900460ff16156121035760405162461bcd60e51b81526020600482015260136024820152721bdb949958d95a5d99481a5cc81b1bd8dad959606a1b6044820152606401610e4e565b5063bc197c8160e01b95945050505050565b6000546001600160a01b0316331461213f5760405162461bcd60e51b8152600401610e4e90614734565b60005b600c54811015612165576121558161193b565b61215e81614902565b9050612142565b5081601160008282546121789190614827565b92505081905550600c6040518060600160405280600081526020018481526020016121a542600d54613725565b9052815460018181018455600093845260209384902083516003909302019182559282015192810192909255604001516002909101556121e58282613735565b600c546001906121f69082906148bf565b60115460408051868152602081019290925260008051602061498383398151915291015b60405180910390a35050565b6000546001600160a01b031633146122505760405162461bcd60e51b8152600401610e4e90614734565b80821061226f5760405162461bcd60e51b8152600401610e4e90614769565b600d54421080612280575042600e54105b6122f25760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c79207570646174657320616674657220657468456e6454696d6573746160448201527f6d70206f72206265666f726520657468537461727454696d657374616d7000006064820152608401610e4e565b60005b600c54811015612340576123088161193b565b82600c828154811061231c5761231c614933565b600091825260209091206002600390920201015561233981614902565b90506122f5565b5034600f55600d829055600e81905561235982826148bf565b61236b670de0b6b3a764000034614861565b612375919061483f565b60105560408051348152602081018490529081018290526001907f72bb6e826d1a04bd8fa5fdde85546e3b9eb8e95d8500eec20f4c0124edcb422b90606001611892565b60005b81811015611134576123e58383838181106123d9576123d9614933565b90506020020135612a66565b6123ee81614902565b90506123bc565b6123fe8161193b565b6000818152600360209081526040808320338085529083528184208585526012845282852091855292528220600c805492939192612447919086908110610d2e57610d2e614933565b90506000670de0b6b3a7640000612467846000015484610d709190614880565b612471919061483f565b828455905080156124e657604051600090339083908381818185875af1925050503d80600081146124be576040519150601f19603f3d011682016040523d82523d6000602084013e6124c3565b606091505b50509050806124e45760405162461bcd60e51b8152600401610e4e90614706565b505b600185336001600160a01b03166000805160206149a38339815191528460405161251291815260200190565b60405180910390a45050505050565b6000546001600160a01b0316331461254b5760405162461bcd60e51b8152600401610e4e90614734565b81831061256a5760405162461bcd60e51b8152600401610e4e90614769565b60045442108061257b575042600554105b6125ed5760405162461bcd60e51b815260206004820152603860248201527f4f6e6c79207570646174657320616674657220656e6454696d657374616d702060448201527f6f72206265666f726520737461727454696d657374616d7000000000000000006064820152608401610e4e565b60005b60025481101561263b57612603816113ea565b836002828154811061261757612617614933565b600091825260209091206002600590920201015561263481614902565b90506125f0565b5060068190556004839055600582905561265583836148bf565b612667670de0b6b3a764000083614861565b612671919061483f565b60075560408051828152602081018590529081018390526000907f72bb6e826d1a04bd8fa5fdde85546e3b9eb8e95d8500eec20f4c0124edcb422b9060600160405180910390a2505050565b60608382146127195760405162461bcd60e51b815260206004820152602260248201527f7069647320616e6420616464726573736573206c656e677468206d69736d61746044820152610c6d60f31b6064820152608401610e4e565b6000846001600160401b0381111561273357612733614949565b60405190808252806020026020018201604052801561275c578160200160208202803683370190505b50905060005b8581101561280f576003600088888481811061278057612780614933565b90506020020135815260200190815260200160002060008686848181106127a9576127a9614933565b90506020020160208101906127be91906141db565b6001600160a01b03166001600160a01b03168152602001908152602001600020600001548282815181106127f4576127f4614933565b602090810291909101015261280881614902565b9050612762565b5095945050505050565b60005b818110156111345761284583838381811061283957612839614933565b90506020020135612a51565b61284e81614902565b905061281c565b6000546001600160a01b0316331461287f5760405162461bcd60e51b8152600401610e4e90614734565b6128876136f4565b806002838154811061289b5761289b614933565b906000526020600020906005020160010154600a546128ba91906148bf565b6128c49190614827565b600a8190555080600283815481106128de576128de614933565b90600052602060002090600502016001018190555060008260008051602061498383398151915283600a5460405161221a929190918252602082015260400190565b6000546001600160a01b0316331461294a5760405162461bcd60e51b8152600401610e4e90614734565b600b805460ff191682151590811790915560405160ff909116151581527f066381685e9b988004d0190e3e15af3526943a03d13d8a917b38b77f45d0a4d89060200160405180910390a150565b600081116129f35760405162461bcd60e51b815260206004820152602360248201527f537065636966792076616c696420746f6b656e20616d6f756e7420746f20636160448201526263686560e81b6064820152608401610e4e565b6129fc8261193b565b60008281526012602090815260408083203384529091529020600c8054612a2e9190859081106110f4576110f4614933565b816000016000828254612a4191906147e6565b9091555061113490508383613a6c565b612a5a81612a66565b612a63816123f5565b50565b612a6f816113ea565b6000818152600360209081526040808320338452909152812060028054919291612ac1919085908110612aa457612aa4614933565b60009182526020909120600590910201548354610d4b9190614861565b90506000670de0b6b3a7640000612ae1846001015484610d709190614880565b612aeb919061483f565b6001840183905590508015612b1157600154612b11906001600160a01b03163383613d60565b600084336001600160a01b03166000805160206149a383398151915284604051612b3d91815260200190565b60405180910390a450505050565b6000546001600160a01b03163314612b755760405162461bcd60e51b8152600401610e4e90614734565b60005b600c54811015612b9b57612b8b8161193b565b612b9481614902565b9050612b78565b5080600c8381548110612bb057612bb0614933565b906000526020600020906003020160010154601154612bcf91906148bf565b612bd99190614827565b60118190555080600c8381548110612bf357612bf3614933565b9060005260206000209060030201600101819055506001826000805160206149838339815191528360115460405161221a929190918252602082015260400190565b606060028281548110612c4a57612c4a614933565b9060005260206000209060050201600301805480602002602001604051908101604052809291908181526020018280548015612ca557602002820191906000526020600020905b815481526020019060010190808311612c91575b50505050509050919050565b600b54600090610100900460ff1615612d025760405162461bcd60e51b81526020600482015260136024820152721bdb949958d95a5d99481a5cc81b1bd8dad959606a1b6044820152606401610e4e565b5063f23a6e6160e01b95945050505050565b6000546001600160a01b03163314612d3e5760405162461bcd60e51b8152600401610e4e90614734565b6001600160a01b038116612da35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e4e565b612a6381613db2565b6000546001600160a01b03163314612dd65760405162461bcd60e51b8152600401610e4e90614734565b42600454108015612de8575060055442105b612e475760405162461bcd60e51b815260206004820152602a60248201527f43616e206f6e6c792072656d6f76655072696d65416d6f756e7420647572696e60448201526919c818481c195c9a5bd960b21b6064820152608401610e4e565b612e4f6136f4565b612e5b8160065461327a565b90508060066000828254612e6f91906148bf565b9091555050600554612e829042906148bf565b670de0b6b3a7640000600654612e989190614861565b612ea2919061483f565b6007556040518181526000907fb8f9e0ef8f651eda7570ff1a8ebe8a2acf07d57f7c18a9184d8e4395c2c82aa590602001611c5d565b60006001600160ff1b03821115612f425760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610e4e565b5090565b600080821215612f425760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610e4e565b612fa1826113ea565b6000828152600360209081526040808320338452909152812060028054919291612fd6919086908110612aa457612aa4614933565b90506000670de0b6b3a7640000612ff6846001015484610d709190614880565b613000919061483f565b905060006002868154811061301757613017614933565b9060005260206000209060050201600301805490506001600160401b0381111561304357613043614949565b60405190808252806020026020018201604052801561306c578160200160208202803683370190505b50905060005b81518110156130ab578582828151811061308e5761308e614933565b6020908102919091010152806130a381614902565b915050613072565b5084600287815481106130c0576130c0614933565b906000526020600020906005020160040160008282546130e091906148bf565b9250508190555061311a600287815481106130fd576130fd614933565b90600052602060002090600502016000015486610d4b9190614861565b6131249084614880565b600185015583548590859060009061313d9084906148bf565b9091555050811561315f5760015461315f906001600160a01b03163384613d60565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632eb2c2d6303360028a815481106131a3576131a3614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b81526004016131e5959493929190614651565b600060405180830381600087803b1580156131ff57600080fd5b505af1158015613213573d6000803e3d6000fd5b50506040518781528892503391507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a3600086336001600160a01b03166000805160206149a383398151915285604051610e8f91815260200190565b6000818310613289578161328b565b825b9392505050565b61329b826113ea565b6000828152600360209081526040808320338452909152812060028054919291859081106132cb576132cb614933565b9060005260206000209060050201600301805490506001600160401b038111156132f7576132f7614949565b604051908082528060200260200182016040528015613320578160200160208202803683370190505b50905060005b815181101561335f578382828151811061334257613342614933565b60209081029190910101528061335781614902565b915050613326565b50826002858154811061337457613374614933565b9060005260206000209060050201600401600082825461339491906148bf565b925050819055506133ce600285815481106133b1576133b1614933565b90600052602060002090600502016000015484610d4b9190614861565b8260010160008282546133e19190614880565b90915550508154839083906000906133fa9084906148bf565b925050819055507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632eb2c2d630336002888154811061344557613445614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b8152600401613487959493929190614651565b600060405180830381600087803b1580156134a157600080fd5b505af11580156134b5573d6000803e3d6000fd5b50506040518581528692503391507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a350505050565b60008181526003602090815260408083203384529091528120805460028054929391928590811061352a5761352a614933565b9060005260206000209060050201600301805490506001600160401b0381111561355657613556614949565b60405190808252806020026020018201604052801561357f578160200160208202803683370190505b50905060005b81518110156135be57828282815181106135a1576135a1614933565b6020908102919091010152806135b681614902565b915050613585565b5081600285815481106135d3576135d3614933565b906000526020600020906005020160040160008282546135f391906148bf565b90915550506000600184018190558355600280546001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691632eb2c2d691309133918990811061364c5761364c614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b815260040161368e959493929190614651565b600060405180830381600087803b1580156136a857600080fd5b505af11580156136bc573d6000803e3d6000fd5b50506040518481528692503391507fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595906020016134e9565b60006136ff60025490565b905060005b8181101561156757613715816113ea565b61371e81614902565b9050613704565b600081831015613289578161328b565b6000546001600160a01b0316331461375f5760405162461bcd60e51b8152600401610e4e90614734565b600954600254106137aa5760405162461bcd60e51b815260206004820152601560248201527413585e081b9d5b481c1bdbdb1cc81c995858da1959605a1b6044820152606401610e4e565b60008151116137fb5760405162461bcd60e51b815260206004820152601860248201527f546f6b656e4964732063616e6e6f7420626520656d70747900000000000000006044820152606401610e4e565b6000821161385c5760405162461bcd60e51b815260206004820152602860248201527f416c6c6f636174696f6e20706f696e742063616e6e6f742062652030206f72206044820152676e6567617469766560c01b6064820152608401610e4e565b60005b60025481101561394157613872816113ea565b8160405160200161388391906145ce565b60405160208183030381529060405280519060200120600282815481106138ac576138ac614933565b90600052602060002090600502016003016040516020016138cd9190614604565b6040516020818303038152906040528051906020012014156139315760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c20776974682073616d6520746f6b656e4964732065786973747300006044820152606401610e4e565b61393a81614902565b905061385f565b5081600a60008282546139549190614827565b9250508190555060026040518060a001604052806000815260200184815260200161398142600454613725565b81526020808201859052600060409283018190528454600181810187559582529082902084516005909202019081558382015194810194909455908201516002840155606082015180519293926139de9260038501920190614045565b50608091909101516004909101556002546139fb906001906148bf565b7f433d962a500f8c767748676218e15a2c52504785df1e3ea4a25d04926140609c82604051613a2a91906146e0565b60405180910390a2600254600090613a44906001906148bf565b600a54604080518681526020810192909252600080516020614983833981519152910161221a565b600b5460ff1615613ab35760405162461bcd60e51b815260206004820152601160248201527010d858da1a5b99c81a5cc81c185d5cd959607a1b6044820152606401610e4e565b60008111613b035760405162461bcd60e51b815260206004820152601d60248201527f537065636966792076616c696420616d6f756e7420746f2063616368650000006044820152606401610e4e565b613b0c826113ea565b600082815260036020908152604080832033845290915281206002805491929185908110613b3c57613b3c614933565b9060005260206000209060050201600301805490506001600160401b03811115613b6857613b68614949565b604051908082528060200260200182016040528015613b91578160200160208202803683370190505b50905060005b8151811015613bd05783828281518110613bb357613bb3614933565b602090810291909101015280613bc881614902565b915050613b97565b508260028581548110613be557613be5614933565b90600052602060002090600502016004016000828254613c059190614827565b9091555050815483908390600090613c1e908490614827565b92505081905550613c3b600285815481106133b1576133b1614933565b826001016000828254613c4e91906147e6565b9091555050600b805461ff0019169055600280546001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691632eb2c2d6913391309189908110613ca757613ca7614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b8152600401613ce9959493929190614651565b600060405180830381600087803b158015613d0357600080fd5b505af1158015613d17573d6000803e3d6000fd5b5050600b805461ff0019166101001790555050604051849033907fa1e3bbbdbb1b06b4311536b4174ea3f26a13cacad3a75aaada060941a0c9ab17906134e99087815260200190565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611134908490613e02565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000613e57826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613ed49092919063ffffffff16565b8051909150156111345780806020019051810190613e759190614402565b6111345760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e4e565b6060613ee38484600085613eeb565b949350505050565b606082471015613f4c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610e4e565b6001600160a01b0385163b613fa35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e4e565b600080866001600160a01b03168587604051613fbf9190614635565b60006040518083038185875af1925050503d8060008114613ffc576040519150601f19603f3d011682016040523d82523d6000602084013e614001565b606091505b50915091506112d58282866060831561401b57508161328b565b82511561402b5782518084602001fd5b8160405162461bcd60e51b8152600401610e4e91906146f3565b828054828255906000526020600020908101928215614080579160200282015b82811115614080578251825591602001919060010190614065565b50612f429291505b80821115612f425760008155600101614088565b60008083601f8401126140ae57600080fd5b5081356001600160401b038111156140c557600080fd5b6020830191508360208260051b85010111156140e057600080fd5b9250929050565b600082601f8301126140f857600080fd5b813560206001600160401b0382111561411357614113614949565b8160051b6141228282016147b6565b83815282810190868401838801850189101561413d57600080fd5b600093505b85841015614160578035835260019390930192918401918401614142565b50979650505050505050565b600082601f83011261417d57600080fd5b81356001600160401b0381111561419657614196614949565b6141a9601f8201601f19166020016147b6565b8181528460208386010111156141be57600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156141ed57600080fd5b813561328b8161495f565b6000806040838503121561420b57600080fd5b82356142168161495f565b946020939093013593505050565b600080600080600060a0868803121561423c57600080fd5b85356142478161495f565b945060208601356142578161495f565b935060408601356001600160401b038082111561427357600080fd5b61427f89838a016140e7565b9450606088013591508082111561429557600080fd5b6142a189838a016140e7565b935060808801359150808211156142b757600080fd5b506142c48882890161416c565b9150509295509295909350565b600080600080600060a086880312156142e957600080fd5b85356142f48161495f565b945060208601356143048161495f565b9350604086013592506060860135915060808601356001600160401b0381111561432d57600080fd5b6142c48882890161416c565b6000806020838503121561434c57600080fd5b82356001600160401b0381111561436257600080fd5b61436e8582860161409c565b90969095509350505050565b6000806000806040858703121561439057600080fd5b84356001600160401b03808211156143a757600080fd5b6143b38883890161409c565b909650945060208701359150808211156143cc57600080fd5b506143d98782880161409c565b95989497509550505050565b6000602082840312156143f757600080fd5b813561328b81614974565b60006020828403121561441457600080fd5b815161328b81614974565b60006020828403121561443157600080fd5b81356001600160e01b03198116811461328b57600080fd5b60008060006060848603121561445e57600080fd5b83356144698161495f565b925060208401356144798161495f565b929592945050506040919091013590565b60006020828403121561449c57600080fd5b5035919050565b600080604083850312156144b657600080fd5b8235915060208301356144c88161495f565b809150509250929050565b600080604083850312156144e657600080fd5b8235915060208301356001600160401b0381111561450357600080fd5b61450f858286016140e7565b9150509250929050565b6000806040838503121561452c57600080fd5b50508035926020909101359150565b60008060006060848603121561455057600080fd5b505081359360208301359350604090920135919050565b600081518084526020808501945080840160005b838110156145975781518752958201959082019060010161457b565b509495945050505050565b600081518084526145ba8160208601602086016148d6565b601f01601f19169290920160200192915050565b815160009082906020808601845b838110156145f8578151855293820193908201906001016145dc565b50929695505050505050565b60008183548391508460005260208060002060005b838110156145f857815485529382019360019182019101614619565b600082516146478184602087016148d6565b9190910192915050565b6001600160a01b038681168252851660208083019190915260a060408301819052855490830181905260008681528281209092909160c085019190845b818110156146aa5784548452600194850194938301930161468e565b50505083810360608501526146bf8187614567565b91505082810360808401526146d481856145a2565b98975050505050505050565b60208152600061328b6020830184614567565b60208152600061328b60208301846145a2565b6020808252601490820152732330b4b632b2103a379039b2b7321022ba3432b960611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602d908201527f656e6454696d657374616d702063616e74206265206c657373207468616e207360408201526c07461727454696d657374616d7609c1b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156147de576147de614949565b604052919050565b600080821280156001600160ff1b03849003851316156148085761480861491d565b600160ff1b83900384128116156148215761482161491d565b50500190565b6000821982111561483a5761483a61491d565b500190565b60008261485c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561487b5761487b61491d565b500290565b60008083128015600160ff1b85018412161561489e5761489e61491d565b6001600160ff1b03840183138116156148b9576148b961491d565b50500390565b6000828210156148d1576148d161491d565b500390565b60005b838110156148f15781810151838201526020016148d9565b83811115610c9c5750506000910152565b60006000198214156149165761491661491d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612a6357600080fd5b8015158114612a6357600080fdfec12a6201c487829aaa17c8698145154b8fb8c84945e43430f08a08b385ffa8e345c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef1a2646970667358221220f956a1e5e6a414867bafeaa09a19cf521f68c3a23e8e5d97849ef9b491c698b364736f6c63430008070033000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076be3b62873462d2142405439777e971754e8e77
Deployed Bytecode
0x6080604052600436106103cc5760003560e01c80637df6a6c8116101fd578063cc8ba18811610118578063e6fd48bc116100ab578063f15d6f9d1161007a578063f15d6f9d14610b75578063f23a6e6114610b95578063f2fde38b14610bb5578063f928603e14610bd5578063facf0073146105ac57600080fd5b8063e6fd48bc14610aff578063e729499a14610b15578063e7bcdafd14610b35578063edc1e62f14610b5557600080fd5b8063dc628aa4116100e7578063dc628aa414610a8a578063ddcb4b6814610aaa578063e1df480f14610aca578063e4f3ae4314610aea57600080fd5b8063cc8ba18814610a07578063cdeccabf14610a27578063d0fcca4114610a54578063d402518714610a6a57600080fd5b8063bc197c8111610190578063c98166c01161015f578063c98166c01461097d578063c9af39e214610993578063ca7238f2146109b3578063cbd99868146109e757600080fd5b8063bc197c81146108fb578063bec4d45414610934578063bee208851461094a578063c273c1c91461096a57600080fd5b8063a49596fd116101cc578063a49596fd14610878578063a85adeab146108b0578063ae1f071d146108c6578063b588d1c9146108db57600080fd5b80637df6a6c8146107fb578063811822e61461081b5780638da5cb5b1461083b578063a339bb461461085957600080fd5b806349e0b22d116102ed5780635b116ab8116102805780636c3fe0491161024f5780636c3fe0491461079a578063715018a6146107b057806371993130146107c557806372838d19146107db57600080fd5b80635b116ab8146106e65780635c5709ca146107065780636297d9f81461075a5780636af84fc01461077a57600080fd5b80635312ea8e116102bc5780635312ea8e1461067e57806353ae82f31461069e57806357a5b58c146106a657806359594888146106c657600080fd5b806349e0b22d146106085780634f94a8cd1461061e578063503690d11461063e57806351eb05a61461065e57600080fd5b806316a88aa3116103655780632fee4c87116103345780632fee4c87146105965780633f3a1f50146105ac578063441a3e70146105c8578063446a3c1f146105e857600080fd5b806316a88aa31461053057806317caf6f1146105465780631cb819ad1461055c5780632138c1aa1461057657600080fd5b80630b79ca87116103a15780630b79ca871461049857806312446f49146104ba5780631526fe27146104d057806315e8c7411461051057600080fd5b806217cd8b146103d15780626d0c1a1461040e57806301ffc9a714610449578063081e3eda14610479575b600080fd5b3480156103dd57600080fd5b506001546103f1906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561041a57600080fd5b5061042e61042936600461448a565b610bf5565b60408051938452602084019290925290820152606001610405565b34801561045557600080fd5b5061046961046436600461441f565b610c28565b6040519015158152602001610405565b34801561048557600080fd5b506002545b604051908152602001610405565b3480156104a457600080fd5b506104b86104b3366004614339565b610c5f565b005b3480156104c657600080fd5b5061048a60085481565b3480156104dc57600080fd5b506104f06104eb36600461448a565b610ca2565b604080519485526020850193909352918301526060820152608001610405565b34801561051c57600080fd5b506104b861052b366004614519565b610cdc565b34801561053c57600080fd5b5061048a600d5481565b34801561055257600080fd5b5061048a600a5481565b34801561056857600080fd5b50600b546104699060ff1681565b34801561058257600080fd5b5061048a6105913660046144a3565b610e9f565b3480156105a257600080fd5b5061048a60095481565b3480156105b857600080fd5b5061048a670de0b6b3a764000081565b3480156105d457600080fd5b506104b86105e3366004614519565b6110b9565b3480156105f457600080fd5b5061048a6106033660046144a3565b611139565b34801561061457600080fd5b5061048a600e5481565b34801561062a57600080fd5b506104b8610639366004614519565b6112e0565b34801561064a57600080fd5b506104b8610659366004614449565b61133e565b34801561066a57600080fd5b506104b861067936600461448a565b6113ea565b34801561068a57600080fd5b506104b861069936600461448a565b611542565b6104b861156b565b3480156106b257600080fd5b506104b86106c1366004614339565b6116a6565b3480156106d257600080fd5b506104b86106e136600461448a565b6116e3565b3480156106f257600080fd5b506104b86107013660046141f8565b61189e565b34801561071257600080fd5b506107456107213660046144a3565b60036020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610405565b34801561076657600080fd5b506104b861077536600461448a565b61193b565b34801561078657600080fd5b506104b861079536600461448a565b611b48565b3480156107a657600080fd5b5061048a60115481565b3480156107bc57600080fd5b506104b8611c68565b3480156107d157600080fd5b5061048a60075481565b3480156107e757600080fd5b506104b86107f636600461448a565b611cda565b34801561080757600080fd5b506104b861081636600461448a565b611e2e565b34801561082757600080fd5b506104b861083636600461448a565b611f6e565b34801561084757600080fd5b506000546001600160a01b03166103f1565b34801561086557600080fd5b50600b5461046990610100900460ff1681565b34801561088457600080fd5b5061048a6108933660046144a3565b601260209081526000928352604080842090915290825290205481565b3480156108bc57600080fd5b5061048a60055481565b3480156108d257600080fd5b5061048a600181565b3480156108e757600080fd5b506104b86108f63660046141db565b612002565b34801561090757600080fd5b5061091b610916366004614224565b6120b2565b6040516001600160e01b03199091168152602001610405565b34801561094057600080fd5b5061048a60065481565b34801561095657600080fd5b506104b86109653660046144d3565b612115565b6104b8610978366004614519565b612226565b34801561098957600080fd5b5061048a600f5481565b34801561099f57600080fd5b506104b86109ae366004614339565b6123b9565b3480156109bf57600080fd5b506103f17f00000000000000000000000076be3b62873462d2142405439777e971754e8e7781565b3480156109f357600080fd5b506104b8610a0236600461448a565b6123f5565b348015610a1357600080fd5b506104b8610a2236600461453b565b612521565b348015610a3357600080fd5b50610a47610a4236600461437a565b6126bd565b60405161040591906146e0565b348015610a6057600080fd5b5061048a60105481565b348015610a7657600080fd5b506104b8610a85366004614339565b612819565b348015610a9657600080fd5b506104b8610aa5366004614519565b612855565b348015610ab657600080fd5b506104b8610ac53660046143e5565b612920565b348015610ad657600080fd5b506104b8610ae5366004614519565b612997565b348015610af657600080fd5b5061048a600081565b348015610b0b57600080fd5b5061048a60045481565b348015610b2157600080fd5b506104b8610b3036600461448a565b612a51565b348015610b4157600080fd5b506104b8610b5036600461448a565b612a66565b348015610b6157600080fd5b506104b8610b70366004614519565b612b4b565b348015610b8157600080fd5b50610a47610b9036600461448a565b612c35565b348015610ba157600080fd5b5061091b610bb03660046142d1565b612cb1565b348015610bc157600080fd5b506104b8610bd03660046141db565b612d14565b348015610be157600080fd5b506104b8610bf036600461448a565b612dac565b600c8181548110610c0557600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b60006001600160e01b03198216630271189760e51b1480610c5957506301ffc9a760e01b6001600160e01b03198316145b92915050565b8060005b81811015610c9c57610c8c848483818110610c8057610c80614933565b9050602002013561193b565b610c9581614902565b9050610c63565b50505050565b60028181548110610cb257600080fd5b60009182526020909120600590910201805460018201546002830154600490930154919350919084565b610ce58261193b565b6000828152600360209081526040808320338085529083528184208685526012845282852091855292528220600c805492939192610d50919087908110610d2e57610d2e614933565b60009182526020909120600390910201548454610d4b9190614861565b612ed8565b90506000670de0b6b3a7640000610d75846000015484610d709190614880565b612f46565b610d7f919061483f565b9050610db4600c8781548110610d9757610d97614933565b90600052602060002090600302016000015486610d4b9190614861565b610dbe9083614880565b83558015610e5957604051600090339083908381818185875af1925050503d8060008114610e08576040519150601f19603f3d011682016040523d82523d6000602084013e610e0d565b606091505b5050905080610e575760405162461bcd60e51b815260206004820152601160248201527008ae4e4dee440e6cadcc8d2dcce40cae8d607b1b60448201526064015b60405180910390fd5b505b610e638686612f98565b600186336001600160a01b03166000805160206149a383398151915284604051610e8f91815260200190565b60405180910390a4505050505050565b60008060028481548110610eb557610eb5614933565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015610f3b57602002820191906000526020600020905b815481526020019060010190808311610f27575b50505091835250506004919091015460209182015260008681526003825260408082206001600160a01b0388168352909252908120600c8054939450909287908110610f8957610f89614933565b60009182526020808320604080516060810182526003909402909101805484526001810154848401526002015483820152898452601282528084206001600160a01b038a16855290915290912081516080860151600d5493945091929091904210801590610ffa5750428460400151105b80156110065750600081115b1561107757600061101942600e5461327a565b9050600085604001518261102d91906148bf565b905060006011548760200151601054846110479190614861565b6110519190614861565b61105b919061483f565b9050611067848261483f565b6110719086614827565b94505050505b82548554670de0b6b3a7640000916110a29161109890610d4b908790614861565b610d709190614880565b6110ac919061483f565b9998505050505050505050565b6110c28261193b565b60008281526012602090815260408083203384529091529020600c80546111119190859081106110f4576110f4614933565b90600052602060002090600302016000015483610d4b9190614861565b8160000160008282546111249190614880565b9091555061113490508383613292565b505050565b6000806002848154811061114f5761114f614933565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156111d557602002820191906000526020600020905b8154815260200190600101908083116111c1575b505050918352505060049182015460209182015260008781526003825260408082206001600160a01b0389168352909252208251608084015192549394509092909190421080159061122a5750428460400151105b80156112365750600081115b156112a75760006112494260055461327a565b9050600085604001518261125d91906148bf565b90506000600a548760200151600754846112779190614861565b6112819190614861565b61128b919061483f565b9050611297848261483f565b6112a19086614827565b94505050505b670de0b6b3a76400006112cb8460010154611098858760000154610d4b9190614861565b6112d5919061483f565b979650505050505050565b6112e98261193b565b60008281526012602090815260408083203384529091529020600c805461131b9190859081106110f4576110f4614933565b81600001600082825461132e9190614880565b9091555061113490508383612f98565b6000546001600160a01b031633146113685760405162461bcd60e51b8152600401610e4e90614734565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb90604401602060405180830381600087803b1580156113b257600080fd5b505af11580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9c9190614402565b6000600282815481106113ff576113ff614933565b90600052602060002090600502019050426004541180611423575042816002015410155b8061143957506004541580156114395750600554155b15611442575050565b60006114504260055461327a565b600483015460028401549192509060009061146b90846148bf565b90506000600a548560010154600754846114859190614861565b61148f9190614861565b611499919061483f565b90506114ad670de0b6b3a76400008261483f565b600660008282546114be91906148bf565b909155505082156114ec576114d3838261483f565b8560000160008282546114e69190614827565b90915550505b6002850184905584546040805186815260208101869052808201929092525160009188917fc75b283f14d0a806c63b93a3659ed39c43a20bf0fff8030465e93d79e91ca40f9181900360600190a3505050505050565b60008181526012602090815260408083203384529091528120908155611567826134f7565b5050565b6000546001600160a01b031633146115955760405162461bcd60e51b8152600401610e4e90614734565b42600d541080156115a75750600e5442105b6115ff5760405162461bcd60e51b815260206004820152602360248201527f43616e206f6e6c7920616464457468416d6f756e7420647572696e67207065726044820152621a5bd960ea1b6064820152608401610e4e565b60005b600c54811015611625576116158161193b565b61161e81614902565b9050611602565b5034600f60008282546116389190614827565b9091555050600e5461164b9042906148bf565b670de0b6b3a7640000600f546116619190614861565b61166b919061483f565b6010556040513481526001907f4dffb45d6f962f8af66e8c830a9a6027cea8919fd29147db4be34dadb0fb5f1e9060200160405180910390a2565b8060005b81811015610c9c576116d38484838181106116c7576116c7614933565b905060200201356113ea565b6116dc81614902565b90506116aa565b6000546001600160a01b0316331461170d5760405162461bcd60e51b8152600401610e4e90614734565b42600d5410801561171f5750600e5442105b61177a5760405162461bcd60e51b815260206004820152602660248201527f43616e206f6e6c792072656d6f7665457468416d6f756e7420647572696e67206044820152651c195c9a5bd960d21b6064820152608401610e4e565b60005b600c548110156117a0576117908161193b565b61179981614902565b905061177d565b506117ad81600f5461327a565b905080600f60008282546117c191906148bf565b9091555050600e546117d49042906148bf565b670de0b6b3a7640000600f546117ea9190614861565b6117f4919061483f565b601055604051600090339083908381818185875af1925050503d8060008114611839576040519150601f19603f3d011682016040523d82523d6000602084013e61183e565b606091505b505090508061185f5760405162461bcd60e51b8152600401610e4e90614706565b60017fb8f9e0ef8f651eda7570ff1a8ebe8a2acf07d57f7c18a9184d8e4395c2c82aa58360405161189291815260200190565b60405180910390a25050565b6000546001600160a01b031633146118c85760405162461bcd60e51b8152600401610e4e90614734565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611915576040519150601f19603f3d011682016040523d82523d6000602084013e61191a565b606091505b50509050806111345760405162461bcd60e51b8152600401610e4e90614706565b60006002828154811061195057611950614933565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156119d657602002820191906000526020600020905b8154815260200190600101908083116119c2575b5050505050815260200160048201548152505090506000600c8381548110611a0057611a00614933565b9060005260206000209060030201905060008260800151905042600d541180611a2d575042826002015410155b80611a435750600d54158015611a435750600e54155b15611a4e5750505050565b6000611a5c42600e5461327a565b90506000836002015482611a7091906148bf565b90506000601154856001015460105484611a8a9190614861565b611a949190614861565b611a9e919061483f565b9050611ab2670de0b6b3a76400008261483f565b600f6000828254611ac391906148bf565b90915550508315611af157611ad8848261483f565b856000016000828254611aeb9190614827565b90915550505b6002850183905584546040805185815260208101879052808201929092525160019189917fc75b283f14d0a806c63b93a3659ed39c43a20bf0fff8030465e93d79e91ca40f9181900360600190a350505050505050565b6000546001600160a01b03163314611b725760405162461bcd60e51b8152600401610e4e90614734565b42600454108015611b84575060055442105b611bde5760405162461bcd60e51b815260206004820152602560248201527f43616e206f6e6c79206164645072696d65416d6f756e7420647572696e672070604482015264195c9a5bd960da1b6064820152608401610e4e565b611be66136f4565b8060066000828254611bf89190614827565b9091555050600554611c0b9042906148bf565b670de0b6b3a7640000600654611c219190614861565b611c2b919061483f565b6007556040518181526000907f4dffb45d6f962f8af66e8c830a9a6027cea8919fd29147db4be34dadb0fb5f1e906020015b60405180910390a250565b6000546001600160a01b03163314611c925760405162461bcd60e51b8152600401610e4e90614734565b60405162461bcd60e51b815260206004820152601d60248201527f4f776e6572736869702063616e6e6f742062652072656e6f756e6365640000006044820152606401610e4e565b6000546001600160a01b03163314611d045760405162461bcd60e51b8152600401610e4e90614734565b42600d5410611d555760405162461bcd60e51b815260206004820152601e60248201527f43616368696e6720706572696f6420686173206e6f74207374617274656400006044820152606401610e4e565b804210611d9c5760405162461bcd60e51b81526020600482015260156024820152740696e76616c696420656e642074696d657374616d7605c1b6044820152606401610e4e565b60005b600c54811015611dc257611db28161193b565b611dbb81614902565b9050611d9f565b5042600d819055600e829055611dd890826148bf565b670de0b6b3a7640000600f54611dee9190614861565b611df8919061483f565b6010556040518181526001907f7e9fbea655506e5a9e67dca69341fadbddee58b360cc1e2f888d0b5576febb8490602001611c5d565b6000546001600160a01b03163314611e585760405162461bcd60e51b8152600401610e4e90614734565b4260045410611eb45760405162461bcd60e51b815260206004820152602260248201527f63616368696e6720706572696f6420686173206e6f7420737461727465642079604482015261195d60f21b6064820152608401610e4e565b804210611efb5760405162461bcd60e51b81526020600482015260156024820152740696e76616c696420656e642074696d657374616d7605c1b6044820152606401610e4e565b611f036136f4565b4260048190556005829055611f1890826148bf565b670de0b6b3a7640000600654611f2e9190614861565b611f38919061483f565b6007556040518181526000907f7e9fbea655506e5a9e67dca69341fadbddee58b360cc1e2f888d0b5576febb8490602001611c5d565b6000546001600160a01b03163314611f985760405162461bcd60e51b8152600401610e4e90614734565b600254811015611ffd5760405162461bcd60e51b815260206004820152602a60248201527f43616e277420736574206d61784e756d506f6f6c73206c657373207468616e206044820152690e0deded898cadccee8d60b31b6064820152608401610e4e565b600955565b6000546001600160a01b0316331461202c5760405162461bcd60e51b8152600401610e4e90614734565b60085442106120905760405162461bcd60e51b815260206004820152602a60248201527f5052494d452061646472657373207570646174652077696e646f7720686173206044820152691a185cc81c185cdcd95960b21b6064820152608401610e4e565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600b54600090610100900460ff16156121035760405162461bcd60e51b81526020600482015260136024820152721bdb949958d95a5d99481a5cc81b1bd8dad959606a1b6044820152606401610e4e565b5063bc197c8160e01b95945050505050565b6000546001600160a01b0316331461213f5760405162461bcd60e51b8152600401610e4e90614734565b60005b600c54811015612165576121558161193b565b61215e81614902565b9050612142565b5081601160008282546121789190614827565b92505081905550600c6040518060600160405280600081526020018481526020016121a542600d54613725565b9052815460018181018455600093845260209384902083516003909302019182559282015192810192909255604001516002909101556121e58282613735565b600c546001906121f69082906148bf565b60115460408051868152602081019290925260008051602061498383398151915291015b60405180910390a35050565b6000546001600160a01b031633146122505760405162461bcd60e51b8152600401610e4e90614734565b80821061226f5760405162461bcd60e51b8152600401610e4e90614769565b600d54421080612280575042600e54105b6122f25760405162461bcd60e51b815260206004820152603e60248201527f4f6e6c79207570646174657320616674657220657468456e6454696d6573746160448201527f6d70206f72206265666f726520657468537461727454696d657374616d7000006064820152608401610e4e565b60005b600c54811015612340576123088161193b565b82600c828154811061231c5761231c614933565b600091825260209091206002600390920201015561233981614902565b90506122f5565b5034600f55600d829055600e81905561235982826148bf565b61236b670de0b6b3a764000034614861565b612375919061483f565b60105560408051348152602081018490529081018290526001907f72bb6e826d1a04bd8fa5fdde85546e3b9eb8e95d8500eec20f4c0124edcb422b90606001611892565b60005b81811015611134576123e58383838181106123d9576123d9614933565b90506020020135612a66565b6123ee81614902565b90506123bc565b6123fe8161193b565b6000818152600360209081526040808320338085529083528184208585526012845282852091855292528220600c805492939192612447919086908110610d2e57610d2e614933565b90506000670de0b6b3a7640000612467846000015484610d709190614880565b612471919061483f565b828455905080156124e657604051600090339083908381818185875af1925050503d80600081146124be576040519150601f19603f3d011682016040523d82523d6000602084013e6124c3565b606091505b50509050806124e45760405162461bcd60e51b8152600401610e4e90614706565b505b600185336001600160a01b03166000805160206149a38339815191528460405161251291815260200190565b60405180910390a45050505050565b6000546001600160a01b0316331461254b5760405162461bcd60e51b8152600401610e4e90614734565b81831061256a5760405162461bcd60e51b8152600401610e4e90614769565b60045442108061257b575042600554105b6125ed5760405162461bcd60e51b815260206004820152603860248201527f4f6e6c79207570646174657320616674657220656e6454696d657374616d702060448201527f6f72206265666f726520737461727454696d657374616d7000000000000000006064820152608401610e4e565b60005b60025481101561263b57612603816113ea565b836002828154811061261757612617614933565b600091825260209091206002600590920201015561263481614902565b90506125f0565b5060068190556004839055600582905561265583836148bf565b612667670de0b6b3a764000083614861565b612671919061483f565b60075560408051828152602081018590529081018390526000907f72bb6e826d1a04bd8fa5fdde85546e3b9eb8e95d8500eec20f4c0124edcb422b9060600160405180910390a2505050565b60608382146127195760405162461bcd60e51b815260206004820152602260248201527f7069647320616e6420616464726573736573206c656e677468206d69736d61746044820152610c6d60f31b6064820152608401610e4e565b6000846001600160401b0381111561273357612733614949565b60405190808252806020026020018201604052801561275c578160200160208202803683370190505b50905060005b8581101561280f576003600088888481811061278057612780614933565b90506020020135815260200190815260200160002060008686848181106127a9576127a9614933565b90506020020160208101906127be91906141db565b6001600160a01b03166001600160a01b03168152602001908152602001600020600001548282815181106127f4576127f4614933565b602090810291909101015261280881614902565b9050612762565b5095945050505050565b60005b818110156111345761284583838381811061283957612839614933565b90506020020135612a51565b61284e81614902565b905061281c565b6000546001600160a01b0316331461287f5760405162461bcd60e51b8152600401610e4e90614734565b6128876136f4565b806002838154811061289b5761289b614933565b906000526020600020906005020160010154600a546128ba91906148bf565b6128c49190614827565b600a8190555080600283815481106128de576128de614933565b90600052602060002090600502016001018190555060008260008051602061498383398151915283600a5460405161221a929190918252602082015260400190565b6000546001600160a01b0316331461294a5760405162461bcd60e51b8152600401610e4e90614734565b600b805460ff191682151590811790915560405160ff909116151581527f066381685e9b988004d0190e3e15af3526943a03d13d8a917b38b77f45d0a4d89060200160405180910390a150565b600081116129f35760405162461bcd60e51b815260206004820152602360248201527f537065636966792076616c696420746f6b656e20616d6f756e7420746f20636160448201526263686560e81b6064820152608401610e4e565b6129fc8261193b565b60008281526012602090815260408083203384529091529020600c8054612a2e9190859081106110f4576110f4614933565b816000016000828254612a4191906147e6565b9091555061113490508383613a6c565b612a5a81612a66565b612a63816123f5565b50565b612a6f816113ea565b6000818152600360209081526040808320338452909152812060028054919291612ac1919085908110612aa457612aa4614933565b60009182526020909120600590910201548354610d4b9190614861565b90506000670de0b6b3a7640000612ae1846001015484610d709190614880565b612aeb919061483f565b6001840183905590508015612b1157600154612b11906001600160a01b03163383613d60565b600084336001600160a01b03166000805160206149a383398151915284604051612b3d91815260200190565b60405180910390a450505050565b6000546001600160a01b03163314612b755760405162461bcd60e51b8152600401610e4e90614734565b60005b600c54811015612b9b57612b8b8161193b565b612b9481614902565b9050612b78565b5080600c8381548110612bb057612bb0614933565b906000526020600020906003020160010154601154612bcf91906148bf565b612bd99190614827565b60118190555080600c8381548110612bf357612bf3614933565b9060005260206000209060030201600101819055506001826000805160206149838339815191528360115460405161221a929190918252602082015260400190565b606060028281548110612c4a57612c4a614933565b9060005260206000209060050201600301805480602002602001604051908101604052809291908181526020018280548015612ca557602002820191906000526020600020905b815481526020019060010190808311612c91575b50505050509050919050565b600b54600090610100900460ff1615612d025760405162461bcd60e51b81526020600482015260136024820152721bdb949958d95a5d99481a5cc81b1bd8dad959606a1b6044820152606401610e4e565b5063f23a6e6160e01b95945050505050565b6000546001600160a01b03163314612d3e5760405162461bcd60e51b8152600401610e4e90614734565b6001600160a01b038116612da35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e4e565b612a6381613db2565b6000546001600160a01b03163314612dd65760405162461bcd60e51b8152600401610e4e90614734565b42600454108015612de8575060055442105b612e475760405162461bcd60e51b815260206004820152602a60248201527f43616e206f6e6c792072656d6f76655072696d65416d6f756e7420647572696e60448201526919c818481c195c9a5bd960b21b6064820152608401610e4e565b612e4f6136f4565b612e5b8160065461327a565b90508060066000828254612e6f91906148bf565b9091555050600554612e829042906148bf565b670de0b6b3a7640000600654612e989190614861565b612ea2919061483f565b6007556040518181526000907fb8f9e0ef8f651eda7570ff1a8ebe8a2acf07d57f7c18a9184d8e4395c2c82aa590602001611c5d565b60006001600160ff1b03821115612f425760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610e4e565b5090565b600080821215612f425760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610e4e565b612fa1826113ea565b6000828152600360209081526040808320338452909152812060028054919291612fd6919086908110612aa457612aa4614933565b90506000670de0b6b3a7640000612ff6846001015484610d709190614880565b613000919061483f565b905060006002868154811061301757613017614933565b9060005260206000209060050201600301805490506001600160401b0381111561304357613043614949565b60405190808252806020026020018201604052801561306c578160200160208202803683370190505b50905060005b81518110156130ab578582828151811061308e5761308e614933565b6020908102919091010152806130a381614902565b915050613072565b5084600287815481106130c0576130c0614933565b906000526020600020906005020160040160008282546130e091906148bf565b9250508190555061311a600287815481106130fd576130fd614933565b90600052602060002090600502016000015486610d4b9190614861565b6131249084614880565b600185015583548590859060009061313d9084906148bf565b9091555050811561315f5760015461315f906001600160a01b03163384613d60565b7f00000000000000000000000076be3b62873462d2142405439777e971754e8e776001600160a01b0316632eb2c2d6303360028a815481106131a3576131a3614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b81526004016131e5959493929190614651565b600060405180830381600087803b1580156131ff57600080fd5b505af1158015613213573d6000803e3d6000fd5b50506040518781528892503391507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a3600086336001600160a01b03166000805160206149a383398151915285604051610e8f91815260200190565b6000818310613289578161328b565b825b9392505050565b61329b826113ea565b6000828152600360209081526040808320338452909152812060028054919291859081106132cb576132cb614933565b9060005260206000209060050201600301805490506001600160401b038111156132f7576132f7614949565b604051908082528060200260200182016040528015613320578160200160208202803683370190505b50905060005b815181101561335f578382828151811061334257613342614933565b60209081029190910101528061335781614902565b915050613326565b50826002858154811061337457613374614933565b9060005260206000209060050201600401600082825461339491906148bf565b925050819055506133ce600285815481106133b1576133b1614933565b90600052602060002090600502016000015484610d4b9190614861565b8260010160008282546133e19190614880565b90915550508154839083906000906133fa9084906148bf565b925050819055507f00000000000000000000000076be3b62873462d2142405439777e971754e8e776001600160a01b0316632eb2c2d630336002888154811061344557613445614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b8152600401613487959493929190614651565b600060405180830381600087803b1580156134a157600080fd5b505af11580156134b5573d6000803e3d6000fd5b50506040518581528692503391507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568906020015b60405180910390a350505050565b60008181526003602090815260408083203384529091528120805460028054929391928590811061352a5761352a614933565b9060005260206000209060050201600301805490506001600160401b0381111561355657613556614949565b60405190808252806020026020018201604052801561357f578160200160208202803683370190505b50905060005b81518110156135be57828282815181106135a1576135a1614933565b6020908102919091010152806135b681614902565b915050613585565b5081600285815481106135d3576135d3614933565b906000526020600020906005020160040160008282546135f391906148bf565b90915550506000600184018190558355600280546001600160a01b037f00000000000000000000000076be3b62873462d2142405439777e971754e8e771691632eb2c2d691309133918990811061364c5761364c614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b815260040161368e959493929190614651565b600060405180830381600087803b1580156136a857600080fd5b505af11580156136bc573d6000803e3d6000fd5b50506040518481528692503391507fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595906020016134e9565b60006136ff60025490565b905060005b8181101561156757613715816113ea565b61371e81614902565b9050613704565b600081831015613289578161328b565b6000546001600160a01b0316331461375f5760405162461bcd60e51b8152600401610e4e90614734565b600954600254106137aa5760405162461bcd60e51b815260206004820152601560248201527413585e081b9d5b481c1bdbdb1cc81c995858da1959605a1b6044820152606401610e4e565b60008151116137fb5760405162461bcd60e51b815260206004820152601860248201527f546f6b656e4964732063616e6e6f7420626520656d70747900000000000000006044820152606401610e4e565b6000821161385c5760405162461bcd60e51b815260206004820152602860248201527f416c6c6f636174696f6e20706f696e742063616e6e6f742062652030206f72206044820152676e6567617469766560c01b6064820152608401610e4e565b60005b60025481101561394157613872816113ea565b8160405160200161388391906145ce565b60405160208183030381529060405280519060200120600282815481106138ac576138ac614933565b90600052602060002090600502016003016040516020016138cd9190614604565b6040516020818303038152906040528051906020012014156139315760405162461bcd60e51b815260206004820152601e60248201527f506f6f6c20776974682073616d6520746f6b656e4964732065786973747300006044820152606401610e4e565b61393a81614902565b905061385f565b5081600a60008282546139549190614827565b9250508190555060026040518060a001604052806000815260200184815260200161398142600454613725565b81526020808201859052600060409283018190528454600181810187559582529082902084516005909202019081558382015194810194909455908201516002840155606082015180519293926139de9260038501920190614045565b50608091909101516004909101556002546139fb906001906148bf565b7f433d962a500f8c767748676218e15a2c52504785df1e3ea4a25d04926140609c82604051613a2a91906146e0565b60405180910390a2600254600090613a44906001906148bf565b600a54604080518681526020810192909252600080516020614983833981519152910161221a565b600b5460ff1615613ab35760405162461bcd60e51b815260206004820152601160248201527010d858da1a5b99c81a5cc81c185d5cd959607a1b6044820152606401610e4e565b60008111613b035760405162461bcd60e51b815260206004820152601d60248201527f537065636966792076616c696420616d6f756e7420746f2063616368650000006044820152606401610e4e565b613b0c826113ea565b600082815260036020908152604080832033845290915281206002805491929185908110613b3c57613b3c614933565b9060005260206000209060050201600301805490506001600160401b03811115613b6857613b68614949565b604051908082528060200260200182016040528015613b91578160200160208202803683370190505b50905060005b8151811015613bd05783828281518110613bb357613bb3614933565b602090810291909101015280613bc881614902565b915050613b97565b508260028581548110613be557613be5614933565b90600052602060002090600502016004016000828254613c059190614827565b9091555050815483908390600090613c1e908490614827565b92505081905550613c3b600285815481106133b1576133b1614933565b826001016000828254613c4e91906147e6565b9091555050600b805461ff0019169055600280546001600160a01b037f00000000000000000000000076be3b62873462d2142405439777e971754e8e771691632eb2c2d6913391309189908110613ca757613ca7614933565b906000526020600020906005020160030185604051806020016040528060008152506040518663ffffffff1660e01b8152600401613ce9959493929190614651565b600060405180830381600087803b158015613d0357600080fd5b505af1158015613d17573d6000803e3d6000fd5b5050600b805461ff0019166101001790555050604051849033907fa1e3bbbdbb1b06b4311536b4174ea3f26a13cacad3a75aaada060941a0c9ab17906134e99087815260200190565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611134908490613e02565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000613e57826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613ed49092919063ffffffff16565b8051909150156111345780806020019051810190613e759190614402565b6111345760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e4e565b6060613ee38484600085613eeb565b949350505050565b606082471015613f4c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610e4e565b6001600160a01b0385163b613fa35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e4e565b600080866001600160a01b03168587604051613fbf9190614635565b60006040518083038185875af1925050503d8060008114613ffc576040519150601f19603f3d011682016040523d82523d6000602084013e614001565b606091505b50915091506112d58282866060831561401b57508161328b565b82511561402b5782518084602001fd5b8160405162461bcd60e51b8152600401610e4e91906146f3565b828054828255906000526020600020908101928215614080579160200282015b82811115614080578251825591602001919060010190614065565b50612f429291505b80821115612f425760008155600101614088565b60008083601f8401126140ae57600080fd5b5081356001600160401b038111156140c557600080fd5b6020830191508360208260051b85010111156140e057600080fd5b9250929050565b600082601f8301126140f857600080fd5b813560206001600160401b0382111561411357614113614949565b8160051b6141228282016147b6565b83815282810190868401838801850189101561413d57600080fd5b600093505b85841015614160578035835260019390930192918401918401614142565b50979650505050505050565b600082601f83011261417d57600080fd5b81356001600160401b0381111561419657614196614949565b6141a9601f8201601f19166020016147b6565b8181528460208386010111156141be57600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156141ed57600080fd5b813561328b8161495f565b6000806040838503121561420b57600080fd5b82356142168161495f565b946020939093013593505050565b600080600080600060a0868803121561423c57600080fd5b85356142478161495f565b945060208601356142578161495f565b935060408601356001600160401b038082111561427357600080fd5b61427f89838a016140e7565b9450606088013591508082111561429557600080fd5b6142a189838a016140e7565b935060808801359150808211156142b757600080fd5b506142c48882890161416c565b9150509295509295909350565b600080600080600060a086880312156142e957600080fd5b85356142f48161495f565b945060208601356143048161495f565b9350604086013592506060860135915060808601356001600160401b0381111561432d57600080fd5b6142c48882890161416c565b6000806020838503121561434c57600080fd5b82356001600160401b0381111561436257600080fd5b61436e8582860161409c565b90969095509350505050565b6000806000806040858703121561439057600080fd5b84356001600160401b03808211156143a757600080fd5b6143b38883890161409c565b909650945060208701359150808211156143cc57600080fd5b506143d98782880161409c565b95989497509550505050565b6000602082840312156143f757600080fd5b813561328b81614974565b60006020828403121561441457600080fd5b815161328b81614974565b60006020828403121561443157600080fd5b81356001600160e01b03198116811461328b57600080fd5b60008060006060848603121561445e57600080fd5b83356144698161495f565b925060208401356144798161495f565b929592945050506040919091013590565b60006020828403121561449c57600080fd5b5035919050565b600080604083850312156144b657600080fd5b8235915060208301356144c88161495f565b809150509250929050565b600080604083850312156144e657600080fd5b8235915060208301356001600160401b0381111561450357600080fd5b61450f858286016140e7565b9150509250929050565b6000806040838503121561452c57600080fd5b50508035926020909101359150565b60008060006060848603121561455057600080fd5b505081359360208301359350604090920135919050565b600081518084526020808501945080840160005b838110156145975781518752958201959082019060010161457b565b509495945050505050565b600081518084526145ba8160208601602086016148d6565b601f01601f19169290920160200192915050565b815160009082906020808601845b838110156145f8578151855293820193908201906001016145dc565b50929695505050505050565b60008183548391508460005260208060002060005b838110156145f857815485529382019360019182019101614619565b600082516146478184602087016148d6565b9190910192915050565b6001600160a01b038681168252851660208083019190915260a060408301819052855490830181905260008681528281209092909160c085019190845b818110156146aa5784548452600194850194938301930161468e565b50505083810360608501526146bf8187614567565b91505082810360808401526146d481856145a2565b98975050505050505050565b60208152600061328b6020830184614567565b60208152600061328b60208301846145a2565b6020808252601490820152732330b4b632b2103a379039b2b7321022ba3432b960611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602d908201527f656e6454696d657374616d702063616e74206265206c657373207468616e207360408201526c07461727454696d657374616d7609c1b606082015260800190565b604051601f8201601f191681016001600160401b03811182821017156147de576147de614949565b604052919050565b600080821280156001600160ff1b03849003851316156148085761480861491d565b600160ff1b83900384128116156148215761482161491d565b50500190565b6000821982111561483a5761483a61491d565b500190565b60008261485c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561487b5761487b61491d565b500290565b60008083128015600160ff1b85018412161561489e5761489e61491d565b6001600160ff1b03840183138116156148b9576148b961491d565b50500390565b6000828210156148d1576148d161491d565b500390565b60005b838110156148f15781810151838201526020016148d9565b83811115610c9c5750506000910152565b60006000198214156149165761491661491d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612a6357600080fd5b8015158114612a6357600080fdfec12a6201c487829aaa17c8698145154b8fb8c84945e43430f08a08b385ffa8e345c072aa05b9853b5a993de7a28bc332ee01404a628cec1a23ce0f659f842ef1a2646970667358221220f956a1e5e6a414867bafeaa09a19cf521f68c3a23e8e5d97849ef9b491c698b364736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076be3b62873462d2142405439777e971754e8e77
-----Decoded View---------------
Arg [0] : _prime (address): 0x0000000000000000000000000000000000000000
Arg [1] : _parallelAlpha (address): 0x76BE3b62873462d2142405439777e971754E8E77
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 00000000000000000000000076be3b62873462d2142405439777e971754e8e77
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.