Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
TokenTracker
Multichain Info
N/A
Latest 25 from a total of 36 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Lock Batch | 3508300 | 510 days ago | IN | 0 ETH | 0.00012425 | ||||
Redeem Batch | 3508300 | 510 days ago | IN | 0 ETH | 0.00007107 | ||||
Approve | 3508299 | 510 days ago | IN | 0 ETH | 0.00007307 | ||||
Lock Batch | 3507764 | 510 days ago | IN | 0 ETH | 0.00035411 | ||||
Approve | 3489470 | 513 days ago | IN | 0 ETH | 0.00006951 | ||||
Approve | 3469353 | 516 days ago | IN | 0 ETH | 0.00004634 | ||||
Sell Batch | 3469315 | 516 days ago | IN | 0 ETH | 0.00014842 | ||||
Approve | 3464331 | 516 days ago | IN | 0 ETH | 0.00011585 | ||||
Sell Batch | 3464238 | 516 days ago | IN | 0 ETH | 0.0001471 | ||||
Sell Batch | 3463461 | 517 days ago | IN | 0 ETH | 0.00014781 | ||||
Buy Batch | 3462348 | 517 days ago | IN | 0 ETH | 0.00022617 | ||||
Sell Batch | 3462344 | 517 days ago | IN | 0 ETH | 0.00016205 | ||||
Buy Batch | 3428671 | 522 days ago | IN | 0 ETH | 0.00028686 | ||||
Sell Batch | 3428621 | 522 days ago | IN | 0 ETH | 0.00015005 | ||||
Sell Batch | 3428617 | 522 days ago | IN | 0 ETH | 0.0002048 | ||||
Buy Batch | 3428510 | 522 days ago | IN | 0 ETH | 0.00028686 | ||||
Buy Batch | 3428501 | 522 days ago | IN | 0 ETH | 0.0001111 | ||||
Sell Batch | 3428494 | 522 days ago | IN | 0 ETH | 0.00023436 | ||||
Buy Batch | 3428487 | 522 days ago | IN | 0 ETH | 0.00020217 | ||||
Sell Batch | 3428482 | 522 days ago | IN | 0 ETH | 0.00020104 | ||||
Buy Batch | 3427639 | 522 days ago | IN | 0 ETH | 0.00020217 | ||||
Buy Batch | 3427563 | 522 days ago | IN | 0 ETH | 0.00025692 | ||||
Buy Batch | 3427560 | 522 days ago | IN | 0 ETH | 0.00017755 | ||||
Approve | 3427557 | 522 days ago | IN | 0 ETH | 0.00007307 | ||||
Sell Batch | 3427549 | 522 days ago | IN | 0 ETH | 0.00022684 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
3421156 | 523 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
SeparatePool
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/ISeparatePool.sol"; import "../utils/TransferNFT.sol"; contract SeparatePool is ERC20Permit, TransferNFT, ISeparatePool { IERC20 FUR; uint256 public constant SWAP_MINT_AMOUNT = 1000e18; uint256 public constant LOCK_MINT_AMOUNT = 500e18; uint256 public constant RELEASE_PUNISHMENT_AMOUNT = 300e18; address public immutable factory; address public immutable nft; // Transfer fee to income maker // Fees in this contract are in the form of F-X tokens address public immutable incomeMaker; // Amount of F-X to mint on top of just 500 when locking uint256 lockMintBuffer; // Lock period in seconds uint256 public lockPeriod; // Amount of FUR to pay uint256 buyFee = 100e18; uint256 lockFee = 150e18; // Pool admin address public owner; struct LockInfo { address locker; uint128 releaseTime; uint128 mintBuffer; // lockMintBuffer value WHEN NFT IS LOCKED } mapping(uint256 => LockInfo) public lockInfo; constructor( address _nftAddress, address _incomeMaker, address _fur, address _owner, string memory _tokenName, string memory _tokenSymbol ) ERC20Permit(_tokenName) ERC20(_tokenName, _tokenSymbol) { factory = msg.sender; incomeMaker = _incomeMaker; nft = _nftAddress; FUR = IERC20(_fur); owner = _owner; // 2 months lock period by default lockPeriod = 60 * 24 * 3600; } modifier onlyOwner() { require(msg.sender == owner, "SeparatePool: Not permitted to call."); _; } modifier onlyFactory() { require(msg.sender == factory, "SeparatePool: Not permitted to call."); _; } /** * @dev Get complete lock info of NFT */ function getLockInfo(uint256 _id) public view returns (LockInfo memory) { return lockInfo[_id]; } /** * @dev Change fee rate for buying NFT after governance voting */ function setBuyFee(uint256 _newFee) external onlyOwner { buyFee = _newFee; } /** * @dev Change fee rate for locking NFT after governance voting */ function setLockFee(uint256 _newFee) external onlyOwner { lockFee = _newFee; } function setLockMintBuffer(uint256 _newAmount) external onlyOwner { require(_newAmount < 100e18 + 1, "Buffer too large"); lockMintBuffer = _newAmount; } function setLockPeriod(uint256 _periodInDays) external /*onlyOwner*/ { lockPeriod = _periodInDays * 24 * 3600; } /** * @dev Change pool admin */ function changeOwner(address _newOwner) external onlyFactory { address oldOwner = owner; owner = _newOwner; emit OwnerChanged(oldOwner, _newOwner); } function setFur(address _newFur) external onlyFactory { FUR = IERC20(_newFur); } /** * @dev Sell single NFT and mint 1000 tokens immediately */ function sell(uint256 _id) external { _sell(_id, true); } /** * @dev Sell multiple NFTs of same collection in one tx */ function sellBatch(uint256[] calldata _ids) external { // Number of NFTs in list uint256 length = _ids.length; require(length < 10, "SeparatePool: Can only sell 9 NFTs at once"); for (uint256 i; i < length; ) { // Mint total amount all at once, so _updateNow is false _sell(_ids[i], false); unchecked { ++i; } } _mint(msg.sender, SWAP_MINT_AMOUNT * length); } /** * @dev Buy single NFT and burn 1000 tokens immediately */ function buy(uint256 _id) external { _buy(_id, true); } /** * @dev Buy multiple NFTs of same collection in one tx */ function buyBatch(uint256[] calldata _ids) external { // Number of NFTs to buy uint256 length = _ids.length; require(length < 10, "SeparatePool: Can only buy 9 NFTs at once"); uint256 burnTotal = SWAP_MINT_AMOUNT * length; uint256 feeTotal = buyFee * length; _burn(msg.sender, burnTotal); FUR.transferFrom(msg.sender, incomeMaker, feeTotal); for (uint256 i; i < length; ) { // Collected fee all at once, so _updateNow is false _buy(_ids[i], false); unchecked { ++i; } } } /** * @dev Lock a single NFT */ function lock(uint256 _id) external { _lock(_id, true, lockMintBuffer); } /** * @dev Lock multiple NFTs of same collection */ function lockBatch(uint256[] calldata _ids) external { // Number of NFTs to buy uint256 length = _ids.length; require(length < 10, "SeparatePool: Can only buy 9 NFTs at once"); uint256 _lockMintBuffer = lockMintBuffer; uint256 mintTotal = (LOCK_MINT_AMOUNT + _lockMintBuffer) * length; uint256 feeTotal = lockFee * length; FUR.transferFrom(msg.sender, incomeMaker, feeTotal); for (uint256 i; i < length; ) { // Collected fee all at once, so _updateNow is false _lock(_ids[i], false, _lockMintBuffer); unchecked { ++i; } } _mint(msg.sender, mintTotal); } /** * @dev Redeem locked NFT by paying 500 F-X */ function redeem(uint256 _id) public { _redeem(_id, true); } /** * @dev Redeem multiple NFTs of same collection */ function redeemBatch(uint256[] calldata _ids) external { uint256 length = _ids.length; require(length < 10, "SeparatePool: Can only redeem 9 NFTs at once"); uint256 burnTotal; for (uint256 i; i < length; ) { burnTotal += LOCK_MINT_AMOUNT + lockInfo[_ids[i]].mintBuffer; unchecked { ++i; } } _burn(msg.sender, burnTotal); for (uint256 i; i < length; ) { _redeem(_ids[i], false); unchecked { ++i; } } } /** * @notice Only 700 F-X is minted IN TOTAL to locker as a penalty * * @dev Release NFT to public for buying. Mint F-X to locker and punishment * amount to income maker */ function release(uint256 _id) external onlyOwner { require(lockInfo[_id].locker != address(0), "SeparatePool: NFT is not locked."); require(lockInfo[_id].releaseTime < block.timestamp, "SeparatePool: Release time not yet reached."); address sendRemainingTo = lockInfo[_id].locker; uint256 mintBuffer = lockInfo[_id].mintBuffer; delete lockInfo[_id]; _mint(sendRemainingTo, LOCK_MINT_AMOUNT - mintBuffer - RELEASE_PUNISHMENT_AMOUNT); _mint(incomeMaker, RELEASE_PUNISHMENT_AMOUNT); emit ReleasedNFT(_id); } /** * @dev Sell NFT to pool and get 1000 F-X * * @param _updateNow Determines if minting is done immediately or after * multiple calls (batched) */ function _sell(uint256 _id, bool _updateNow) private { _transferInNFT(nft, _id); if (_updateNow) { _mint(msg.sender, SWAP_MINT_AMOUNT); } emit SoldNFT(_id, msg.sender); } /** * @dev Buy NFT from pool by paying 1000 F-X * * @param _updateNow Determines if burning is done immediately or after * multiple calls (batched) */ function _buy(uint256 _id, bool _updateNow) private { require(lockInfo[_id].locker == address(0), "SeparatePool: Cannot buy locked NFT."); if (_updateNow) { _burn(msg.sender, SWAP_MINT_AMOUNT); FUR.transferFrom(msg.sender, incomeMaker, buyFee); } _transferOutNFT(nft, msg.sender, _id); emit BoughtNFT(_id, msg.sender); } /** * @dev Lock NFT to pool for 60 days and get 500 F-X, paying 150 FUR as fees. * * @param _updateNow Determines if burning is done immediately or after * multiple calls (batched) * @param _lockMintBuffer Mint buffer amount at the moment of execution. * Passed as param to avoid cold storage access in every loop during * batch execution */ function _lock(uint256 _id, bool _updateNow, uint256 _lockMintBuffer) private { _transferInNFT(nft, _id); if (_updateNow) { FUR.transferFrom(msg.sender, incomeMaker, lockFee); _mint(msg.sender, LOCK_MINT_AMOUNT + _lockMintBuffer); } lockInfo[_id].locker = msg.sender; uint256 releaseTime = block.timestamp + lockPeriod; lockInfo[_id].releaseTime = uint128(releaseTime); lockInfo[_id].mintBuffer = uint128(_lockMintBuffer); emit LockedNFT(_id, msg.sender, block.timestamp, releaseTime); } function _redeem(uint256 _id, bool _updateNow) private { require(lockInfo[_id].locker == msg.sender, "SeparatePool: You did not lock this NFT."); require( lockInfo[_id].releaseTime > block.timestamp, "SeparatePool: NFT has already been released to public pool." ); if (_updateNow) _burn(msg.sender, LOCK_MINT_AMOUNT + lockInfo[_id].mintBuffer); delete lockInfo[_id]; _transferOutNFT(nft, msg.sender, _id); emit RedeemedNFT(_id, msg.sender); } function onERC721Received(address, address, uint256, bytes memory) public pure returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/extensions/draft-ERC20Permit.sol) pragma solidity ^0.8.0; import "./draft-IERC20Permit.sol"; import "../ERC20.sol"; import "../../../utils/cryptography/ECDSA.sol"; import "../../../utils/cryptography/EIP712.sol"; import "../../../utils/Counters.sol"; /** * @dev Implementation 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. * * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private constant _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`. * However, to ensure consistency with the upgradeable transpiler, we will continue * to reserve a slot. * @custom:oz-renamed-from _PERMIT_TYPEHASH */ // solhint-disable-next-line var-name-mixedcase bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT; /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 10, 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 + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; interface ISeparatePool is IERC721Receiver { event OwnerChanged(address oldOwner, address newOwner); event SoldNFT(uint256 indexed id, address indexed seller); event BoughtNFT(uint256 indexed id, address indexed buyer); event LockedNFT(uint256 indexed id, address indexed locker, uint256 timeOfLock, uint256 expiryTime); event RedeemedNFT(uint256 indexed id, address indexed redeemer); event ReleasedNFT(uint256 indexed id); function factory() external view returns (address); function owner() external view returns (address); function changeOwner(address _newOwner) external; function setFur(address _newFur) external; function sell(uint256 _id) external; function buy(uint256 _id) external; function lock(uint256 _id) external; function redeem(uint256 _id) external; function release(uint256 _id) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract TransferNFT { address constant KITTIES = 0x06012c8cf97BEaD5deAe237070F9587f8E7A266d; //address constant PUNKS = 0x90bD8a7d20534a896d057a1F4eA1B574f15F16d5; address constant PUNKS = 0xf5a2d79977d20a52f1F9Bb7939AB70AbE95b68E2; function _transferInNFT(address _nft, uint256 _id) internal { bytes memory data; if (_nft == KITTIES) { // CryptoKitties data = abi.encodeWithSignature("transferFrom(address,address,uint256)", msg.sender, address(this), _id); } else if (_nft == PUNKS) { // CryptoPunks bytes memory punksIndexToOwner = abi.encodeWithSignature("punkIndexToAddress(uint256)", _id); (bool _success, bytes memory result) = _nft.staticcall(punksIndexToOwner); address punkOwner = abi.decode(result, (address)); require(_success && punkOwner == msg.sender, "Punk ownership check failed"); data = abi.encodeWithSignature("buyPunk(uint256)", _id); } else { // ERC 721 data = abi.encodeWithSignature("safeTransferFrom(address,address,uint256)", msg.sender, address(this), _id); } (bool success, bytes memory returnData) = _nft.call(data); require(success, string(returnData)); } function _transferOutNFT(address _nft, address _dst, uint256 _id) internal { bytes memory data; if (_nft == KITTIES) { // CryptoKitties data = abi.encodeWithSignature("transfer(address,uint256)", _dst, _id); } else if (_nft == PUNKS) { // CryptoPunks data = abi.encodeWithSignature("transferPunk(address,uint256)", _dst, _id); } else { // ERC 721 data = abi.encodeWithSignature("safeTransferFrom(address,address,uint256)", address(this), _dst, _id); } (bool success, bytes memory returnData) = _nft.call(data); require(success, string(returnData)); } function _balanceOfNFT(address _nft, address _owner) internal view returns (uint256) { bytes memory data = abi.encodeWithSignature("balanceOf(address)", _owner); (bool success, bytes memory returnData) = _nft.staticcall(data); require(success, string(returnData)); return abi.decode(returnData, (uint256)); } }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_nftAddress","type":"address"},{"internalType":"address","name":"_incomeMaker","type":"address"},{"internalType":"address","name":"_fur","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"}],"name":"BoughtNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"locker","type":"address"},{"indexed":false,"internalType":"uint256","name":"timeOfLock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiryTime","type":"uint256"}],"name":"LockedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"redeemer","type":"address"}],"name":"RedeemedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"ReleasedNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"}],"name":"SoldNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_MINT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RELEASE_PUNISHMENT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAP_MINT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"buyBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getLockInfo","outputs":[{"components":[{"internalType":"address","name":"locker","type":"address"},{"internalType":"uint128","name":"releaseTime","type":"uint128"},{"internalType":"uint128","name":"mintBuffer","type":"uint128"}],"internalType":"struct SeparatePool.LockInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incomeMaker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"lock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"lockBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lockInfo","outputs":[{"internalType":"address","name":"locker","type":"address"},{"internalType":"uint128","name":"releaseTime","type":"uint128"},{"internalType":"uint128","name":"mintBuffer","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","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":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"redeemBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"sell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"sellBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newFee","type":"uint256"}],"name":"setBuyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFur","type":"address"}],"name":"setFur","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newFee","type":"uint256"}],"name":"setLockFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"setLockMintBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_periodInDays","type":"uint256"}],"name":"setLockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101a060405268056bc75e2d63100000600a55680821ab0d4414980000600b553480156200002c57600080fd5b50604051620031cc380380620031cc8339810160408190526200004f9162000310565b8180604051806040016040528060018152602001603160f81b815250848481600390805190602001906200008592919062000180565b5080516200009b90600490602084019062000180565b5050825160208085019190912083518483012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c0019052805194019390932091935091906080523060c0526101205250503361014052505050506001600160a01b03938416610180525092821661016052600780549183166001600160a01b0319928316179055600c8054939092169216919091179055624f1a0060095562000400565b8280546200018e90620003c4565b90600052602060002090601f016020900481019282620001b25760008555620001fd565b82601f10620001cd57805160ff1916838001178555620001fd565b82800160010185558215620001fd579182015b82811115620001fd578251825591602001919060010190620001e0565b506200020b9291506200020f565b5090565b5b808211156200020b576000815560010162000210565b80516001600160a01b03811681146200023e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200026b57600080fd5b81516001600160401b038082111562000288576200028862000243565b604051601f8301601f19908116603f01168101908282118183101715620002b357620002b362000243565b81604052838152602092508683858801011115620002d057600080fd5b600091505b83821015620002f45785820183015181830184015290820190620002d5565b83821115620003065760008385830101525b9695505050505050565b60008060008060008060c087890312156200032a57600080fd5b620003358762000226565b9550620003456020880162000226565b9450620003556040880162000226565b9350620003656060880162000226565b60808801519093506001600160401b03808211156200038357600080fd5b620003918a838b0162000259565b935060a0890151915080821115620003a857600080fd5b50620003b789828a0162000259565b9150509295509295509295565b600181811c90821680620003d957607f821691505b602082108103620003fa57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e0516101005161012051610140516101605161018051612d0e620004be600039600081816105b90152818161094e01528181610c1f01528181611264015281816116ef01526120310152600081816103f5015281816116a101528181611f2d015281816120b501526121af0152600081816105e001528181610eeb0152610fde01526000611bd601526000611c2501526000611c0001526000611b5901526000611b8301526000611bad0152612d0e6000f3fe608060405234801561001057600080fd5b50600436106102c85760003560e01c80639b287fc41161017b578063c9102afd116100d8578063dd4670641161008c578063e1b044b911610071578063e1b044b914610746578063e4849b3214610756578063f03871df1461076957600080fd5b8063dd467064146106fa578063dd62ed3e1461070d57600080fd5b8063d505accf116100bd578063d505accf146106c1578063d96a094a146106d4578063db006a75146106e757600080fd5b8063c9102afd14610602578063d4257fa2146106ae57600080fd5b8063a9059cbb1161012f578063bd18c99a11610114578063bd18c99a146105a1578063be1bd331146105b4578063c45a0155146105db57600080fd5b8063a9059cbb1461057b578063bb7907f11461058e57600080fd5b8063a3d2d78611610160578063a3d2d78614610545578063a457c2d714610555578063a6f9dae11461056857600080fd5b80639b287fc41461051f5780639f7260bd1461053257600080fd5b8063395093511161022957806370a08231116101dd5780637ecebe00116101c25780637ecebe00146104f15780638da5cb5b1461050457806395d89b411461051757600080fd5b806370a08231146104b5578063779972da146104de57600080fd5b806347ccca021161020e57806347ccca02146103f05780635b1a4c241461042f5780636d74c9f6146104a557600080fd5b806339509351146103d45780633fd8b02f146103e757600080fd5b806318160ddd11610280578063313ce56711610265578063313ce567146103aa5780633644e515146103b957806337bdc99b146103c157600080fd5b806318160ddd1461038557806323b872dd1461039757600080fd5b80630cc835a3116102b15780630cc835a31461030e578063103bbd4a14610323578063150b7a021461033657600080fd5b806306fdde03146102cd578063095ea7b3146102eb575b600080fd5b6102d561077c565b6040516102e291906128d5565b60405180910390f35b6102fe6102f936600461291d565b61080e565b60405190151581526020016102e2565b61032161031c366004612949565b610826565b005b610321610331366004612962565b610896565b6103546103443660046129ed565b630a85bd0160e11b949350505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102e2565b6002545b6040519081526020016102e2565b6102fe6103a5366004612acd565b610a18565b604051601281526020016102e2565b610389610a3c565b6103216103cf366004612949565b610a4b565b6102fe6103e236600461291d565b610c7d565b61038960095481565b6104177f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102e2565b61047661043d366004612949565b600d60205260009081526040902080546001909101546001600160a01b03909116906001600160801b0380821691600160801b90041683565b604080516001600160a01b0390941684526001600160801b0392831660208501529116908201526060016102e2565b610389681043561a882930000081565b6103896104c3366004612b0e565b6001600160a01b031660009081526020819052604090205490565b6103216104ec366004612949565b610cbc565b6103896104ff366004612b0e565b610cd9565b600c54610417906001600160a01b031681565b6102d5610cf9565b61032161052d366004612949565b610d08565b610321610540366004612949565b610dcb565b610389681b1ae4d6e2ef50000081565b6102fe61056336600461291d565b610e36565b610321610576366004612b0e565b610ee0565b6102fe61058936600461291d565b610fc5565b61032161059c366004612b0e565b610fd3565b6103216105af366004612962565b611079565b6104177f000000000000000000000000000000000000000000000000000000000000000081565b6104177f000000000000000000000000000000000000000000000000000000000000000081565b610672610610366004612949565b604080516060808201835260008083526020808401829052928401819052938452600d8252928290208251938401835280546001600160a01b03168452600101546001600160801b0380821692850192909252600160801b9004169082015290565b6040805182516001600160a01b031681526020808401516001600160801b039081169183019190915292820151909216908201526060016102e2565b6103216106bc366004612962565b6111ae565b6103216106cf366004612b32565b611318565b6103216106e2366004612949565b61147c565b6103216106f5366004612949565b61148a565b610321610708366004612949565b611495565b61038961071b366004612ba9565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610389683635c9adc5dea0000081565b610321610764366004612949565b6114a3565b610321610777366004612962565b6114ae565b60606003805461078b90612be2565b80601f01602080910402602001604051908101604052809291908181526020018280546107b790612be2565b80156108045780601f106107d957610100808354040283529160200191610804565b820191906000526020600020905b8154815290600101906020018083116107e757829003601f168201915b5050505050905090565b60003361081c818585611578565b5060019392505050565b600c546001600160a01b031633146108915760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b60648201526084015b60405180910390fd5b600a55565b80600a81106108f95760405162461bcd60e51b815260206004820152602960248201527f5365706172617465506f6f6c3a2043616e206f6e6c79206275792039204e465460448201526873206174206f6e636560b81b6064820152608401610888565b60085460008261091283681b1ae4d6e2ef500000612c2c565b61091c9190612c44565b9050600083600b5461092e9190612c44565b6007546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018490529293509116906323b872dd906064016020604051808303816000875af11580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190612c63565b5060005b84811015610a05576109fd8787838181106109ee576109ee612c85565b9050602002013560008661169c565b6001016109d1565b50610a103383611828565b505050505050565b600033610a268582856118e7565b610a31858585611979565b506001949350505050565b6000610a46611b4c565b905090565b600c546001600160a01b03163314610ab15760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b6000818152600d60205260409020546001600160a01b0316610b155760405162461bcd60e51b815260206004820181905260248201527f5365706172617465506f6f6c3a204e4654206973206e6f74206c6f636b65642e6044820152606401610888565b6000818152600d6020526040902060010154426001600160801b0390911610610ba65760405162461bcd60e51b815260206004820152602b60248201527f5365706172617465506f6f6c3a2052656c656173652074696d65206e6f74207960448201527f657420726561636865642e0000000000000000000000000000000000000000006064820152608401610888565b6000818152600d6020526040812080546001820180546001600160a01b03198316909355929092556001600160a01b0390911690600160801b90046001600160801b0316610c1a82681043561a8829300000610c0b84681b1ae4d6e2ef500000612c9b565b610c159190612c9b565b611828565b610c4d7f0000000000000000000000000000000000000000000000000000000000000000681043561a8829300000611828565b60405183907f439c761350dce2b2cdc3d3164bf2df90b7eb3ea4c966f1ab32704ab73d080cab90600090a2505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061081c9082908690610cb7908790612c2c565b611578565b610cc7816018612c44565b610cd390610e10612c44565b60095550565b6001600160a01b0381166000908152600560205260408120545b92915050565b60606004805461078b90612be2565b600c546001600160a01b03163314610d6e5760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b68056bc75e2d631000018110610dc65760405162461bcd60e51b815260206004820152601060248201527f42756666657220746f6f206c61726765000000000000000000000000000000006044820152606401610888565b600855565b600c546001600160a01b03163314610e315760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600b55565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015610ed35760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610888565b610a318286868403611578565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f645760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600c80546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a15050565b60003361081c818585611979565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110575760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b80600a81106110f05760405162461bcd60e51b815260206004820152602c60248201527f5365706172617465506f6f6c3a2043616e206f6e6c792072656465656d20392060448201527f4e465473206174206f6e636500000000000000000000000000000000000000006064820152608401610888565b6000805b8281101561116657600d600086868481811061111257611112612c85565b602090810292909201358352508101919091526040016000206001015461115290600160801b90046001600160801b0316681b1ae4d6e2ef500000612c2c565b61115c9083612c2c565b91506001016110f4565b506111713382611c73565b60005b828110156111a75761119f85858381811061119157611191612c85565b905060200201356000611da5565b600101611174565b5050505050565b80600a81106112115760405162461bcd60e51b815260206004820152602960248201527f5365706172617465506f6f6c3a2043616e206f6e6c79206275792039204e465460448201526873206174206f6e636560b81b6064820152608401610888565b600061122682683635c9adc5dea00000612c44565b9050600082600a546112389190612c44565b90506112443383611c73565b6007546040516323b872dd60e01b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201849052909116906323b872dd906064016020604051808303816000875af11580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e19190612c63565b5060005b83811015610a105761131086868381811061130257611302612c85565b905060200201356000611f84565b6001016112e5565b834211156113685760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610888565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113978c61210c565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113f282612134565b9050600061140282878787612182565b9050896001600160a01b0316816001600160a01b0316146114655760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610888565b6114708a8a8a611578565b50505050505050505050565b611487816001611f84565b50565b611487816001611da5565b61148781600160085461169c565b6114878160016121aa565b80600a81106115255760405162461bcd60e51b815260206004820152602a60248201527f5365706172617465506f6f6c3a2043616e206f6e6c792073656c6c2039204e4660448201527f5473206174206f6e6365000000000000000000000000000000000000000000006064820152608401610888565b60005b8181101561155b5761155384848381811061154557611545612c85565b9050602002013560006121aa565b600101611528565b5061157333610c1583683635c9adc5dea00000612c44565b505050565b6001600160a01b0383166115da5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610888565b6001600160a01b03821661163b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610888565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6116c67f00000000000000000000000000000000000000000000000000000000000000008461221e565b811561178457600754600b546040516323b872dd60e01b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092529116906323b872dd906064016020604051808303816000875af1158015611748573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176c9190612c63565b5061178433610c1583681b1ae4d6e2ef500000612c2c565b6000838152600d6020526040812080546001600160a01b031916331790556009546117af9042612c2c565b6000858152600d6020526040908190206001600160801b03858116600160801b029084161760019091015551909150339085907fae89003b2ed407959851f7fd88632f71d13a9afae63570c95b62a3a1e37335ed9061181a9042908690918252602082015260400190565b60405180910390a350505050565b6001600160a01b03821661187e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610888565b80600260008282546118909190612c2c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461197357818110156119665760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610888565b6119738484848403611578565b50505050565b6001600160a01b0383166119f55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610888565b6001600160a01b038216611a575760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610888565b6001600160a01b03831660009081526020819052604090205481811015611ae65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610888565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611973565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ba557507f000000000000000000000000000000000000000000000000000000000000000046145b15611bcf57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b038216611cd35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610888565b6001600160a01b03821660009081526020819052604090205481811015611d475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610888565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6000828152600d60205260409020546001600160a01b03163314611e315760405162461bcd60e51b815260206004820152602860248201527f5365706172617465506f6f6c3a20596f7520646964206e6f74206c6f636b207460448201527f686973204e46542e0000000000000000000000000000000000000000000000006064820152608401610888565b6000828152600d6020526040902060010154426001600160801b0390911611611ec25760405162461bcd60e51b815260206004820152603b60248201527f5365706172617465506f6f6c3a204e46542068617320616c726561647920626560448201527f656e2072656c656173656420746f207075626c696320706f6f6c2e00000000006064820152608401610888565b8015611f08576000828152600d6020526040902060010154611f08903390611f0390600160801b90046001600160801b0316681b1ae4d6e2ef500000612c2c565b611c73565b6000828152600d6020526040812080546001600160a01b031916815560010155611f537f000000000000000000000000000000000000000000000000000000000000000033846124db565b604051339083907f9bab5acf264de9ccba2da98c9b074dcd7a2b619747d81d43c17dca08a39ce5df90600090a35050565b6000828152600d60205260409020546001600160a01b031615611ff55760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a2043616e6e6f7420627579206c6f636b65642060448201526327232a1760e11b6064820152608401610888565b80156120b05761200e33683635c9adc5dea00000611c73565b600754600a546040516323b872dd60e01b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092529116906323b872dd906064016020604051808303816000875af115801561208a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ae9190612c63565b505b6120db7f000000000000000000000000000000000000000000000000000000000000000033846124db565b604051339083907f46dbea1718659f1723f38788e490533e3a4dc575dd50f366e048733c9bd4727d90600090a35050565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b6000610cf3612141611b4c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006121938787878761269b565b915091506121a08161275f565b5095945050505050565b6121d47f00000000000000000000000000000000000000000000000000000000000000008361221e565b80156121ed576121ed33683635c9adc5dea00000611828565b604051339083907fe958d923bffb0a2a806675815f9fd296b2cadd666bf2ea21145e587acf1899ef90600090a35050565b60607306012c8cf97bead5deae237070f9587f8e7a266c196001600160a01b0384160161228f576040513360248201523060448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b03166323b872dd60e01b1790529050612459565b73f5a2d79977d20a52f1f9bb7939ab70abe95b68e1196001600160a01b03841601612413576000826040516024016122c991815260200190565b60408051601f198184030181529181526020820180516001600160e01b0316630b02f02d60e31b1790525190915060009081906001600160a01b03871690612312908590612cb2565b600060405180830381855afa9150503d806000811461234d576040519150601f19603f3d011682016040523d82523d6000602084013e612352565b606091505b509150915060008180602001905181019061236d9190612cce565b905082801561238457506001600160a01b03811633145b6123d05760405162461bcd60e51b815260206004820152601b60248201527f50756e6b206f776e65727368697020636865636b206661696c656400000000006044820152606401610888565b6040516024810187905260440160408051601f198184030181529190526020810180516001600160e01b031663104c9fd360e31b17905294506124599350505050565b6040513360248201523060448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080846001600160a01b0316836040516124749190612cb2565b6000604051808303816000865af19150503d80600081146124b1576040519150601f19603f3d011682016040523d82523d6000602084013e6124b6565b606091505b5091509150818190610a105760405162461bcd60e51b815260040161088891906128d5565b60607306012c8cf97bead5deae237070f9587f8e7a266c196001600160a01b0385160161254f576040516001600160a01b03841660248201526044810183905260640160408051601f198184030181529190526020810180516001600160e01b031663a9059cbb60e01b1790529050612610565b73f5a2d79977d20a52f1f9bb7939ab70abe95b68e1196001600160a01b038516016125c1576040516001600160a01b03841660248201526044810183905260640160408051601f198184030181529190526020810180516001600160e01b03166322dca8bb60e21b1790529050612610565b6040513060248201526001600160a01b03841660448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080856001600160a01b03168360405161262b9190612cb2565b6000604051808303816000865af19150503d8060008114612668576040519150601f19603f3d011682016040523d82523d6000602084013e61266d565b606091505b50915091508181906126925760405162461bcd60e51b815260040161088891906128d5565b50505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126d25750600090506003612756565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612726573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661274f57600060019250925050612756565b9150600090505b94509492505050565b600081600481111561277357612773612ceb565b0361277b5750565b600181600481111561278f5761278f612ceb565b036127dc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610888565b60028160048111156127f0576127f0612ceb565b0361283d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610888565b600381600481111561285157612851612ceb565b036114875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610888565b60005b838110156128c45781810151838201526020016128ac565b838111156119735750506000910152565b60208152600082518060208401526128f48160408501602087016128a9565b601f01601f19169190910160400192915050565b6001600160a01b038116811461148757600080fd5b6000806040838503121561293057600080fd5b823561293b81612908565b946020939093013593505050565b60006020828403121561295b57600080fd5b5035919050565b6000806020838503121561297557600080fd5b823567ffffffffffffffff8082111561298d57600080fd5b818501915085601f8301126129a157600080fd5b8135818111156129b057600080fd5b8660208260051b85010111156129c557600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612a0357600080fd5b8435612a0e81612908565b93506020850135612a1e81612908565b925060408501359150606085013567ffffffffffffffff80821115612a4257600080fd5b818701915087601f830112612a5657600080fd5b813581811115612a6857612a686129d7565b604051601f8201601f19908116603f01168101908382118183101715612a9057612a906129d7565b816040528281528a6020848701011115612aa957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215612ae257600080fd5b8335612aed81612908565b92506020840135612afd81612908565b929592945050506040919091013590565b600060208284031215612b2057600080fd5b8135612b2b81612908565b9392505050565b600080600080600080600060e0888a031215612b4d57600080fd5b8735612b5881612908565b96506020880135612b6881612908565b95506040880135945060608801359350608088013560ff81168114612b8c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612bbc57600080fd5b8235612bc781612908565b91506020830135612bd781612908565b809150509250929050565b600181811c90821680612bf657607f821691505b60208210810361212e57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612c3f57612c3f612c16565b500190565b6000816000190483118215151615612c5e57612c5e612c16565b500290565b600060208284031215612c7557600080fd5b81518015158114612b2b57600080fd5b634e487b7160e01b600052603260045260246000fd5b600082821015612cad57612cad612c16565b500390565b60008251612cc48184602087016128a9565b9190910192915050565b600060208284031215612ce057600080fd5b8151612b2b81612908565b634e487b7160e01b600052602160045260246000fdfea164736f6c634300080d000a00000000000000000000000070929568f06d208af361088a2b49438e30504292000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f5000000000000000000000000f4e1ab751e8f7687fe65b6e33eecad7c0ba8c808000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000b467572696f6e20424159430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006462d424159430000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102c85760003560e01c80639b287fc41161017b578063c9102afd116100d8578063dd4670641161008c578063e1b044b911610071578063e1b044b914610746578063e4849b3214610756578063f03871df1461076957600080fd5b8063dd467064146106fa578063dd62ed3e1461070d57600080fd5b8063d505accf116100bd578063d505accf146106c1578063d96a094a146106d4578063db006a75146106e757600080fd5b8063c9102afd14610602578063d4257fa2146106ae57600080fd5b8063a9059cbb1161012f578063bd18c99a11610114578063bd18c99a146105a1578063be1bd331146105b4578063c45a0155146105db57600080fd5b8063a9059cbb1461057b578063bb7907f11461058e57600080fd5b8063a3d2d78611610160578063a3d2d78614610545578063a457c2d714610555578063a6f9dae11461056857600080fd5b80639b287fc41461051f5780639f7260bd1461053257600080fd5b8063395093511161022957806370a08231116101dd5780637ecebe00116101c25780637ecebe00146104f15780638da5cb5b1461050457806395d89b411461051757600080fd5b806370a08231146104b5578063779972da146104de57600080fd5b806347ccca021161020e57806347ccca02146103f05780635b1a4c241461042f5780636d74c9f6146104a557600080fd5b806339509351146103d45780633fd8b02f146103e757600080fd5b806318160ddd11610280578063313ce56711610265578063313ce567146103aa5780633644e515146103b957806337bdc99b146103c157600080fd5b806318160ddd1461038557806323b872dd1461039757600080fd5b80630cc835a3116102b15780630cc835a31461030e578063103bbd4a14610323578063150b7a021461033657600080fd5b806306fdde03146102cd578063095ea7b3146102eb575b600080fd5b6102d561077c565b6040516102e291906128d5565b60405180910390f35b6102fe6102f936600461291d565b61080e565b60405190151581526020016102e2565b61032161031c366004612949565b610826565b005b610321610331366004612962565b610896565b6103546103443660046129ed565b630a85bd0160e11b949350505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102e2565b6002545b6040519081526020016102e2565b6102fe6103a5366004612acd565b610a18565b604051601281526020016102e2565b610389610a3c565b6103216103cf366004612949565b610a4b565b6102fe6103e236600461291d565b610c7d565b61038960095481565b6104177f00000000000000000000000070929568f06d208af361088a2b49438e3050429281565b6040516001600160a01b0390911681526020016102e2565b61047661043d366004612949565b600d60205260009081526040902080546001909101546001600160a01b03909116906001600160801b0380821691600160801b90041683565b604080516001600160a01b0390941684526001600160801b0392831660208501529116908201526060016102e2565b610389681043561a882930000081565b6103896104c3366004612b0e565b6001600160a01b031660009081526020819052604090205490565b6103216104ec366004612949565b610cbc565b6103896104ff366004612b0e565b610cd9565b600c54610417906001600160a01b031681565b6102d5610cf9565b61032161052d366004612949565b610d08565b610321610540366004612949565b610dcb565b610389681b1ae4d6e2ef50000081565b6102fe61056336600461291d565b610e36565b610321610576366004612b0e565b610ee0565b6102fe61058936600461291d565b610fc5565b61032161059c366004612b0e565b610fd3565b6103216105af366004612962565b611079565b6104177f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f581565b6104177f0000000000000000000000005481724b39eed0a96da7aa7a7db561deaf5e599e81565b610672610610366004612949565b604080516060808201835260008083526020808401829052928401819052938452600d8252928290208251938401835280546001600160a01b03168452600101546001600160801b0380821692850192909252600160801b9004169082015290565b6040805182516001600160a01b031681526020808401516001600160801b039081169183019190915292820151909216908201526060016102e2565b6103216106bc366004612962565b6111ae565b6103216106cf366004612b32565b611318565b6103216106e2366004612949565b61147c565b6103216106f5366004612949565b61148a565b610321610708366004612949565b611495565b61038961071b366004612ba9565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610389683635c9adc5dea0000081565b610321610764366004612949565b6114a3565b610321610777366004612962565b6114ae565b60606003805461078b90612be2565b80601f01602080910402602001604051908101604052809291908181526020018280546107b790612be2565b80156108045780601f106107d957610100808354040283529160200191610804565b820191906000526020600020905b8154815290600101906020018083116107e757829003601f168201915b5050505050905090565b60003361081c818585611578565b5060019392505050565b600c546001600160a01b031633146108915760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b60648201526084015b60405180910390fd5b600a55565b80600a81106108f95760405162461bcd60e51b815260206004820152602960248201527f5365706172617465506f6f6c3a2043616e206f6e6c79206275792039204e465460448201526873206174206f6e636560b81b6064820152608401610888565b60085460008261091283681b1ae4d6e2ef500000612c2c565b61091c9190612c44565b9050600083600b5461092e9190612c44565b6007546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f581166024830152604482018490529293509116906323b872dd906064016020604051808303816000875af11580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd9190612c63565b5060005b84811015610a05576109fd8787838181106109ee576109ee612c85565b9050602002013560008661169c565b6001016109d1565b50610a103383611828565b505050505050565b600033610a268582856118e7565b610a31858585611979565b506001949350505050565b6000610a46611b4c565b905090565b600c546001600160a01b03163314610ab15760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b6000818152600d60205260409020546001600160a01b0316610b155760405162461bcd60e51b815260206004820181905260248201527f5365706172617465506f6f6c3a204e4654206973206e6f74206c6f636b65642e6044820152606401610888565b6000818152600d6020526040902060010154426001600160801b0390911610610ba65760405162461bcd60e51b815260206004820152602b60248201527f5365706172617465506f6f6c3a2052656c656173652074696d65206e6f74207960448201527f657420726561636865642e0000000000000000000000000000000000000000006064820152608401610888565b6000818152600d6020526040812080546001820180546001600160a01b03198316909355929092556001600160a01b0390911690600160801b90046001600160801b0316610c1a82681043561a8829300000610c0b84681b1ae4d6e2ef500000612c9b565b610c159190612c9b565b611828565b610c4d7f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f5681043561a8829300000611828565b60405183907f439c761350dce2b2cdc3d3164bf2df90b7eb3ea4c966f1ab32704ab73d080cab90600090a2505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061081c9082908690610cb7908790612c2c565b611578565b610cc7816018612c44565b610cd390610e10612c44565b60095550565b6001600160a01b0381166000908152600560205260408120545b92915050565b60606004805461078b90612be2565b600c546001600160a01b03163314610d6e5760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b68056bc75e2d631000018110610dc65760405162461bcd60e51b815260206004820152601060248201527f42756666657220746f6f206c61726765000000000000000000000000000000006044820152606401610888565b600855565b600c546001600160a01b03163314610e315760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600b55565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015610ed35760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610888565b610a318286868403611578565b336001600160a01b037f0000000000000000000000005481724b39eed0a96da7aa7a7db561deaf5e599e1614610f645760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600c80546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a15050565b60003361081c818585611979565b336001600160a01b037f0000000000000000000000005481724b39eed0a96da7aa7a7db561deaf5e599e16146110575760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a204e6f74207065726d697474656420746f206360448201526330b6361760e11b6064820152608401610888565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b80600a81106110f05760405162461bcd60e51b815260206004820152602c60248201527f5365706172617465506f6f6c3a2043616e206f6e6c792072656465656d20392060448201527f4e465473206174206f6e636500000000000000000000000000000000000000006064820152608401610888565b6000805b8281101561116657600d600086868481811061111257611112612c85565b602090810292909201358352508101919091526040016000206001015461115290600160801b90046001600160801b0316681b1ae4d6e2ef500000612c2c565b61115c9083612c2c565b91506001016110f4565b506111713382611c73565b60005b828110156111a75761119f85858381811061119157611191612c85565b905060200201356000611da5565b600101611174565b5050505050565b80600a81106112115760405162461bcd60e51b815260206004820152602960248201527f5365706172617465506f6f6c3a2043616e206f6e6c79206275792039204e465460448201526873206174206f6e636560b81b6064820152608401610888565b600061122682683635c9adc5dea00000612c44565b9050600082600a546112389190612c44565b90506112443383611c73565b6007546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f58116602483015260448201849052909116906323b872dd906064016020604051808303816000875af11580156112bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e19190612c63565b5060005b83811015610a105761131086868381811061130257611302612c85565b905060200201356000611f84565b6001016112e5565b834211156113685760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610888565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886113978c61210c565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006113f282612134565b9050600061140282878787612182565b9050896001600160a01b0316816001600160a01b0316146114655760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610888565b6114708a8a8a611578565b50505050505050505050565b611487816001611f84565b50565b611487816001611da5565b61148781600160085461169c565b6114878160016121aa565b80600a81106115255760405162461bcd60e51b815260206004820152602a60248201527f5365706172617465506f6f6c3a2043616e206f6e6c792073656c6c2039204e4660448201527f5473206174206f6e6365000000000000000000000000000000000000000000006064820152608401610888565b60005b8181101561155b5761155384848381811061154557611545612c85565b9050602002013560006121aa565b600101611528565b5061157333610c1583683635c9adc5dea00000612c44565b505050565b6001600160a01b0383166115da5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610888565b6001600160a01b03821661163b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610888565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6116c67f00000000000000000000000070929568f06d208af361088a2b49438e305042928461221e565b811561178457600754600b546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f58116602483015260448201929092529116906323b872dd906064016020604051808303816000875af1158015611748573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176c9190612c63565b5061178433610c1583681b1ae4d6e2ef500000612c2c565b6000838152600d6020526040812080546001600160a01b031916331790556009546117af9042612c2c565b6000858152600d6020526040908190206001600160801b03858116600160801b029084161760019091015551909150339085907fae89003b2ed407959851f7fd88632f71d13a9afae63570c95b62a3a1e37335ed9061181a9042908690918252602082015260400190565b60405180910390a350505050565b6001600160a01b03821661187e5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610888565b80600260008282546118909190612c2c565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461197357818110156119665760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610888565b6119738484848403611578565b50505050565b6001600160a01b0383166119f55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610888565b6001600160a01b038216611a575760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610888565b6001600160a01b03831660009081526020819052604090205481811015611ae65760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610888565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611973565b6000306001600160a01b037f0000000000000000000000005c4784b0211fb441abc6a5be9cb63de3a99cc14216148015611ba557507f0000000000000000000000000000000000000000000000000000000000aa36a746145b15611bcf57507f84c195334647fdbcb6c7e783b67e820b34355846df441ca0d74756f8b6eb972590565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f4fbd5c744e8acca5221bb7eea3ca12e07665eb85e9f70887b82b533ee549a00a828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6001600160a01b038216611cd35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610888565b6001600160a01b03821660009081526020819052604090205481811015611d475760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610888565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6000828152600d60205260409020546001600160a01b03163314611e315760405162461bcd60e51b815260206004820152602860248201527f5365706172617465506f6f6c3a20596f7520646964206e6f74206c6f636b207460448201527f686973204e46542e0000000000000000000000000000000000000000000000006064820152608401610888565b6000828152600d6020526040902060010154426001600160801b0390911611611ec25760405162461bcd60e51b815260206004820152603b60248201527f5365706172617465506f6f6c3a204e46542068617320616c726561647920626560448201527f656e2072656c656173656420746f207075626c696320706f6f6c2e00000000006064820152608401610888565b8015611f08576000828152600d6020526040902060010154611f08903390611f0390600160801b90046001600160801b0316681b1ae4d6e2ef500000612c2c565b611c73565b6000828152600d6020526040812080546001600160a01b031916815560010155611f537f00000000000000000000000070929568f06d208af361088a2b49438e3050429233846124db565b604051339083907f9bab5acf264de9ccba2da98c9b074dcd7a2b619747d81d43c17dca08a39ce5df90600090a35050565b6000828152600d60205260409020546001600160a01b031615611ff55760405162461bcd60e51b8152602060048201526024808201527f5365706172617465506f6f6c3a2043616e6e6f7420627579206c6f636b65642060448201526327232a1760e11b6064820152608401610888565b80156120b05761200e33683635c9adc5dea00000611c73565b600754600a546040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f58116602483015260448201929092529116906323b872dd906064016020604051808303816000875af115801561208a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ae9190612c63565b505b6120db7f00000000000000000000000070929568f06d208af361088a2b49438e3050429233846124db565b604051339083907f46dbea1718659f1723f38788e490533e3a4dc575dd50f366e048733c9bd4727d90600090a35050565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b6000610cf3612141611b4c565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006121938787878761269b565b915091506121a08161275f565b5095945050505050565b6121d47f00000000000000000000000070929568f06d208af361088a2b49438e305042928361221e565b80156121ed576121ed33683635c9adc5dea00000611828565b604051339083907fe958d923bffb0a2a806675815f9fd296b2cadd666bf2ea21145e587acf1899ef90600090a35050565b60607306012c8cf97bead5deae237070f9587f8e7a266c196001600160a01b0384160161228f576040513360248201523060448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b03166323b872dd60e01b1790529050612459565b73f5a2d79977d20a52f1f9bb7939ab70abe95b68e1196001600160a01b03841601612413576000826040516024016122c991815260200190565b60408051601f198184030181529181526020820180516001600160e01b0316630b02f02d60e31b1790525190915060009081906001600160a01b03871690612312908590612cb2565b600060405180830381855afa9150503d806000811461234d576040519150601f19603f3d011682016040523d82523d6000602084013e612352565b606091505b509150915060008180602001905181019061236d9190612cce565b905082801561238457506001600160a01b03811633145b6123d05760405162461bcd60e51b815260206004820152601b60248201527f50756e6b206f776e65727368697020636865636b206661696c656400000000006044820152606401610888565b6040516024810187905260440160408051601f198184030181529190526020810180516001600160e01b031663104c9fd360e31b17905294506124599350505050565b6040513360248201523060448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080846001600160a01b0316836040516124749190612cb2565b6000604051808303816000865af19150503d80600081146124b1576040519150601f19603f3d011682016040523d82523d6000602084013e6124b6565b606091505b5091509150818190610a105760405162461bcd60e51b815260040161088891906128d5565b60607306012c8cf97bead5deae237070f9587f8e7a266c196001600160a01b0385160161254f576040516001600160a01b03841660248201526044810183905260640160408051601f198184030181529190526020810180516001600160e01b031663a9059cbb60e01b1790529050612610565b73f5a2d79977d20a52f1f9bb7939ab70abe95b68e1196001600160a01b038516016125c1576040516001600160a01b03841660248201526044810183905260640160408051601f198184030181529190526020810180516001600160e01b03166322dca8bb60e21b1790529050612610565b6040513060248201526001600160a01b03841660448201526064810183905260840160408051601f198184030181529190526020810180516001600160e01b0316632142170760e11b17905290505b600080856001600160a01b03168360405161262b9190612cb2565b6000604051808303816000865af19150503d8060008114612668576040519150601f19603f3d011682016040523d82523d6000602084013e61266d565b606091505b50915091508181906126925760405162461bcd60e51b815260040161088891906128d5565b50505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156126d25750600090506003612756565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612726573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661274f57600060019250925050612756565b9150600090505b94509492505050565b600081600481111561277357612773612ceb565b0361277b5750565b600181600481111561278f5761278f612ceb565b036127dc5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610888565b60028160048111156127f0576127f0612ceb565b0361283d5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610888565b600381600481111561285157612851612ceb565b036114875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610888565b60005b838110156128c45781810151838201526020016128ac565b838111156119735750506000910152565b60208152600082518060208401526128f48160408501602087016128a9565b601f01601f19169190910160400192915050565b6001600160a01b038116811461148757600080fd5b6000806040838503121561293057600080fd5b823561293b81612908565b946020939093013593505050565b60006020828403121561295b57600080fd5b5035919050565b6000806020838503121561297557600080fd5b823567ffffffffffffffff8082111561298d57600080fd5b818501915085601f8301126129a157600080fd5b8135818111156129b057600080fd5b8660208260051b85010111156129c557600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612a0357600080fd5b8435612a0e81612908565b93506020850135612a1e81612908565b925060408501359150606085013567ffffffffffffffff80821115612a4257600080fd5b818701915087601f830112612a5657600080fd5b813581811115612a6857612a686129d7565b604051601f8201601f19908116603f01168101908382118183101715612a9057612a906129d7565b816040528281528a6020848701011115612aa957600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215612ae257600080fd5b8335612aed81612908565b92506020840135612afd81612908565b929592945050506040919091013590565b600060208284031215612b2057600080fd5b8135612b2b81612908565b9392505050565b600080600080600080600060e0888a031215612b4d57600080fd5b8735612b5881612908565b96506020880135612b6881612908565b95506040880135945060608801359350608088013560ff81168114612b8c57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612bbc57600080fd5b8235612bc781612908565b91506020830135612bd781612908565b809150509250929050565b600181811c90821680612bf657607f821691505b60208210810361212e57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612c3f57612c3f612c16565b500190565b6000816000190483118215151615612c5e57612c5e612c16565b500290565b600060208284031215612c7557600080fd5b81518015158114612b2b57600080fd5b634e487b7160e01b600052603260045260246000fd5b600082821015612cad57612cad612c16565b500390565b60008251612cc48184602087016128a9565b9190910192915050565b600060208284031215612ce057600080fd5b8151612b2b81612908565b634e487b7160e01b600052602160045260246000fdfea164736f6c634300080d000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000070929568f06d208af361088a2b49438e30504292000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f5000000000000000000000000f4e1ab751e8f7687fe65b6e33eecad7c0ba8c808000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000b467572696f6e20424159430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006462d424159430000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _nftAddress (address): 0x70929568F06d208af361088A2b49438e30504292
Arg [1] : _incomeMaker (address): 0xA10f8ecb4d91Ae5CA3291d0bFF159bd5F882A5f5
Arg [2] : _fur (address): 0xf4E1Ab751e8f7687Fe65b6e33eEcAd7c0bA8C808
Arg [3] : _owner (address): 0xA10f8ecb4d91Ae5CA3291d0bFF159bd5F882A5f5
Arg [4] : _tokenName (string): Furion BAYC
Arg [5] : _tokenSymbol (string): F-BAYC
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000070929568f06d208af361088a2b49438e30504292
Arg [1] : 000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f5
Arg [2] : 000000000000000000000000f4e1ab751e8f7687fe65b6e33eecad7c0ba8c808
Arg [3] : 000000000000000000000000a10f8ecb4d91ae5ca3291d0bff159bd5f882a5f5
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [7] : 467572696f6e2042415943000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [9] : 462d424159430000000000000000000000000000000000000000000000000000
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.