Source Code
Latest 25 from a total of 3,735 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Harvest Bulk | 8814056 | 495 days ago | IN | 0 ETH | 0.00000419 | ||||
| Harvest | 8814017 | 495 days ago | IN | 0 ETH | 0.00000067 | ||||
| Mass Update Pool... | 8813960 | 495 days ago | IN | 0 ETH | 0.00000209 | ||||
| Deposit | 7215026 | 532 days ago | IN | 0 ETH | 0.00000037 | ||||
| Harvest | 7214949 | 532 days ago | IN | 0 ETH | 0.00000026 | ||||
| Harvest | 7214908 | 532 days ago | IN | 0 ETH | 0.0000003 | ||||
| Harvest | 7192571 | 533 days ago | IN | 0 ETH | 0.00000025 | ||||
| Harvest | 7192570 | 533 days ago | IN | 0 ETH | 0.00000025 | ||||
| Harvest | 7192550 | 533 days ago | IN | 0 ETH | 0.00000025 | ||||
| Harvest | 7192527 | 533 days ago | IN | 0 ETH | 0.00000011 | ||||
| Withdraw | 7150897 | 534 days ago | IN | 0 ETH | 0.00000046 | ||||
| Harvest | 7150896 | 534 days ago | IN | 0 ETH | 0.00000038 | ||||
| Harvest | 7150891 | 534 days ago | IN | 0 ETH | 0.00000028 | ||||
| Withdraw | 7150886 | 534 days ago | IN | 0 ETH | 0.00000046 | ||||
| Harvest | 7150875 | 534 days ago | IN | 0 ETH | 0.00000034 | ||||
| Harvest | 7150870 | 534 days ago | IN | 0 ETH | 0.00000034 | ||||
| Harvest | 7084819 | 535 days ago | IN | 0 ETH | 0.00000013 | ||||
| Withdraw Nfts | 7053664 | 536 days ago | IN | 0 ETH | 0.00000006 | ||||
| Withdraw Nfts | 7053631 | 536 days ago | IN | 0 ETH | 0.00000006 | ||||
| Withdraw | 7053489 | 536 days ago | IN | 0 ETH | 0.00000005 | ||||
| Harvest | 7053444 | 536 days ago | IN | 0 ETH | 0.00000004 | ||||
| Harvest | 7012040 | 537 days ago | IN | 0 ETH | 0.0000005 | ||||
| Harvest | 7012019 | 537 days ago | IN | 0 ETH | 0.00000046 | ||||
| Harvest | 7012014 | 537 days ago | IN | 0 ETH | 0.00000053 | ||||
| Harvest | 6996445 | 537 days ago | IN | 0 ETH | 0.0000002 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BNSPool
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import '@openzeppelin/contracts/utils/math/Math.sol';
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import '@openzeppelin/contracts/access/Ownable.sol';
import '../interfaces/IVesting.sol';
import '../interfaces/INFTTierValidator.sol';
contract BNSPool is ERC165, Ownable, IERC1155Receiver {
using SafeERC20 for IERC20;
using EnumerableSet for EnumerableSet.UintSet;
uint256 public constant BLOCKS_PER_TWO_WEEK = 604800;
uint256 public constant DENOMINATOR = 10000;
// Info of each user.
struct UserInfo {
uint256 amount;
EnumerableSet.UintSet stakedNftIds;
uint256 rewardDebt;
uint256 lastRewardBlock;
}
// Info of each pool.
struct PoolInfo {
bool isNftPool;
address poolToken; // can be ERC20 or ERC1155
uint8 nftTier; // for NFT Pool
uint256 nftAmount; // for NFT Pool
uint256 allocPoint;
uint256 lastRewardBlock;
uint256 accTokenPerShare;
bool isStarted;
}
// Info of each pool.
PoolInfo[] public poolInfo;
mapping(uint256 => mapping(address => UserInfo)) private userInfo;
// Total allocation points. Must be the sum of all allocation points in all pools.
uint256 public totalAllocPoint = 0;
IERC20 public rewardToken;
address nftValidator;
uint256 public startBlock = 0;
uint256 public endBlock;
uint256 public nextBlockToReduceReward;
uint256 public rewardPerBlock;
address public vestingPool;
uint256 public lockEndBlock;
uint256 public lockedRate = 5000;
event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
event DepositNft(address indexed user, uint256 indexed pid, uint256 nftId);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
event WithdrawNft(address indexed user, uint256 indexed pid, uint256 nftId);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
event EmergencyWithdrawNft(address indexed user, uint256 indexed pid, uint256 nftId);
event RewardPaid(address indexed user, uint256 amount);
constructor(address _rewardToken,
uint256 _startBlock,
uint256 _endBlock,
uint256 _rewardPerBlock,
uint256 _lockEndBlock,
address _vestingPool,
address _nftValidator) Ownable(_msgSender()) {
rewardToken = IERC20(_rewardToken);
startBlock = _startBlock;
endBlock = _endBlock;
rewardPerBlock = _rewardPerBlock;
lockEndBlock = _lockEndBlock;
vestingPool = _vestingPool;
nftValidator = _nftValidator;
}
modifier reduceReward() {
if (block.number >= nextBlockToReduceReward && block.number < endBlock) {
rewardPerBlock = rewardPerBlock * 8500 / DENOMINATOR;
nextBlockToReduceReward += BLOCKS_PER_TWO_WEEK;
}
_;
}
function getUserPoolAmount(address _userAddress, uint256 _pid) external view returns (uint256) {
return userInfo[_pid][_userAddress].amount;
}
function getUserPoolNfts(address _userAddress, uint256 _pid) external view returns (uint256[] memory) {
return userInfo[_pid][_userAddress].stakedNftIds.values();
}
function checkPoolDuplicate(bool _isNftPool, address _poolToken, uint8 _tier) internal view {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
if (_isNftPool) {
if (poolInfo[pid].isNftPool) {
require(poolInfo[pid].poolToken != _poolToken || poolInfo[pid].nftTier != _tier, "Existing pool?");
}
} else {
if (!poolInfo[pid].isNftPool) {
require(poolInfo[pid].poolToken != _poolToken, "Existing pool?");
}
}
}
}
function add(
uint256 _allocPoint,
bool _isNftPool,
address _poolToken,
uint8 _tier,
bool _withUpdate,
uint256 _lastRewardBlock
) public onlyOwner {
checkPoolDuplicate(_isNftPool, _poolToken, _tier);
if (_withUpdate) {
massUpdatePools();
}
if (block.number < startBlock) {
if (_lastRewardBlock == 0) {
_lastRewardBlock = startBlock;
} else {
if (_lastRewardBlock < startBlock) {
_lastRewardBlock = startBlock;
}
}
} else {
if (_lastRewardBlock == 0 || _lastRewardBlock < block.number) {
_lastRewardBlock = block.number;
}
}
bool _isStarted =
(_lastRewardBlock <= startBlock) ||
(_lastRewardBlock <= block.number);
poolInfo.push(PoolInfo({
isNftPool: _isNftPool,
poolToken : _poolToken,
nftTier: _tier,
nftAmount: 0,
allocPoint : _allocPoint,
lastRewardBlock : _lastRewardBlock,
accTokenPerShare : 0,
isStarted : _isStarted
}));
if (_isStarted) {
totalAllocPoint = totalAllocPoint + _allocPoint;
}
}
// Update the given pool's Amount allocation point. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint) public onlyOwner {
massUpdatePools();
PoolInfo storage pool = poolInfo[_pid];
if (pool.isStarted) {
totalAllocPoint = totalAllocPoint - pool.allocPoint + _allocPoint;
}
pool.allocPoint = _allocPoint;
}
// Return accumulate rewards over the given _from to _to block.
function getGeneratedReward(uint256 _from, uint256 _to) public view returns (uint256) {
uint256 _endBlock = Math.min(block.number, endBlock);
if (_from >= _to) return 0;
if (_to >= _endBlock) {
if (_from >= _endBlock) return 0;
if (_from <= startBlock) return (_endBlock - startBlock) * rewardPerBlock;
return (_endBlock - _from) * rewardPerBlock;
} else {
if (_to <= startBlock) return 0;
if (_from <= startBlock) return (_to - startBlock) * rewardPerBlock;
return (_to - _from) * rewardPerBlock;
}
}
// View function to see pending Amounts on frontend.
function pendingToken(uint256 _pid, address _user) external view returns (uint256) {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_user];
uint256 accTokenPerShare = pool.accTokenPerShare;
uint256 supply = pool.isNftPool ? pool.nftAmount * 1e18 : IERC20(pool.poolToken).balanceOf(address(this));
if (block.number > pool.lastRewardBlock && supply != 0) {
uint256 _generatedReward = getGeneratedReward(pool.lastRewardBlock, block.number);
uint256 _tokenReward = _generatedReward * pool.allocPoint / totalAllocPoint;
accTokenPerShare = accTokenPerShare + (_tokenReward * 1e18 / supply);
}
uint256 userTotalReward = user.amount * accTokenPerShare / (pool.isNftPool ? 1 : 1e18);
return userTotalReward > user.rewardDebt ? userTotalReward - user.rewardDebt : 0;
}
// Update reward variables for all pools. Be careful of gas spending!
function massUpdatePools() public {
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
updatePool(pid);
}
}
// Update reward variables of the given pool to be up-to-date.
function updatePool(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
if (block.number <= pool.lastRewardBlock) {
return;
}
uint256 supply = pool.isNftPool ? pool.nftAmount * 1e18 : IERC20(pool.poolToken).balanceOf(address(this));
if (supply == 0) {
pool.lastRewardBlock = block.number;
return;
}
if (!pool.isStarted) {
pool.isStarted = true;
totalAllocPoint = totalAllocPoint + pool.allocPoint;
}
if (totalAllocPoint > 0) {
uint256 _generatedReward = getGeneratedReward(pool.lastRewardBlock, block.number);
uint256 _tokenReward = _generatedReward * pool.allocPoint / totalAllocPoint;
pool.accTokenPerShare = pool.accTokenPerShare + (_tokenReward * 1e18 / supply);
}
pool.lastRewardBlock = block.number;
}
function harvest(uint256 _pid, address _account) public reduceReward {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_account];
updatePool(_pid);
if (user.amount > 0) {
uint256 userTotalReward = user.amount * pool.accTokenPerShare / (pool.isNftPool ? 1 : 1e18);
if (userTotalReward > user.rewardDebt) {
uint256 _pending = userTotalReward - user.rewardDebt;
if (block.number < lockEndBlock) {
uint256 _lockedAmount = _pending * lockedRate / DENOMINATOR;
IERC20(rewardToken).safeIncreaseAllowance(vestingPool, _lockedAmount);
IVesting(vestingPool).lock(_account, _lockedAmount);
_pending = _pending - _lockedAmount;
} else if (user.lastRewardBlock < lockEndBlock) {
uint256 _mustLock = _pending * (lockEndBlock - user.lastRewardBlock) / (block.number - user.lastRewardBlock);
uint256 _lockedAmount = _mustLock * lockedRate / DENOMINATOR;
IERC20(rewardToken).safeIncreaseAllowance(vestingPool, _lockedAmount);
IVesting(vestingPool).lock(_account, _lockedAmount);
_pending = _pending - _lockedAmount;
}
safeTokenTransfer(_account, _pending);
emit RewardPaid(_account, _pending);
}
}
user.lastRewardBlock = block.number;
user.rewardDebt = user.amount * pool.accTokenPerShare / (pool.isNftPool ? 1 : 1e18);
}
function harvestBulk(address _account) public {
uint256 _numOfPool = poolInfo.length;
for (uint256 i = 0; i < _numOfPool; ++i) {
harvest(i, _account);
}
}
function deposit(uint256 _pid, uint256 _amount) public reduceReward {
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
require(!pool.isNftPool, "Wrong pool");
harvest(_pid, _sender);
if (_amount > 0) {
IERC20(pool.poolToken).safeTransferFrom(_sender, address(this), _amount);
user.amount = user.amount + _amount;
user.lastRewardBlock = block.number;
user.rewardDebt = user.amount * pool.accTokenPerShare / 1e18;
emit Deposit(_sender, _pid, _amount);
}
}
function depositNfts(uint256 _pid, uint256[] memory _nftIds) public reduceReward {
require(_nftIds.length > 0, "Must deposit at least 1 NFT");
require(_nftIds.length <= 16, "Too many NFTs");
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
require(pool.isNftPool, "Wrong pool");
for (uint8 index = 0; index < _nftIds.length; index++) {
require(INFTTierValidator(nftValidator).validateTier(_nftIds[index], pool.nftTier) == true, "Invalid NFT Tier");
}
harvest(_pid, _sender);
for (uint8 index = 0; index < _nftIds.length; index++) {
IERC1155(pool.poolToken).safeTransferFrom(_sender, address(this), _nftIds[index], 1, "");
user.amount = user.amount + 1;
user.stakedNftIds.add(_nftIds[index]);
pool.nftAmount = pool.nftAmount + 1;
emit DepositNft(_sender, _pid, _nftIds[index]);
}
user.lastRewardBlock = block.number;
user.rewardDebt = user.amount * pool.accTokenPerShare;
}
function withdraw(uint256 _pid, uint256 _amount) public reduceReward {
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
require(!pool.isNftPool, "Wrong pool");
require(user.amount >= _amount, "withdraw over staked amount");
harvest(_pid, _sender);
if (_amount > 0) {
user.amount = user.amount - _amount;
IERC20(pool.poolToken).safeTransfer(_sender, _amount);
user.lastRewardBlock = block.number;
user.rewardDebt = user.amount * pool.accTokenPerShare / 1e18;
emit Withdraw(_sender, _pid, _amount);
}
}
function withdrawNfts(uint256 _pid, uint256[] memory _nftIds) public reduceReward {
require(_nftIds.length > 0, "Must deposit at least 1 NFT");
require(_nftIds.length <= 16, "Too many NFTs");
address _sender = msg.sender;
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][_sender];
require(pool.isNftPool, "Wrong pool");
for (uint8 index = 0; index < _nftIds.length; index++) {
require(user.stakedNftIds.contains(_nftIds[index]), "Invalid staked NFT");
}
harvest(_pid, _sender);
for (uint8 index = 0; index < _nftIds.length; index++) {
user.amount = user.amount - 1;
user.stakedNftIds.remove(_nftIds[index]);
pool.nftAmount = pool.nftAmount - 1;
IERC1155(pool.poolToken).safeTransferFrom(address(this), _sender, _nftIds[index], 1, "");
emit WithdrawNft(_sender, _pid, _nftIds[index]);
}
user.lastRewardBlock = block.number;
user.rewardDebt = user.amount * pool.accTokenPerShare;
}
// Withdraw without caring about rewards. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) public {
PoolInfo storage pool = poolInfo[_pid];
UserInfo storage user = userInfo[_pid][msg.sender];
uint256 _amount = user.amount;
if (pool.isNftPool) {
uint256[] memory nfts = user.stakedNftIds.values();
for(uint8 i = 0; i < nfts.length; i++) {
user.stakedNftIds.remove(nfts[i]);
pool.nftAmount = pool.nftAmount - 1;
IERC1155(pool.poolToken).safeTransferFrom(address(this), msg.sender, nfts[i], 1, "");
emit EmergencyWithdrawNft(msg.sender, _pid, nfts[i]);
}
} else {
IERC20(pool.poolToken).safeTransfer(msg.sender, _amount);
emit EmergencyWithdraw(msg.sender, _pid, _amount);
}
user.amount = 0;
user.rewardDebt = 0;
}
// Safe token transfer function, just in case if rounding error causes pool to not have enough Amounts.
function safeTokenTransfer(address _to, uint256 _amount) internal {
uint256 _tokenBal = rewardToken.balanceOf(address(this));
if (_tokenBal > 0) {
if (_amount > _tokenBal) {
rewardToken.safeTransfer(_to, _tokenBal);
} else {
rewardToken.safeTransfer(_to, _amount);
}
}
}
function setValidator(address _validator) external onlyOwner {
nftValidator = _validator;
}
function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) public virtual returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
function recoverUnsupported(bool isNft, address _token, uint256 amountOrNftId, address to) external onlyOwner {
if (block.number < endBlock + BLOCKS_PER_TWO_WEEK) {
require(_token != address(rewardToken), "Cannot withdraw reward token");
uint256 length = poolInfo.length;
for (uint256 pid = 0; pid < length; ++pid) {
PoolInfo storage pool = poolInfo[pid];
require(_token != pool.poolToken, "Cannot withdraw pool token");
}
}
if (isNft) {
IERC1155(_token).safeTransferFrom(address(this), to, amountOrNftId, 1, "");
} else {
IERC20(_token).safeTransfer(to, amountOrNftId);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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 (last updated v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` 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 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` 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 values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
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 (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @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);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./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);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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 v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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 towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.20;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position is the index of the value in the `values` array plus 1.
// Position 0 is used to mean a value is not in the set.
mapping(bytes32 value => uint256) _positions;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._positions[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We cache the value's position to prevent multiple reads from the same storage slot
uint256 position = set._positions[value];
if (position != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 valueIndex = position - 1;
uint256 lastIndex = set._values.length - 1;
if (valueIndex != lastIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the lastValue to the index where the value to delete is
set._values[valueIndex] = lastValue;
// Update the tracked position of the lastValue (that was just moved)
set._positions[lastValue] = position;
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the tracked position for the deleted slot
delete set._positions[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._positions[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;
interface INFTTierValidator {
function validateTier(uint256 _nftId, uint8 tier) external returns (bool);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;
interface IVesting {
function remainingLockedOf(address _account) external view returns (uint256);
function lock(address _account, uint256 _amount) external;
function canUnlockAmount(address _account) external view returns (uint256);
function unlock() external;
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"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
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_endBlock","type":"uint256"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_lockEndBlock","type":"uint256"},{"internalType":"address","name":"_vestingPool","type":"address"},{"internalType":"address","name":"_nftValidator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"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":"Deposit","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":"nftId","type":"uint256"}],"name":"DepositNft","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"EmergencyWithdrawNft","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":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPaid","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"}],"name":"WithdrawNft","type":"event"},{"inputs":[],"name":"BLOCKS_PER_TWO_WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_isNftPool","type":"bool"},{"internalType":"address","name":"_poolToken","type":"address"},{"internalType":"uint8","name":"_tier","type":"uint8"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"uint256","name":"_lastRewardBlock","type":"uint256"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256[]","name":"_nftIds","type":"uint256[]"}],"name":"depositNfts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddress","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getUserPoolAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_userAddress","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"getUserPoolNfts","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_account","type":"address"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"harvestBulk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockedRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextBlockToReduceReward","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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"bool","name":"isNftPool","type":"bool"},{"internalType":"address","name":"poolToken","type":"address"},{"internalType":"uint8","name":"nftTier","type":"uint8"},{"internalType":"uint256","name":"nftAmount","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"bool","name":"isStarted","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isNft","type":"bool"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amountOrNftId","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"recoverUnsupported","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"}],"name":"setValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","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":[],"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":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"_nftIds","type":"uint256[]"}],"name":"withdrawNfts","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405260006003556000600655611388600c553480156200002157600080fd5b5060405162004e4b38038062004e4b83398181016040528101906200004791906200033b565b62000057620001ca60201b60201c565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000cc5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000c39190620003ff565b60405180910390fd5b620000dd81620001d260201b60201c565b5086600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600681905550846007819055508360098190555082600b8190555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050505050506200041c565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002c8826200029b565b9050919050565b620002da81620002bb565b8114620002e657600080fd5b50565b600081519050620002fa81620002cf565b92915050565b6000819050919050565b620003158162000300565b81146200032157600080fd5b50565b60008151905062000335816200030a565b92915050565b600080600080600080600060e0888a0312156200035d576200035c62000296565b5b60006200036d8a828b01620002e9565b9750506020620003808a828b0162000324565b9650506040620003938a828b0162000324565b9550506060620003a68a828b0162000324565b9450506080620003b98a828b0162000324565b93505060a0620003cc8a828b01620002e9565b92505060c0620003df8a828b01620002e9565b91505092959891949750929550565b620003f981620002bb565b82525050565b6000602082019050620004166000830184620003ee565b92915050565b614a1f806200042c6000396000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c80635312ea8e116101255780639cf66ecd116100ad578063e827d3661161007c578063e827d366146105cd578063f0fccc1f146105eb578063f23a6e611461061b578063f2fde38b1461064b578063f7c618c11461066757610211565b80639cf66ecd14610549578063bc197c8114610565578063c5cd9ee014610595578063e2bbb158146105b157610211565b80638587edbb116100f45780638587edbb146104b557806385dc9d0e146104d35780638ae39cac146104ef5780638da5cb5b1461050d578063918f86741461052b57610211565b80635312ea8e146104675780635db21e4e14610483578063630b5ba1146104a1578063715018a6146104ab57610211565b806322de7a6f116101a85780633154b10e116101775780633154b10e146103c3578063441a3e70146103e157806348cd4cb1146103fd57806348e43af41461041b57806351eb05a61461044b57610211565b806322de7a6f14610329578063231f0c6a146103475780632c3b67f114610377578063302415a5146103a757610211565b806317caf6f1116101e457806317caf6f1146102b757806318fccc76146102d55780631ab06ee5146102f15780631c9013be1461030d57610211565b806301ffc9a714610216578063083c6323146102465780631327d3d8146102645780631526fe2714610280575b600080fd5b610230600480360381019061022b9190613779565b610685565b60405161023d91906137c1565b60405180910390f35b61024e6106ef565b60405161025b91906137f5565b60405180910390f35b61027e6004803603810190610279919061386e565b6106f5565b005b61029a600480360381019061029591906138c7565b610741565b6040516102ae98979695949392919061391f565b60405180910390f35b6102bf6107e0565b6040516102cc91906137f5565b60405180910390f35b6102ef60048036038101906102ea919061399d565b6107e6565b005b61030b600480360381019061030691906139dd565b610cb6565b005b61032760048036038101906103229190613a49565b610d35565b005b610331610f76565b60405161033e91906137f5565b60405180910390f35b610361600480360381019061035c91906139dd565b610f7c565b60405161036e91906137f5565b60405180910390f35b610391600480360381019061038c9190613ab0565b611065565b60405161039e9190613bae565b60405180910390f35b6103c160048036038101906103bc9190613d29565b6110ca565b005b6103cb6114ee565b6040516103d89190613d85565b60405180910390f35b6103fb60048036038101906103f691906139dd565b611514565b005b61040561178d565b60405161041291906137f5565b60405180910390f35b6104356004803603810190610430919061399d565b611793565b60405161044291906137f5565b60405180910390f35b610465600480360381019061046091906138c7565b6119e7565b005b610481600480360381019061047c91906138c7565b611bde565b005b61048b611ed6565b60405161049891906137f5565b60405180910390f35b6104a9611edd565b005b6104b3611f10565b005b6104bd611f24565b6040516104ca91906137f5565b60405180910390f35b6104ed60048036038101906104e89190613dcc565b611f2a565b005b6104f7612125565b60405161050491906137f5565b60405180910390f35b61051561212b565b6040516105229190613d85565b60405180910390f35b610533612154565b60405161054091906137f5565b60405180910390f35b610563600480360381019061055e919061386e565b61215a565b005b61057f600480360381019061057a9190613f0e565b61218f565b60405161058c9190613fec565b60405180910390f35b6105af60048036038101906105aa9190613d29565b6121a4565b005b6105cb60048036038101906105c691906139dd565b61266a565b005b6105d561289e565b6040516105e291906137f5565b60405180910390f35b61060560048036038101906106009190613ab0565b6128a4565b60405161061291906137f5565b60405180910390f35b61063560048036038101906106309190614007565b612902565b6040516106429190613fec565b60405180910390f35b6106656004803603810190610660919061386e565b612917565b005b61066f61299d565b60405161067c91906140fd565b60405180910390f35b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60075481565b6106fd6129c3565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6001818154811061075157600080fd5b90600052602060002090600602016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160159054906101000a900460ff16908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16905088565b60035481565b60085443101580156107f9575060075443105b1561083e576127106121346009546108119190614147565b61081b91906141b8565b60098190555062093a806008600082825461083691906141e9565b925050819055505b6000600183815481106108545761085361421d565b5b9060005260206000209060060201905060006002600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506108c1846119e7565b600081600001541115610c505760008260000160009054906101000a900460ff166108f457670de0b6b3a76400006108f7565b60015b67ffffffffffffffff16836004015483600001546109159190614147565b61091f91906141b8565b90508160030154811115610c4e57600082600301548261093f919061424c565b9050600b54431015610a7c576000612710600c548361095e9190614147565b61096891906141b8565b90506109d9600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a4a9092919063ffffffff16565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663282d3fdf87836040518363ffffffff1660e01b8152600401610a36929190614280565b600060405180830381600087803b158015610a5057600080fd5b505af1158015610a64573d6000803e3d6000fd5b505050508082610a74919061424c565b915050610bf4565b600b5483600401541015610bf3576000836004015443610a9c919061424c565b8460040154600b54610aae919061424c565b83610ab99190614147565b610ac391906141b8565b90506000612710600c5483610ad89190614147565b610ae291906141b8565b9050610b53600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a4a9092919063ffffffff16565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663282d3fdf88836040518363ffffffff1660e01b8152600401610bb0929190614280565b600060405180830381600087803b158015610bca57600080fd5b505af1158015610bde573d6000803e3d6000fd5b505050508083610bee919061424c565b925050505b5b610bfe8582612ae6565b8473ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610c4491906137f5565b60405180910390a2505b505b4381600401819055508160000160009054906101000a900460ff16610c7d57670de0b6b3a7640000610c80565b60015b67ffffffffffffffff1682600401548260000154610c9e9190614147565b610ca891906141b8565b816003018190555050505050565b610cbe6129c3565b610cc6611edd565b600060018381548110610cdc57610cdb61421d565b5b906000526020600020906006020190508060050160009054906101000a900460ff1615610d2757818160020154600354610d16919061424c565b610d2091906141e9565b6003819055505b818160020181905550505050565b610d3d6129c3565b62093a80600754610d4e91906141e9565b431015610ec757600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90614306565b60405180910390fd5b6000600180549050905060005b81811015610ec457600060018281548110610e1057610e0f61421d565b5b906000526020600020906006020190508060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1603610eb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea990614372565b60405180910390fd5b5080610ebd90614392565b9050610df2565b50505b8315610f44578273ffffffffffffffffffffffffffffffffffffffff1663f242432a30838560016040518563ffffffff1660e01b8152600401610f0d949392919061444c565b600060405180830381600087803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b50505050610f70565b610f6f81838573ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b5b50505050565b600c5481565b600080610f8b43600754612cbc565b9050828410610f9e57600091505061105f565b80831061100357808410610fb657600091505061105f565b6006548411610fe25760095460065482610fd0919061424c565b610fda9190614147565b91505061105f565b6009548482610ff1919061424c565b610ffb9190614147565b91505061105f565b600654831161101657600091505061105f565b60065484116110425760095460065484611030919061424c565b61103a9190614147565b91505061105f565b6009548484611051919061424c565b61105b9190614147565b9150505b92915050565b60606110c26002600084815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101612cd5565b905092915050565b60085443101580156110dd575060075443105b15611122576127106121346009546110f59190614147565b6110ff91906141b8565b60098190555062093a806008600082825461111a91906141e9565b925050819055505b6000815111611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d906144f0565b60405180910390fd5b6010815111156111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a29061455c565b60405180910390fd5b60003390506000600184815481106111c6576111c561421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff1661127b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611272906145c8565b60405180910390fd5b60005b84518160ff16101561130f576112bd858260ff16815181106112a3576112a261421d565b5b602002602001015183600101612cf690919063ffffffff16565b6112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390614634565b60405180910390fd5b808061130790614654565b91505061127e565b5061131a85846107e6565b60005b84518160ff1610156114c1576001826000015461133a919061424c565b8260000181905550611375858260ff168151811061135b5761135a61421d565b5b602002602001015183600101612d1090919063ffffffff16565b5060018360010154611387919061424c565b83600101819055508260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a3086888560ff16815181106113e7576113e661421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401611410949392919061444c565b600060405180830381600087803b15801561142a57600080fd5b505af115801561143e573d6000803e3d6000fd5b50505050858473ffffffffffffffffffffffffffffffffffffffff167fcae6e85b835fcf864c07fb3cd4909bf840bf5114adf6a9f2553470fe7ca78ddc878460ff16815181106114915761149061421d565b5b60200260200101516040516114a691906137f5565b60405180910390a380806114b990614654565b91505061131d565b50438160040181905550816004015481600001546114df9190614147565b81600301819055505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6008544310158015611527575060075443105b1561156c5761271061213460095461153f9190614147565b61154991906141b8565b60098190555062093a806008600082825461156491906141e9565b925050819055505b60003390506000600184815481106115875761158661421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff161561163d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611634906145c8565b60405180910390fd5b8381600001541015611684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167b906146c9565b60405180910390fd5b61168e85846107e6565b6000841115611786578381600001546116a7919061424c565b81600001819055506116fe83858460000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b438160040181905550670de0b6b3a7640000826004015482600001546117249190614147565b61172e91906141b8565b8160030181905550848373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688660405161177d91906137f5565b60405180910390a35b5050505050565b60065481565b600080600184815481106117aa576117a961421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008260040154905060008360000160009054906101000a900460ff166118d2578360000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161188c9190613d85565b602060405180830381865afa1580156118a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cd91906146fe565b6118eb565b670de0b6b3a764000084600101546118ea9190614147565b5b9050836003015443118015611901575060008114155b15611968576000611916856003015443610f7c565b9050600060035486600201548361192d9190614147565b61193791906141b8565b905082670de0b6b3a76400008261194e9190614147565b61195891906141b8565b8461196391906141e9565b935050505b60008460000160009054906101000a900460ff1661198e57670de0b6b3a7640000611991565b60015b67ffffffffffffffff168385600001546119ab9190614147565b6119b591906141b8565b9050836003015481116119c95760006119da565b8360030154816119d9919061424c565b5b9550505050505092915050565b6000600182815481106119fd576119fc61421d565b5b9060005260206000209060060201905080600301544311611a1e5750611bdb565b60008160000160009054906101000a900460ff16611ad9578160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611a939190613d85565b602060405180830381865afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad491906146fe565b611af2565b670de0b6b3a76400008260010154611af19190614147565b5b905060008103611b0c574382600301819055505050611bdb565b8160050160009054906101000a900460ff16611b585760018260050160006101000a81548160ff0219169083151502179055508160020154600354611b5191906141e9565b6003819055505b60006003541115611bcf576000611b73836003015443610f7c565b90506000600354846002015483611b8a9190614147565b611b9491906141b8565b905082670de0b6b3a764000082611bab9190614147565b611bb591906141b8565b8460040154611bc491906141e9565b846004018190555050505b43826003018190555050505b50565b600060018281548110611bf457611bf361421d565b5b9060005260206000209060060201905060006002600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015490508260000160009054906101000a900460ff1615611e1d576000611c8683600101612cd5565b905060005b81518160ff161015611e1657611cca828260ff1681518110611cb057611caf61421d565b5b602002602001015185600101612d1090919063ffffffff16565b5060018560010154611cdc919061424c565b85600101819055508460000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a3033858560ff1681518110611d3c57611d3b61421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401611d65949392919061444c565b600060405180830381600087803b158015611d7f57600080fd5b505af1158015611d93573d6000803e3d6000fd5b50505050853373ffffffffffffffffffffffffffffffffffffffff167ffc474cc8a8ad31db497d8cdf9be4f6e090ce666b34f7c9f505a97d5f700b41b2848460ff1681518110611de657611de561421d565b5b6020026020010151604051611dfb91906137f5565b60405180910390a38080611e0e90614654565b915050611c8b565b5050611ebc565b611e6c33828560000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b833373ffffffffffffffffffffffffffffffffffffffff167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059583604051611eb391906137f5565b60405180910390a35b600082600001819055506000826003018190555050505050565b62093a8081565b6000600180549050905060005b81811015611f0c57611efb816119e7565b80611f0590614392565b9050611eea565b5050565b611f186129c3565b611f226000612d2a565b565b600b5481565b611f326129c3565b611f3d858585612dee565b8115611f4c57611f4b611edd565b5b600654431015611f7e5760008103611f68576006549050611f79565b600654811015611f785760065490505b5b611f96565b6000811480611f8c57504381105b15611f95574390505b5b600060065482111580611fa95750438211155b9050600160405180610100016040528088151581526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1681526020016000815260200189815260200184815260200160008152602001831515815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160000160156101000a81548160ff021916908360ff160217905550606082015181600101556080820151816002015560a0820151816003015560c0820151816004015560e08201518160050160006101000a81548160ff0219169083151502179055505050801561211c578660035461211591906141e9565b6003819055505b50505050505050565b60095481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61271081565b6000600180549050905060005b8181101561218a5761217981846107e6565b8061218390614392565b9050612167565b505050565b600063bc197c8160e01b905095945050505050565b60085443101580156121b7575060075443105b156121fc576127106121346009546121cf9190614147565b6121d991906141b8565b60098190555062093a80600860008282546121f491906141e9565b925050819055505b6000815111612240576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612237906144f0565b60405180910390fd5b601081511115612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9061455c565b60405180910390fd5b60003390506000600184815481106122a05761229f61421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff16612355576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234c906145c8565b60405180910390fd5b60005b84518160ff16101561248b5760011515600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9730a4d878460ff16815181106123bc576123bb61421d565b5b60200260200101518660000160159054906101000a900460ff166040518363ffffffff1660e01b81526004016123f392919061472b565b6020604051808303816000875af1158015612412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124369190614769565b151514612478576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246f906147e2565b60405180910390fd5b808061248390614654565b915050612358565b5061249685846107e6565b60005b84518160ff16101561263d578260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a8530888560ff16815181106124fd576124fc61421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401612526949392919061444c565b600060405180830381600087803b15801561254057600080fd5b505af1158015612554573d6000803e3d6000fd5b505050506001826000015461256991906141e9565b82600001819055506125a4858260ff168151811061258a5761258961421d565b5b60200260200101518360010161304290919063ffffffff16565b50600183600101546125b691906141e9565b8360010181905550858473ffffffffffffffffffffffffffffffffffffffff167f7ad89f71bfd411c34e67f1593de34f11c471d79fdb7ed6adadf0253814be9f36878460ff168151811061260d5761260c61421d565b5b602002602001015160405161262291906137f5565b60405180910390a3808061263590614654565b915050612499565b504381600401819055508160040154816000015461265b9190614147565b81600301819055505050505050565b600854431015801561267d575060075443105b156126c2576127106121346009546126959190614147565b61269f91906141b8565b60098190555062093a80600860008282546126ba91906141e9565b925050819055505b60003390506000600184815481106126dd576126dc61421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff1615612793576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161278a906145c8565b60405180910390fd5b61279d85846107e6565b6000841115612897576127f78330868560000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661305c909392919063ffffffff16565b83816000015461280791906141e9565b8160000181905550438160040181905550670de0b6b3a7640000826004015482600001546128359190614147565b61283f91906141b8565b8160030181905550848373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158660405161288e91906137f5565b60405180910390a35b5050505050565b60085481565b60006002600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154905092915050565b600063f23a6e6160e01b905095945050505050565b61291f6129c3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036129915760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016129889190613d85565b60405180910390fd5b61299a81612d2a565b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6129cb6130de565b73ffffffffffffffffffffffffffffffffffffffff166129e961212b565b73ffffffffffffffffffffffffffffffffffffffff1614612a4857612a0c6130de565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401612a3f9190613d85565b60405180910390fd5b565b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401612a87929190614802565b602060405180830381865afa158015612aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac891906146fe565b9050612ae084848484612adb91906141e9565b6130e6565b50505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612b439190613d85565b602060405180830381865afa158015612b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8491906146fe565b90506000811115612c385780821115612be957612be48382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b612c37565b612c368383600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b5b5b505050565b612cb7838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401612c70929190614280565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b505050565b6000818310612ccb5781612ccd565b825b905092915050565b60606000612ce58360000161328c565b905060608190508092505050919050565b6000612d08836000018360001b6132e8565b905092915050565b6000612d22836000018360001b61330b565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600180549050905060005b8181101561303b578415612f3e5760018181548110612e1d57612e1c61421d565b5b906000526020600020906006020160000160009054906101000a900460ff1615612f39578373ffffffffffffffffffffffffffffffffffffffff1660018281548110612e6c57612e6b61421d565b5b906000526020600020906006020160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580612ef957508260ff1660018281548110612ed457612ed361421d565b5b906000526020600020906006020160000160159054906101000a900460ff1660ff1614155b612f38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2f90614877565b60405180910390fd5b5b61302a565b60018181548110612f5257612f5161421d565b5b906000526020600020906006020160000160009054906101000a900460ff16613029578373ffffffffffffffffffffffffffffffffffffffff1660018281548110612fa057612f9f61421d565b5b906000526020600020906006020160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603613028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161301f90614877565b60405180910390fd5b5b5b8061303490614392565b9050612dfb565b5050505050565b6000613054836000018360001b61341f565b905092915050565b6130d8848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161309193929190614897565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b50505050565b600033905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b38484604051602401613117929190614280565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050613165848261348f565b6131ef576131e4848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b386600060405160240161319d929190614909565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b6131ee84826131f5565b5b50505050565b6000613220828473ffffffffffffffffffffffffffffffffffffffff1661355690919063ffffffff16565b905060008151141580156132455750808060200190518101906132439190614769565b155b1561328757826040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161327e9190613d85565b60405180910390fd5b505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156132dc57602002820191906000526020600020905b8154815260200190600101908083116132c8575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461341357600060018261333d919061424c565b9050600060018660000180549050613355919061424c565b90508082146133c45760008660000182815481106133765761337561421d565b5b906000526020600020015490508087600001848154811061339a5761339961421d565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b856000018054806133d8576133d7614932565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050613419565b60009150505b92915050565b600061342b83836132e8565b613484578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050613489565b600090505b92915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16846040516134b991906149d2565b6000604051808303816000865af19150503d80600081146134f6576040519150601f19603f3d011682016040523d82523d6000602084013e6134fb565b606091505b509150915081801561352957506000815114806135285750808060200190518101906135279190614769565b5b5b801561354c575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b60606135648383600061356c565b905092915050565b6060814710156135b357306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016135aa9190613d85565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516135dc91906149d2565b60006040518083038185875af1925050503d8060008114613619576040519150601f19603f3d011682016040523d82523d6000602084013e61361e565b606091505b509150915061362e868383613639565b925050509392505050565b60608261364e57613649826136c8565b6136c0565b60008251148015613676575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156136b857836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016136af9190613d85565b60405180910390fd5b8190506136c1565b5b9392505050565b6000815111156136db5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61375681613721565b811461376157600080fd5b50565b6000813590506137738161374d565b92915050565b60006020828403121561378f5761378e613717565b5b600061379d84828501613764565b91505092915050565b60008115159050919050565b6137bb816137a6565b82525050565b60006020820190506137d660008301846137b2565b92915050565b6000819050919050565b6137ef816137dc565b82525050565b600060208201905061380a60008301846137e6565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061383b82613810565b9050919050565b61384b81613830565b811461385657600080fd5b50565b60008135905061386881613842565b92915050565b60006020828403121561388457613883613717565b5b600061389284828501613859565b91505092915050565b6138a4816137dc565b81146138af57600080fd5b50565b6000813590506138c18161389b565b92915050565b6000602082840312156138dd576138dc613717565b5b60006138eb848285016138b2565b91505092915050565b6138fd81613830565b82525050565b600060ff82169050919050565b61391981613903565b82525050565b600061010082019050613935600083018b6137b2565b613942602083018a6138f4565b61394f6040830189613910565b61395c60608301886137e6565b61396960808301876137e6565b61397660a08301866137e6565b61398360c08301856137e6565b61399060e08301846137b2565b9998505050505050505050565b600080604083850312156139b4576139b3613717565b5b60006139c2858286016138b2565b92505060206139d385828601613859565b9150509250929050565b600080604083850312156139f4576139f3613717565b5b6000613a02858286016138b2565b9250506020613a13858286016138b2565b9150509250929050565b613a26816137a6565b8114613a3157600080fd5b50565b600081359050613a4381613a1d565b92915050565b60008060008060808587031215613a6357613a62613717565b5b6000613a7187828801613a34565b9450506020613a8287828801613859565b9350506040613a93878288016138b2565b9250506060613aa487828801613859565b91505092959194509250565b60008060408385031215613ac757613ac6613717565b5b6000613ad585828601613859565b9250506020613ae6858286016138b2565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613b25816137dc565b82525050565b6000613b378383613b1c565b60208301905092915050565b6000602082019050919050565b6000613b5b82613af0565b613b658185613afb565b9350613b7083613b0c565b8060005b83811015613ba1578151613b888882613b2b565b9750613b9383613b43565b925050600181019050613b74565b5085935050505092915050565b60006020820190508181036000830152613bc88184613b50565b905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613c1e82613bd5565b810181811067ffffffffffffffff82111715613c3d57613c3c613be6565b5b80604052505050565b6000613c5061370d565b9050613c5c8282613c15565b919050565b600067ffffffffffffffff821115613c7c57613c7b613be6565b5b602082029050602081019050919050565b600080fd5b6000613ca5613ca084613c61565b613c46565b90508083825260208201905060208402830185811115613cc857613cc7613c8d565b5b835b81811015613cf15780613cdd88826138b2565b845260208401935050602081019050613cca565b5050509392505050565b600082601f830112613d1057613d0f613bd0565b5b8135613d20848260208601613c92565b91505092915050565b60008060408385031215613d4057613d3f613717565b5b6000613d4e858286016138b2565b925050602083013567ffffffffffffffff811115613d6f57613d6e61371c565b5b613d7b85828601613cfb565b9150509250929050565b6000602082019050613d9a60008301846138f4565b92915050565b613da981613903565b8114613db457600080fd5b50565b600081359050613dc681613da0565b92915050565b60008060008060008060c08789031215613de957613de8613717565b5b6000613df789828a016138b2565b9650506020613e0889828a01613a34565b9550506040613e1989828a01613859565b9450506060613e2a89828a01613db7565b9350506080613e3b89828a01613a34565b92505060a0613e4c89828a016138b2565b9150509295509295509295565b600080fd5b600067ffffffffffffffff821115613e7957613e78613be6565b5b613e8282613bd5565b9050602081019050919050565b82818337600083830152505050565b6000613eb1613eac84613e5e565b613c46565b905082815260208101848484011115613ecd57613ecc613e59565b5b613ed8848285613e8f565b509392505050565b600082601f830112613ef557613ef4613bd0565b5b8135613f05848260208601613e9e565b91505092915050565b600080600080600060a08688031215613f2a57613f29613717565b5b6000613f3888828901613859565b9550506020613f4988828901613859565b945050604086013567ffffffffffffffff811115613f6a57613f6961371c565b5b613f7688828901613cfb565b935050606086013567ffffffffffffffff811115613f9757613f9661371c565b5b613fa388828901613cfb565b925050608086013567ffffffffffffffff811115613fc457613fc361371c565b5b613fd088828901613ee0565b9150509295509295909350565b613fe681613721565b82525050565b60006020820190506140016000830184613fdd565b92915050565b600080600080600060a0868803121561402357614022613717565b5b600061403188828901613859565b955050602061404288828901613859565b9450506040614053888289016138b2565b9350506060614064888289016138b2565b925050608086013567ffffffffffffffff8111156140855761408461371c565b5b61409188828901613ee0565b9150509295509295909350565b6000819050919050565b60006140c36140be6140b984613810565b61409e565b613810565b9050919050565b60006140d5826140a8565b9050919050565b60006140e7826140ca565b9050919050565b6140f7816140dc565b82525050565b600060208201905061411260008301846140ee565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614152826137dc565b915061415d836137dc565b925082820261416b816137dc565b9150828204841483151761418257614181614118565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006141c3826137dc565b91506141ce836137dc565b9250826141de576141dd614189565b5b828204905092915050565b60006141f4826137dc565b91506141ff836137dc565b925082820190508082111561421757614216614118565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614257826137dc565b9150614262836137dc565b925082820390508181111561427a57614279614118565b5b92915050565b600060408201905061429560008301856138f4565b6142a260208301846137e6565b9392505050565b600082825260208201905092915050565b7f43616e6e6f742077697468647261772072657761726420746f6b656e00000000600082015250565b60006142f0601c836142a9565b91506142fb826142ba565b602082019050919050565b6000602082019050818103600083015261431f816142e3565b9050919050565b7f43616e6e6f7420776974686472617720706f6f6c20746f6b656e000000000000600082015250565b600061435c601a836142a9565b915061436782614326565b602082019050919050565b6000602082019050818103600083015261438b8161434f565b9050919050565b600061439d826137dc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036143cf576143ce614118565b5b600182019050919050565b6000819050919050565b60006143ff6143fa6143f5846143da565b61409e565b6137dc565b9050919050565b61440f816143e4565b82525050565b600082825260208201905092915050565b50565b6000614436600083614415565b915061444182614426565b600082019050919050565b600060a08201905061446160008301876138f4565b61446e60208301866138f4565b61447b60408301856137e6565b6144886060830184614406565b818103608083015261449981614429565b905095945050505050565b7f4d757374206465706f736974206174206c656173742031204e46540000000000600082015250565b60006144da601b836142a9565b91506144e5826144a4565b602082019050919050565b60006020820190508181036000830152614509816144cd565b9050919050565b7f546f6f206d616e79204e46547300000000000000000000000000000000000000600082015250565b6000614546600d836142a9565b915061455182614510565b602082019050919050565b6000602082019050818103600083015261457581614539565b9050919050565b7f57726f6e6720706f6f6c00000000000000000000000000000000000000000000600082015250565b60006145b2600a836142a9565b91506145bd8261457c565b602082019050919050565b600060208201905081810360008301526145e1816145a5565b9050919050565b7f496e76616c6964207374616b6564204e46540000000000000000000000000000600082015250565b600061461e6012836142a9565b9150614629826145e8565b602082019050919050565b6000602082019050818103600083015261464d81614611565b9050919050565b600061465f82613903565b915060ff820361467257614671614118565b5b600182019050919050565b7f7769746864726177206f766572207374616b656420616d6f756e740000000000600082015250565b60006146b3601b836142a9565b91506146be8261467d565b602082019050919050565b600060208201905081810360008301526146e2816146a6565b9050919050565b6000815190506146f88161389b565b92915050565b60006020828403121561471457614713613717565b5b6000614722848285016146e9565b91505092915050565b600060408201905061474060008301856137e6565b61474d6020830184613910565b9392505050565b60008151905061476381613a1d565b92915050565b60006020828403121561477f5761477e613717565b5b600061478d84828501614754565b91505092915050565b7f496e76616c6964204e4654205469657200000000000000000000000000000000600082015250565b60006147cc6010836142a9565b91506147d782614796565b602082019050919050565b600060208201905081810360008301526147fb816147bf565b9050919050565b600060408201905061481760008301856138f4565b61482460208301846138f4565b9392505050565b7f4578697374696e6720706f6f6c3f000000000000000000000000000000000000600082015250565b6000614861600e836142a9565b915061486c8261482b565b602082019050919050565b6000602082019050818103600083015261489081614854565b9050919050565b60006060820190506148ac60008301866138f4565b6148b960208301856138f4565b6148c660408301846137e6565b949350505050565b6000819050919050565b60006148f36148ee6148e9846148ce565b61409e565b6137dc565b9050919050565b614903816148d8565b82525050565b600060408201905061491e60008301856138f4565b61492b60208301846148fa565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561499557808201518184015260208101905061497a565b60008484015250505050565b60006149ac82614961565b6149b6818561496c565b93506149c6818560208601614977565b80840191505092915050565b60006149de82846149a1565b91508190509291505056fea264697066735822122043b5346053d4ab15936670b671c3648a27f3b9686ed3b99112ce84b88685c0b564736f6c634300081400330000000000000000000000000c2ffacd70c1d1cb04d4803dea055dd9d4b5760100000000000000000000000000000000000000000000000000000000001287570000000000000000000000000000000000000000000000000000000001fba3d7000000000000000000000000000000000000000000000000037149b995050700000000000000000000000000000000000000000000000000000000000024fc57000000000000000000000000e3a108725fd1a435e045ab8036685018e330ca86000000000000000000000000f3bd4c43f63b5b0fd05f08a91863090d029d1cee
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80635312ea8e116101255780639cf66ecd116100ad578063e827d3661161007c578063e827d366146105cd578063f0fccc1f146105eb578063f23a6e611461061b578063f2fde38b1461064b578063f7c618c11461066757610211565b80639cf66ecd14610549578063bc197c8114610565578063c5cd9ee014610595578063e2bbb158146105b157610211565b80638587edbb116100f45780638587edbb146104b557806385dc9d0e146104d35780638ae39cac146104ef5780638da5cb5b1461050d578063918f86741461052b57610211565b80635312ea8e146104675780635db21e4e14610483578063630b5ba1146104a1578063715018a6146104ab57610211565b806322de7a6f116101a85780633154b10e116101775780633154b10e146103c3578063441a3e70146103e157806348cd4cb1146103fd57806348e43af41461041b57806351eb05a61461044b57610211565b806322de7a6f14610329578063231f0c6a146103475780632c3b67f114610377578063302415a5146103a757610211565b806317caf6f1116101e457806317caf6f1146102b757806318fccc76146102d55780631ab06ee5146102f15780631c9013be1461030d57610211565b806301ffc9a714610216578063083c6323146102465780631327d3d8146102645780631526fe2714610280575b600080fd5b610230600480360381019061022b9190613779565b610685565b60405161023d91906137c1565b60405180910390f35b61024e6106ef565b60405161025b91906137f5565b60405180910390f35b61027e6004803603810190610279919061386e565b6106f5565b005b61029a600480360381019061029591906138c7565b610741565b6040516102ae98979695949392919061391f565b60405180910390f35b6102bf6107e0565b6040516102cc91906137f5565b60405180910390f35b6102ef60048036038101906102ea919061399d565b6107e6565b005b61030b600480360381019061030691906139dd565b610cb6565b005b61032760048036038101906103229190613a49565b610d35565b005b610331610f76565b60405161033e91906137f5565b60405180910390f35b610361600480360381019061035c91906139dd565b610f7c565b60405161036e91906137f5565b60405180910390f35b610391600480360381019061038c9190613ab0565b611065565b60405161039e9190613bae565b60405180910390f35b6103c160048036038101906103bc9190613d29565b6110ca565b005b6103cb6114ee565b6040516103d89190613d85565b60405180910390f35b6103fb60048036038101906103f691906139dd565b611514565b005b61040561178d565b60405161041291906137f5565b60405180910390f35b6104356004803603810190610430919061399d565b611793565b60405161044291906137f5565b60405180910390f35b610465600480360381019061046091906138c7565b6119e7565b005b610481600480360381019061047c91906138c7565b611bde565b005b61048b611ed6565b60405161049891906137f5565b60405180910390f35b6104a9611edd565b005b6104b3611f10565b005b6104bd611f24565b6040516104ca91906137f5565b60405180910390f35b6104ed60048036038101906104e89190613dcc565b611f2a565b005b6104f7612125565b60405161050491906137f5565b60405180910390f35b61051561212b565b6040516105229190613d85565b60405180910390f35b610533612154565b60405161054091906137f5565b60405180910390f35b610563600480360381019061055e919061386e565b61215a565b005b61057f600480360381019061057a9190613f0e565b61218f565b60405161058c9190613fec565b60405180910390f35b6105af60048036038101906105aa9190613d29565b6121a4565b005b6105cb60048036038101906105c691906139dd565b61266a565b005b6105d561289e565b6040516105e291906137f5565b60405180910390f35b61060560048036038101906106009190613ab0565b6128a4565b60405161061291906137f5565b60405180910390f35b61063560048036038101906106309190614007565b612902565b6040516106429190613fec565b60405180910390f35b6106656004803603810190610660919061386e565b612917565b005b61066f61299d565b60405161067c91906140fd565b60405180910390f35b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60075481565b6106fd6129c3565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6001818154811061075157600080fd5b90600052602060002090600602016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160159054906101000a900460ff16908060010154908060020154908060030154908060040154908060050160009054906101000a900460ff16905088565b60035481565b60085443101580156107f9575060075443105b1561083e576127106121346009546108119190614147565b61081b91906141b8565b60098190555062093a806008600082825461083691906141e9565b925050819055505b6000600183815481106108545761085361421d565b5b9060005260206000209060060201905060006002600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506108c1846119e7565b600081600001541115610c505760008260000160009054906101000a900460ff166108f457670de0b6b3a76400006108f7565b60015b67ffffffffffffffff16836004015483600001546109159190614147565b61091f91906141b8565b90508160030154811115610c4e57600082600301548261093f919061424c565b9050600b54431015610a7c576000612710600c548361095e9190614147565b61096891906141b8565b90506109d9600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a4a9092919063ffffffff16565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663282d3fdf87836040518363ffffffff1660e01b8152600401610a36929190614280565b600060405180830381600087803b158015610a5057600080fd5b505af1158015610a64573d6000803e3d6000fd5b505050508082610a74919061424c565b915050610bf4565b600b5483600401541015610bf3576000836004015443610a9c919061424c565b8460040154600b54610aae919061424c565b83610ab99190614147565b610ac391906141b8565b90506000612710600c5483610ad89190614147565b610ae291906141b8565b9050610b53600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a4a9092919063ffffffff16565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663282d3fdf88836040518363ffffffff1660e01b8152600401610bb0929190614280565b600060405180830381600087803b158015610bca57600080fd5b505af1158015610bde573d6000803e3d6000fd5b505050508083610bee919061424c565b925050505b5b610bfe8582612ae6565b8473ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610c4491906137f5565b60405180910390a2505b505b4381600401819055508160000160009054906101000a900460ff16610c7d57670de0b6b3a7640000610c80565b60015b67ffffffffffffffff1682600401548260000154610c9e9190614147565b610ca891906141b8565b816003018190555050505050565b610cbe6129c3565b610cc6611edd565b600060018381548110610cdc57610cdb61421d565b5b906000526020600020906006020190508060050160009054906101000a900460ff1615610d2757818160020154600354610d16919061424c565b610d2091906141e9565b6003819055505b818160020181905550505050565b610d3d6129c3565b62093a80600754610d4e91906141e9565b431015610ec757600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90614306565b60405180910390fd5b6000600180549050905060005b81811015610ec457600060018281548110610e1057610e0f61421d565b5b906000526020600020906006020190508060000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1603610eb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea990614372565b60405180910390fd5b5080610ebd90614392565b9050610df2565b50505b8315610f44578273ffffffffffffffffffffffffffffffffffffffff1663f242432a30838560016040518563ffffffff1660e01b8152600401610f0d949392919061444c565b600060405180830381600087803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b50505050610f70565b610f6f81838573ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b5b50505050565b600c5481565b600080610f8b43600754612cbc565b9050828410610f9e57600091505061105f565b80831061100357808410610fb657600091505061105f565b6006548411610fe25760095460065482610fd0919061424c565b610fda9190614147565b91505061105f565b6009548482610ff1919061424c565b610ffb9190614147565b91505061105f565b600654831161101657600091505061105f565b60065484116110425760095460065484611030919061424c565b61103a9190614147565b91505061105f565b6009548484611051919061424c565b61105b9190614147565b9150505b92915050565b60606110c26002600084815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101612cd5565b905092915050565b60085443101580156110dd575060075443105b15611122576127106121346009546110f59190614147565b6110ff91906141b8565b60098190555062093a806008600082825461111a91906141e9565b925050819055505b6000815111611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d906144f0565b60405180910390fd5b6010815111156111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a29061455c565b60405180910390fd5b60003390506000600184815481106111c6576111c561421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff1661127b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611272906145c8565b60405180910390fd5b60005b84518160ff16101561130f576112bd858260ff16815181106112a3576112a261421d565b5b602002602001015183600101612cf690919063ffffffff16565b6112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390614634565b60405180910390fd5b808061130790614654565b91505061127e565b5061131a85846107e6565b60005b84518160ff1610156114c1576001826000015461133a919061424c565b8260000181905550611375858260ff168151811061135b5761135a61421d565b5b602002602001015183600101612d1090919063ffffffff16565b5060018360010154611387919061424c565b83600101819055508260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a3086888560ff16815181106113e7576113e661421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401611410949392919061444c565b600060405180830381600087803b15801561142a57600080fd5b505af115801561143e573d6000803e3d6000fd5b50505050858473ffffffffffffffffffffffffffffffffffffffff167fcae6e85b835fcf864c07fb3cd4909bf840bf5114adf6a9f2553470fe7ca78ddc878460ff16815181106114915761149061421d565b5b60200260200101516040516114a691906137f5565b60405180910390a380806114b990614654565b91505061131d565b50438160040181905550816004015481600001546114df9190614147565b81600301819055505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6008544310158015611527575060075443105b1561156c5761271061213460095461153f9190614147565b61154991906141b8565b60098190555062093a806008600082825461156491906141e9565b925050819055505b60003390506000600184815481106115875761158661421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff161561163d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611634906145c8565b60405180910390fd5b8381600001541015611684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167b906146c9565b60405180910390fd5b61168e85846107e6565b6000841115611786578381600001546116a7919061424c565b81600001819055506116fe83858460000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b438160040181905550670de0b6b3a7640000826004015482600001546117249190614147565b61172e91906141b8565b8160030181905550848373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688660405161177d91906137f5565b60405180910390a35b5050505050565b60065481565b600080600184815481106117aa576117a961421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008260040154905060008360000160009054906101000a900460ff166118d2578360000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161188c9190613d85565b602060405180830381865afa1580156118a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cd91906146fe565b6118eb565b670de0b6b3a764000084600101546118ea9190614147565b5b9050836003015443118015611901575060008114155b15611968576000611916856003015443610f7c565b9050600060035486600201548361192d9190614147565b61193791906141b8565b905082670de0b6b3a76400008261194e9190614147565b61195891906141b8565b8461196391906141e9565b935050505b60008460000160009054906101000a900460ff1661198e57670de0b6b3a7640000611991565b60015b67ffffffffffffffff168385600001546119ab9190614147565b6119b591906141b8565b9050836003015481116119c95760006119da565b8360030154816119d9919061424c565b5b9550505050505092915050565b6000600182815481106119fd576119fc61421d565b5b9060005260206000209060060201905080600301544311611a1e5750611bdb565b60008160000160009054906101000a900460ff16611ad9578160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611a939190613d85565b602060405180830381865afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad491906146fe565b611af2565b670de0b6b3a76400008260010154611af19190614147565b5b905060008103611b0c574382600301819055505050611bdb565b8160050160009054906101000a900460ff16611b585760018260050160006101000a81548160ff0219169083151502179055508160020154600354611b5191906141e9565b6003819055505b60006003541115611bcf576000611b73836003015443610f7c565b90506000600354846002015483611b8a9190614147565b611b9491906141b8565b905082670de0b6b3a764000082611bab9190614147565b611bb591906141b8565b8460040154611bc491906141e9565b846004018190555050505b43826003018190555050505b50565b600060018281548110611bf457611bf361421d565b5b9060005260206000209060060201905060006002600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015490508260000160009054906101000a900460ff1615611e1d576000611c8683600101612cd5565b905060005b81518160ff161015611e1657611cca828260ff1681518110611cb057611caf61421d565b5b602002602001015185600101612d1090919063ffffffff16565b5060018560010154611cdc919061424c565b85600101819055508460000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a3033858560ff1681518110611d3c57611d3b61421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401611d65949392919061444c565b600060405180830381600087803b158015611d7f57600080fd5b505af1158015611d93573d6000803e3d6000fd5b50505050853373ffffffffffffffffffffffffffffffffffffffff167ffc474cc8a8ad31db497d8cdf9be4f6e090ce666b34f7c9f505a97d5f700b41b2848460ff1681518110611de657611de561421d565b5b6020026020010151604051611dfb91906137f5565b60405180910390a38080611e0e90614654565b915050611c8b565b5050611ebc565b611e6c33828560000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b833373ffffffffffffffffffffffffffffffffffffffff167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059583604051611eb391906137f5565b60405180910390a35b600082600001819055506000826003018190555050505050565b62093a8081565b6000600180549050905060005b81811015611f0c57611efb816119e7565b80611f0590614392565b9050611eea565b5050565b611f186129c3565b611f226000612d2a565b565b600b5481565b611f326129c3565b611f3d858585612dee565b8115611f4c57611f4b611edd565b5b600654431015611f7e5760008103611f68576006549050611f79565b600654811015611f785760065490505b5b611f96565b6000811480611f8c57504381105b15611f95574390505b5b600060065482111580611fa95750438211155b9050600160405180610100016040528088151581526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018660ff1681526020016000815260200189815260200184815260200160008152602001831515815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160000160156101000a81548160ff021916908360ff160217905550606082015181600101556080820151816002015560a0820151816003015560c0820151816004015560e08201518160050160006101000a81548160ff0219169083151502179055505050801561211c578660035461211591906141e9565b6003819055505b50505050505050565b60095481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61271081565b6000600180549050905060005b8181101561218a5761217981846107e6565b8061218390614392565b9050612167565b505050565b600063bc197c8160e01b905095945050505050565b60085443101580156121b7575060075443105b156121fc576127106121346009546121cf9190614147565b6121d991906141b8565b60098190555062093a80600860008282546121f491906141e9565b925050819055505b6000815111612240576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612237906144f0565b60405180910390fd5b601081511115612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9061455c565b60405180910390fd5b60003390506000600184815481106122a05761229f61421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff16612355576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161234c906145c8565b60405180910390fd5b60005b84518160ff16101561248b5760011515600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9730a4d878460ff16815181106123bc576123bb61421d565b5b60200260200101518660000160159054906101000a900460ff166040518363ffffffff1660e01b81526004016123f392919061472b565b6020604051808303816000875af1158015612412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124369190614769565b151514612478576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161246f906147e2565b60405180910390fd5b808061248390614654565b915050612358565b5061249685846107e6565b60005b84518160ff16101561263d578260000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a8530888560ff16815181106124fd576124fc61421d565b5b602002602001015160016040518563ffffffff1660e01b8152600401612526949392919061444c565b600060405180830381600087803b15801561254057600080fd5b505af1158015612554573d6000803e3d6000fd5b505050506001826000015461256991906141e9565b82600001819055506125a4858260ff168151811061258a5761258961421d565b5b60200260200101518360010161304290919063ffffffff16565b50600183600101546125b691906141e9565b8360010181905550858473ffffffffffffffffffffffffffffffffffffffff167f7ad89f71bfd411c34e67f1593de34f11c471d79fdb7ed6adadf0253814be9f36878460ff168151811061260d5761260c61421d565b5b602002602001015160405161262291906137f5565b60405180910390a3808061263590614654565b915050612499565b504381600401819055508160040154816000015461265b9190614147565b81600301819055505050505050565b600854431015801561267d575060075443105b156126c2576127106121346009546126959190614147565b61269f91906141b8565b60098190555062093a80600860008282546126ba91906141e9565b925050819055505b60003390506000600184815481106126dd576126dc61421d565b5b9060005260206000209060060201905060006002600086815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900460ff1615612793576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161278a906145c8565b60405180910390fd5b61279d85846107e6565b6000841115612897576127f78330868560000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661305c909392919063ffffffff16565b83816000015461280791906141e9565b8160000181905550438160040181905550670de0b6b3a7640000826004015482600001546128359190614147565b61283f91906141b8565b8160030181905550848373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a158660405161288e91906137f5565b60405180910390a35b5050505050565b60085481565b60006002600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154905092915050565b600063f23a6e6160e01b905095945050505050565b61291f6129c3565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036129915760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016129889190613d85565b60405180910390fd5b61299a81612d2a565b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6129cb6130de565b73ffffffffffffffffffffffffffffffffffffffff166129e961212b565b73ffffffffffffffffffffffffffffffffffffffff1614612a4857612a0c6130de565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401612a3f9190613d85565b60405180910390fd5b565b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401612a87929190614802565b602060405180830381865afa158015612aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac891906146fe565b9050612ae084848484612adb91906141e9565b6130e6565b50505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612b439190613d85565b602060405180830381865afa158015612b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8491906146fe565b90506000811115612c385780821115612be957612be48382600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b612c37565b612c368383600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612c3d9092919063ffffffff16565b5b5b505050565b612cb7838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401612c70929190614280565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b505050565b6000818310612ccb5781612ccd565b825b905092915050565b60606000612ce58360000161328c565b905060608190508092505050919050565b6000612d08836000018360001b6132e8565b905092915050565b6000612d22836000018360001b61330b565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600180549050905060005b8181101561303b578415612f3e5760018181548110612e1d57612e1c61421d565b5b906000526020600020906006020160000160009054906101000a900460ff1615612f39578373ffffffffffffffffffffffffffffffffffffffff1660018281548110612e6c57612e6b61421d565b5b906000526020600020906006020160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580612ef957508260ff1660018281548110612ed457612ed361421d565b5b906000526020600020906006020160000160159054906101000a900460ff1660ff1614155b612f38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2f90614877565b60405180910390fd5b5b61302a565b60018181548110612f5257612f5161421d565b5b906000526020600020906006020160000160009054906101000a900460ff16613029578373ffffffffffffffffffffffffffffffffffffffff1660018281548110612fa057612f9f61421d565b5b906000526020600020906006020160000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603613028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161301f90614877565b60405180910390fd5b5b5b8061303490614392565b9050612dfb565b5050505050565b6000613054836000018360001b61341f565b905092915050565b6130d8848573ffffffffffffffffffffffffffffffffffffffff166323b872dd86868660405160240161309193929190614897565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b50505050565b600033905090565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b38484604051602401613117929190614280565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050509050613165848261348f565b6131ef576131e4848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b386600060405160240161319d929190614909565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506131f5565b6131ee84826131f5565b5b50505050565b6000613220828473ffffffffffffffffffffffffffffffffffffffff1661355690919063ffffffff16565b905060008151141580156132455750808060200190518101906132439190614769565b155b1561328757826040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161327e9190613d85565b60405180910390fd5b505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156132dc57602002820191906000526020600020905b8154815260200190600101908083116132c8575b50505050509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461341357600060018261333d919061424c565b9050600060018660000180549050613355919061424c565b90508082146133c45760008660000182815481106133765761337561421d565b5b906000526020600020015490508087600001848154811061339a5761339961421d565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b856000018054806133d8576133d7614932565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050613419565b60009150505b92915050565b600061342b83836132e8565b613484578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050613489565b600090505b92915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff16846040516134b991906149d2565b6000604051808303816000865af19150503d80600081146134f6576040519150601f19603f3d011682016040523d82523d6000602084013e6134fb565b606091505b509150915081801561352957506000815114806135285750808060200190518101906135279190614769565b5b5b801561354c575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b60606135648383600061356c565b905092915050565b6060814710156135b357306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016135aa9190613d85565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1684866040516135dc91906149d2565b60006040518083038185875af1925050503d8060008114613619576040519150601f19603f3d011682016040523d82523d6000602084013e61361e565b606091505b509150915061362e868383613639565b925050509392505050565b60608261364e57613649826136c8565b6136c0565b60008251148015613676575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156136b857836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016136af9190613d85565b60405180910390fd5b8190506136c1565b5b9392505050565b6000815111156136db5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61375681613721565b811461376157600080fd5b50565b6000813590506137738161374d565b92915050565b60006020828403121561378f5761378e613717565b5b600061379d84828501613764565b91505092915050565b60008115159050919050565b6137bb816137a6565b82525050565b60006020820190506137d660008301846137b2565b92915050565b6000819050919050565b6137ef816137dc565b82525050565b600060208201905061380a60008301846137e6565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061383b82613810565b9050919050565b61384b81613830565b811461385657600080fd5b50565b60008135905061386881613842565b92915050565b60006020828403121561388457613883613717565b5b600061389284828501613859565b91505092915050565b6138a4816137dc565b81146138af57600080fd5b50565b6000813590506138c18161389b565b92915050565b6000602082840312156138dd576138dc613717565b5b60006138eb848285016138b2565b91505092915050565b6138fd81613830565b82525050565b600060ff82169050919050565b61391981613903565b82525050565b600061010082019050613935600083018b6137b2565b613942602083018a6138f4565b61394f6040830189613910565b61395c60608301886137e6565b61396960808301876137e6565b61397660a08301866137e6565b61398360c08301856137e6565b61399060e08301846137b2565b9998505050505050505050565b600080604083850312156139b4576139b3613717565b5b60006139c2858286016138b2565b92505060206139d385828601613859565b9150509250929050565b600080604083850312156139f4576139f3613717565b5b6000613a02858286016138b2565b9250506020613a13858286016138b2565b9150509250929050565b613a26816137a6565b8114613a3157600080fd5b50565b600081359050613a4381613a1d565b92915050565b60008060008060808587031215613a6357613a62613717565b5b6000613a7187828801613a34565b9450506020613a8287828801613859565b9350506040613a93878288016138b2565b9250506060613aa487828801613859565b91505092959194509250565b60008060408385031215613ac757613ac6613717565b5b6000613ad585828601613859565b9250506020613ae6858286016138b2565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613b25816137dc565b82525050565b6000613b378383613b1c565b60208301905092915050565b6000602082019050919050565b6000613b5b82613af0565b613b658185613afb565b9350613b7083613b0c565b8060005b83811015613ba1578151613b888882613b2b565b9750613b9383613b43565b925050600181019050613b74565b5085935050505092915050565b60006020820190508181036000830152613bc88184613b50565b905092915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613c1e82613bd5565b810181811067ffffffffffffffff82111715613c3d57613c3c613be6565b5b80604052505050565b6000613c5061370d565b9050613c5c8282613c15565b919050565b600067ffffffffffffffff821115613c7c57613c7b613be6565b5b602082029050602081019050919050565b600080fd5b6000613ca5613ca084613c61565b613c46565b90508083825260208201905060208402830185811115613cc857613cc7613c8d565b5b835b81811015613cf15780613cdd88826138b2565b845260208401935050602081019050613cca565b5050509392505050565b600082601f830112613d1057613d0f613bd0565b5b8135613d20848260208601613c92565b91505092915050565b60008060408385031215613d4057613d3f613717565b5b6000613d4e858286016138b2565b925050602083013567ffffffffffffffff811115613d6f57613d6e61371c565b5b613d7b85828601613cfb565b9150509250929050565b6000602082019050613d9a60008301846138f4565b92915050565b613da981613903565b8114613db457600080fd5b50565b600081359050613dc681613da0565b92915050565b60008060008060008060c08789031215613de957613de8613717565b5b6000613df789828a016138b2565b9650506020613e0889828a01613a34565b9550506040613e1989828a01613859565b9450506060613e2a89828a01613db7565b9350506080613e3b89828a01613a34565b92505060a0613e4c89828a016138b2565b9150509295509295509295565b600080fd5b600067ffffffffffffffff821115613e7957613e78613be6565b5b613e8282613bd5565b9050602081019050919050565b82818337600083830152505050565b6000613eb1613eac84613e5e565b613c46565b905082815260208101848484011115613ecd57613ecc613e59565b5b613ed8848285613e8f565b509392505050565b600082601f830112613ef557613ef4613bd0565b5b8135613f05848260208601613e9e565b91505092915050565b600080600080600060a08688031215613f2a57613f29613717565b5b6000613f3888828901613859565b9550506020613f4988828901613859565b945050604086013567ffffffffffffffff811115613f6a57613f6961371c565b5b613f7688828901613cfb565b935050606086013567ffffffffffffffff811115613f9757613f9661371c565b5b613fa388828901613cfb565b925050608086013567ffffffffffffffff811115613fc457613fc361371c565b5b613fd088828901613ee0565b9150509295509295909350565b613fe681613721565b82525050565b60006020820190506140016000830184613fdd565b92915050565b600080600080600060a0868803121561402357614022613717565b5b600061403188828901613859565b955050602061404288828901613859565b9450506040614053888289016138b2565b9350506060614064888289016138b2565b925050608086013567ffffffffffffffff8111156140855761408461371c565b5b61409188828901613ee0565b9150509295509295909350565b6000819050919050565b60006140c36140be6140b984613810565b61409e565b613810565b9050919050565b60006140d5826140a8565b9050919050565b60006140e7826140ca565b9050919050565b6140f7816140dc565b82525050565b600060208201905061411260008301846140ee565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614152826137dc565b915061415d836137dc565b925082820261416b816137dc565b9150828204841483151761418257614181614118565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006141c3826137dc565b91506141ce836137dc565b9250826141de576141dd614189565b5b828204905092915050565b60006141f4826137dc565b91506141ff836137dc565b925082820190508082111561421757614216614118565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614257826137dc565b9150614262836137dc565b925082820390508181111561427a57614279614118565b5b92915050565b600060408201905061429560008301856138f4565b6142a260208301846137e6565b9392505050565b600082825260208201905092915050565b7f43616e6e6f742077697468647261772072657761726420746f6b656e00000000600082015250565b60006142f0601c836142a9565b91506142fb826142ba565b602082019050919050565b6000602082019050818103600083015261431f816142e3565b9050919050565b7f43616e6e6f7420776974686472617720706f6f6c20746f6b656e000000000000600082015250565b600061435c601a836142a9565b915061436782614326565b602082019050919050565b6000602082019050818103600083015261438b8161434f565b9050919050565b600061439d826137dc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036143cf576143ce614118565b5b600182019050919050565b6000819050919050565b60006143ff6143fa6143f5846143da565b61409e565b6137dc565b9050919050565b61440f816143e4565b82525050565b600082825260208201905092915050565b50565b6000614436600083614415565b915061444182614426565b600082019050919050565b600060a08201905061446160008301876138f4565b61446e60208301866138f4565b61447b60408301856137e6565b6144886060830184614406565b818103608083015261449981614429565b905095945050505050565b7f4d757374206465706f736974206174206c656173742031204e46540000000000600082015250565b60006144da601b836142a9565b91506144e5826144a4565b602082019050919050565b60006020820190508181036000830152614509816144cd565b9050919050565b7f546f6f206d616e79204e46547300000000000000000000000000000000000000600082015250565b6000614546600d836142a9565b915061455182614510565b602082019050919050565b6000602082019050818103600083015261457581614539565b9050919050565b7f57726f6e6720706f6f6c00000000000000000000000000000000000000000000600082015250565b60006145b2600a836142a9565b91506145bd8261457c565b602082019050919050565b600060208201905081810360008301526145e1816145a5565b9050919050565b7f496e76616c6964207374616b6564204e46540000000000000000000000000000600082015250565b600061461e6012836142a9565b9150614629826145e8565b602082019050919050565b6000602082019050818103600083015261464d81614611565b9050919050565b600061465f82613903565b915060ff820361467257614671614118565b5b600182019050919050565b7f7769746864726177206f766572207374616b656420616d6f756e740000000000600082015250565b60006146b3601b836142a9565b91506146be8261467d565b602082019050919050565b600060208201905081810360008301526146e2816146a6565b9050919050565b6000815190506146f88161389b565b92915050565b60006020828403121561471457614713613717565b5b6000614722848285016146e9565b91505092915050565b600060408201905061474060008301856137e6565b61474d6020830184613910565b9392505050565b60008151905061476381613a1d565b92915050565b60006020828403121561477f5761477e613717565b5b600061478d84828501614754565b91505092915050565b7f496e76616c6964204e4654205469657200000000000000000000000000000000600082015250565b60006147cc6010836142a9565b91506147d782614796565b602082019050919050565b600060208201905081810360008301526147fb816147bf565b9050919050565b600060408201905061481760008301856138f4565b61482460208301846138f4565b9392505050565b7f4578697374696e6720706f6f6c3f000000000000000000000000000000000000600082015250565b6000614861600e836142a9565b915061486c8261482b565b602082019050919050565b6000602082019050818103600083015261489081614854565b9050919050565b60006060820190506148ac60008301866138f4565b6148b960208301856138f4565b6148c660408301846137e6565b949350505050565b6000819050919050565b60006148f36148ee6148e9846148ce565b61409e565b6137dc565b9050919050565b614903816148d8565b82525050565b600060408201905061491e60008301856138f4565b61492b60208301846148fa565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081519050919050565b600081905092915050565b60005b8381101561499557808201518184015260208101905061497a565b60008484015250505050565b60006149ac82614961565b6149b6818561496c565b93506149c6818560208601614977565b80840191505092915050565b60006149de82846149a1565b91508190509291505056fea264697066735822122043b5346053d4ab15936670b671c3648a27f3b9686ed3b99112ce84b88685c0b564736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000c2ffacd70c1d1cb04d4803dea055dd9d4b5760100000000000000000000000000000000000000000000000000000000001287570000000000000000000000000000000000000000000000000000000001fba3d7000000000000000000000000000000000000000000000000037149b995050700000000000000000000000000000000000000000000000000000000000024fc57000000000000000000000000e3a108725fd1a435e045ab8036685018e330ca86000000000000000000000000f3bd4c43f63b5b0fd05f08a91863090d029d1cee
-----Decoded View---------------
Arg [0] : _rewardToken (address): 0x0c2fFacD70c1D1CB04D4803Dea055DD9D4B57601
Arg [1] : _startBlock (uint256): 1214295
Arg [2] : _endBlock (uint256): 33268695
Arg [3] : _rewardPerBlock (uint256): 248060515900000000
Arg [4] : _lockEndBlock (uint256): 2423895
Arg [5] : _vestingPool (address): 0xE3A108725fD1a435E045aB8036685018e330CA86
Arg [6] : _nftValidator (address): 0xF3bD4C43F63b5B0Fd05f08A91863090d029d1cEE
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000c2ffacd70c1d1cb04d4803dea055dd9d4b57601
Arg [1] : 0000000000000000000000000000000000000000000000000000000000128757
Arg [2] : 0000000000000000000000000000000000000000000000000000000001fba3d7
Arg [3] : 000000000000000000000000000000000000000000000000037149b995050700
Arg [4] : 000000000000000000000000000000000000000000000000000000000024fc57
Arg [5] : 000000000000000000000000e3a108725fd1a435e045ab8036685018e330ca86
Arg [6] : 000000000000000000000000f3bd4c43f63b5b0fd05f08a91863090d029d1cee
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.47
Net Worth in ETH
0.00016
Token Allocations
BLAST
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| BLAST | 100.00% | $0.000748 | 631.9961 | $0.4725 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.