More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456802 | 382 days ago | 0 ETH | ||||
3456801 | 382 days ago | 0 ETH | ||||
3456801 | 382 days ago | 0 ETH | ||||
3456801 | 382 days ago | 0 ETH | ||||
3456801 | 382 days ago | 0 ETH | ||||
3456800 | 382 days ago | 0 ETH | ||||
3456800 | 382 days ago | 0 ETH | ||||
3456800 | 382 days ago | 0 ETH | ||||
3456800 | 382 days ago | 0 ETH | ||||
3456800 | 382 days ago | 0 ETH |
Loading...
Loading
Contract Name:
inventoryNFTIdentity
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.18; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; contract inventoryNFTIdentity is Pausable, ERC721Holder, Ownable { constructor() {} mapping(address => mapping(address => mapping(uint256 => bool))) public nftOwner; mapping(address => uint256[]) public tokenIDOwner; function addNFT(address _erc721) external { uint256 _tokenId = IERC721Enumerable(_erc721).tokenOfOwnerByIndex(msg.sender, 0); IERC721(_erc721).transferFrom(msg.sender, address(this), _tokenId); tokenIDOwner[msg.sender].push(_tokenId); nftOwner[msg.sender][_erc721][_tokenId] = true; } function withdrawNFT(address _erc721) external { uint256 _tokenId = getTokenId(msg.sender); require(nftOwner[msg.sender][_erc721][_tokenId], "You are not owner"); IERC721(_erc721).safeTransferFrom(address(this), msg.sender, _tokenId); } function getTokenId(address _owner) internal returns(uint256 _tokenId) { _tokenId = tokenIDOwner[_owner][0]; for(uint i = 0; i < tokenIDOwner[_owner].length-1; i++){ tokenIDOwner[_owner][i] = tokenIDOwner[_owner][i+1]; } tokenIDOwner[_owner].pop(); } function withdrawNativeAll() external onlyOwner { require(address(this).balance > 0 ,"balanceOfNative: is equal 0"); payable(msg.sender).transfer(address(this).balance); } function withdrawTokenAll(IERC20 _token) external onlyOwner { require(_token.balanceOf(address(this)) > 0 , "balanceOfToken: is equal 0"); _token.transfer(msg.sender, _token.balanceOf(address(this))); } function withdrawAmountNFT(address _beneficiary, address _erc721, uint256 _amount) external onlyOwner{ for (uint256 i = 0; i < _amount; i++) { uint256 _tokenId = IERC721Enumerable(_erc721).tokenOfOwnerByIndex(address(this), 0); IERC721(_erc721).safeTransferFrom(address(this), _beneficiary, _tokenId); } } function withdrawAllNFT(address _beneficiary, address erc721) external onlyOwner{ uint256 _amountBox = IERC721Enumerable(erc721).balanceOf(address(this)); for (uint256 i = 0; i < _amountBox; i++) { uint256 _tokenId = IERC721Enumerable(erc721).tokenOfOwnerByIndex(address(this), 0); IERC721(erc721).safeTransferFrom(address(this), _beneficiary, _tokenId); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// 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 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.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view 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 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// 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/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"_erc721","type":"address"}],"name":"addNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIDOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"address","name":"erc721","type":"address"}],"name":"withdrawAllNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"address","name":"_erc721","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAmountNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc721","type":"address"}],"name":"withdrawNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawNativeAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"withdrawTokenAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506000805460ff1916905561002433610029565b610082565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610e7c806100916000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638287bfc11161008c578063d0b0457d11610066578063d0b0457d146101bc578063f2fde38b146101cf578063f6acc210146101e2578063fafbb860146101f557600080fd5b80638287bfc11461015f5780638da5cb5b1461017257806397b468d01461019b57600080fd5b8063015ed3c3146100d4578063150b7a02146100de5780635168cf601461011a5780635629d2581461012d5780635c975abb14610140578063715018a614610157575b600080fd5b6100dc610229565b005b6100fc6100ec366004610bb6565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020015b60405180910390f35b6100dc610128366004610c96565b6102b5565b6100dc61013b366004610cd7565b6103b9565b60005460ff165b6040519015158152602001610111565b6100dc61055e565b6100dc61016d366004610cd7565b610572565b60005461010090046001600160a01b03166040516001600160a01b039091168152602001610111565b6101ae6101a9366004610cfb565b6106a4565b604051908152602001610111565b6100dc6101ca366004610d27565b6106d5565b6100dc6101dd366004610cd7565b610840565b6100dc6101f0366004610cd7565b6108b6565b610147610203366004610c96565b600160209081526000938452604080852082529284528284209052825290205460ff1681565b610231610999565b600047116102865760405162461bcd60e51b815260206004820152601c60248201527f62616c616e63654f664e61746976653a2020697320657175616c20300000000060448201526064015b60405180910390fd5b60405133904780156108fc02916000818181858888f193505050501580156102b2573d6000803e3d6000fd5b50565b6102bd610999565b60005b818110156103b357604051632f745c5960e01b8152306004820152600060248201819052906001600160a01b03851690632f745c5990604401602060405180830381865afa158015610316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033a9190610d60565b604051632142170760e11b81529091506001600160a01b038516906342842e0e9061036d90309089908690600401610d79565b600060405180830381600087803b15801561038757600080fd5b505af115801561039b573d6000803e3d6000fd5b505050505080806103ab90610db3565b9150506102c0565b50505050565b6103c1610999565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042c9190610d60565b116104795760405162461bcd60e51b815260206004820152601b60248201527f62616c616e63654f66546f6b656e3a2020697320657175616c20300000000000604482015260640161027d565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156104c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104eb9190610d60565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a9190610dcc565b5050565b610566610999565b61057060006109f9565b565b604051632f745c5960e01b8152336004820152600060248201819052906001600160a01b03831690632f745c5990604401602060405180830381865afa1580156105c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e49190610d60565b6040516323b872dd60e01b81529091506001600160a01b038316906323b872dd9061061790339030908690600401610d79565b600060405180830381600087803b15801561063157600080fd5b505af1158015610645573d6000803e3d6000fd5b5050336000818152600260209081526040808320805460018181018355918552838520018890559383528382528083206001600160a01b039890981683529681528682209582529490945293909220805460ff19169093179092555050565b600260205281600052604060002081815481106106c057600080fd5b90600052602060002001600091509150505481565b6106dd610999565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107489190610d60565b905060005b818110156103b357604051632f745c5960e01b8152306004820152600060248201819052906001600160a01b03851690632f745c5990604401602060405180830381865afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c79190610d60565b604051632142170760e11b81529091506001600160a01b038516906342842e0e906107fa90309089908690600401610d79565b600060405180830381600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b5050505050808061083890610db3565b91505061074d565b610848610999565b6001600160a01b0381166108ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161027d565b6102b2816109f9565b60006108c133610a52565b3360009081526001602090815260408083206001600160a01b0387168452825280832084845290915290205490915060ff166109335760405162461bcd60e51b81526020600482015260116024820152702cb7ba9030b932903737ba1037bbb732b960791b604482015260640161027d565b604051632142170760e11b81526001600160a01b038316906342842e0e9061096390309033908690600401610d79565b600060405180830381600087803b15801561097d57600080fd5b505af1158015610991573d6000803e3d6000fd5b505050505050565b6000546001600160a01b036101009091041633146105705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161027d565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b038116600090815260026020526040812080548290610a7a57610a7a610dee565b9060005260206000200154905060005b6001600160a01b038316600090815260026020526040902054610aaf90600190610e04565b811015610b48576001600160a01b0383166000908152600260205260409020610ad9826001610e1d565b81548110610ae957610ae9610dee565b906000526020600020015460026000856001600160a01b03166001600160a01b031681526020019081526020016000208281548110610b2a57610b2a610dee565b60009182526020909120015580610b4081610db3565b915050610a8a565b506001600160a01b0382166000908152600260205260409020805480610b7057610b70610e30565b60019003818190600052602060002001600090559055919050565b6001600160a01b03811681146102b257600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610bcc57600080fd5b8435610bd781610b8b565b93506020850135610be781610b8b565b925060408501359150606085013567ffffffffffffffff80821115610c0b57600080fd5b818701915087601f830112610c1f57600080fd5b813581811115610c3157610c31610ba0565b604051601f8201601f19908116603f01168101908382118183101715610c5957610c59610ba0565b816040528281528a6020848701011115610c7257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215610cab57600080fd5b8335610cb681610b8b565b92506020840135610cc681610b8b565b929592945050506040919091013590565b600060208284031215610ce957600080fd5b8135610cf481610b8b565b9392505050565b60008060408385031215610d0e57600080fd5b8235610d1981610b8b565b946020939093013593505050565b60008060408385031215610d3a57600080fd5b8235610d4581610b8b565b91506020830135610d5581610b8b565b809150509250929050565b600060208284031215610d7257600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201610dc557610dc5610d9d565b5060010190565b600060208284031215610dde57600080fd5b81518015158114610cf457600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e1757610e17610d9d565b92915050565b80820180821115610e1757610e17610d9d565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200a1f7eb927bdce616d632783c0394705f6056e48bd2b9c1c40fa179b357563a964736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638287bfc11161008c578063d0b0457d11610066578063d0b0457d146101bc578063f2fde38b146101cf578063f6acc210146101e2578063fafbb860146101f557600080fd5b80638287bfc11461015f5780638da5cb5b1461017257806397b468d01461019b57600080fd5b8063015ed3c3146100d4578063150b7a02146100de5780635168cf601461011a5780635629d2581461012d5780635c975abb14610140578063715018a614610157575b600080fd5b6100dc610229565b005b6100fc6100ec366004610bb6565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020015b60405180910390f35b6100dc610128366004610c96565b6102b5565b6100dc61013b366004610cd7565b6103b9565b60005460ff165b6040519015158152602001610111565b6100dc61055e565b6100dc61016d366004610cd7565b610572565b60005461010090046001600160a01b03166040516001600160a01b039091168152602001610111565b6101ae6101a9366004610cfb565b6106a4565b604051908152602001610111565b6100dc6101ca366004610d27565b6106d5565b6100dc6101dd366004610cd7565b610840565b6100dc6101f0366004610cd7565b6108b6565b610147610203366004610c96565b600160209081526000938452604080852082529284528284209052825290205460ff1681565b610231610999565b600047116102865760405162461bcd60e51b815260206004820152601c60248201527f62616c616e63654f664e61746976653a2020697320657175616c20300000000060448201526064015b60405180910390fd5b60405133904780156108fc02916000818181858888f193505050501580156102b2573d6000803e3d6000fd5b50565b6102bd610999565b60005b818110156103b357604051632f745c5960e01b8152306004820152600060248201819052906001600160a01b03851690632f745c5990604401602060405180830381865afa158015610316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033a9190610d60565b604051632142170760e11b81529091506001600160a01b038516906342842e0e9061036d90309089908690600401610d79565b600060405180830381600087803b15801561038757600080fd5b505af115801561039b573d6000803e3d6000fd5b505050505080806103ab90610db3565b9150506102c0565b50505050565b6103c1610999565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042c9190610d60565b116104795760405162461bcd60e51b815260206004820152601b60248201527f62616c616e63654f66546f6b656e3a2020697320657175616c20300000000000604482015260640161027d565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a0823190602401602060405180830381865afa1580156104c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104eb9190610d60565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055a9190610dcc565b5050565b610566610999565b61057060006109f9565b565b604051632f745c5960e01b8152336004820152600060248201819052906001600160a01b03831690632f745c5990604401602060405180830381865afa1580156105c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e49190610d60565b6040516323b872dd60e01b81529091506001600160a01b038316906323b872dd9061061790339030908690600401610d79565b600060405180830381600087803b15801561063157600080fd5b505af1158015610645573d6000803e3d6000fd5b5050336000818152600260209081526040808320805460018181018355918552838520018890559383528382528083206001600160a01b039890981683529681528682209582529490945293909220805460ff19169093179092555050565b600260205281600052604060002081815481106106c057600080fd5b90600052602060002001600091509150505481565b6106dd610999565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107489190610d60565b905060005b818110156103b357604051632f745c5960e01b8152306004820152600060248201819052906001600160a01b03851690632f745c5990604401602060405180830381865afa1580156107a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c79190610d60565b604051632142170760e11b81529091506001600160a01b038516906342842e0e906107fa90309089908690600401610d79565b600060405180830381600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b5050505050808061083890610db3565b91505061074d565b610848610999565b6001600160a01b0381166108ad5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161027d565b6102b2816109f9565b60006108c133610a52565b3360009081526001602090815260408083206001600160a01b0387168452825280832084845290915290205490915060ff166109335760405162461bcd60e51b81526020600482015260116024820152702cb7ba9030b932903737ba1037bbb732b960791b604482015260640161027d565b604051632142170760e11b81526001600160a01b038316906342842e0e9061096390309033908690600401610d79565b600060405180830381600087803b15801561097d57600080fd5b505af1158015610991573d6000803e3d6000fd5b505050505050565b6000546001600160a01b036101009091041633146105705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161027d565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b038116600090815260026020526040812080548290610a7a57610a7a610dee565b9060005260206000200154905060005b6001600160a01b038316600090815260026020526040902054610aaf90600190610e04565b811015610b48576001600160a01b0383166000908152600260205260409020610ad9826001610e1d565b81548110610ae957610ae9610dee565b906000526020600020015460026000856001600160a01b03166001600160a01b031681526020019081526020016000208281548110610b2a57610b2a610dee565b60009182526020909120015580610b4081610db3565b915050610a8a565b506001600160a01b0382166000908152600260205260409020805480610b7057610b70610e30565b60019003818190600052602060002001600090559055919050565b6001600160a01b03811681146102b257600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215610bcc57600080fd5b8435610bd781610b8b565b93506020850135610be781610b8b565b925060408501359150606085013567ffffffffffffffff80821115610c0b57600080fd5b818701915087601f830112610c1f57600080fd5b813581811115610c3157610c31610ba0565b604051601f8201601f19908116603f01168101908382118183101715610c5957610c59610ba0565b816040528281528a6020848701011115610c7257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b600080600060608486031215610cab57600080fd5b8335610cb681610b8b565b92506020840135610cc681610b8b565b929592945050506040919091013590565b600060208284031215610ce957600080fd5b8135610cf481610b8b565b9392505050565b60008060408385031215610d0e57600080fd5b8235610d1981610b8b565b946020939093013593505050565b60008060408385031215610d3a57600080fd5b8235610d4581610b8b565b91506020830135610d5581610b8b565b809150509250929050565b600060208284031215610d7257600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201610dc557610dc5610d9d565b5060010190565b600060208284031215610dde57600080fd5b81518015158114610cf457600080fd5b634e487b7160e01b600052603260045260246000fd5b81810381811115610e1757610e17610d9d565b92915050565b80820180821115610e1757610e17610d9d565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200a1f7eb927bdce616d632783c0394705f6056e48bd2b9c1c40fa179b357563a964736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.