Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
18253498 | 151 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
AvatarIsOwnerOfERC721
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 100 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.17 <0.9.0; import "@openzeppelin/contracts/interfaces/IERC721.sol"; import "./Types.sol"; interface IModifier { function avatar() external view returns (address); function target() external view returns (address); } contract AvatarIsOwnerOfERC721 is ICustomCondition { function check( address to, uint256 /* value */, bytes calldata data, Enum.Operation /* operation */, uint256 location, uint256 size, bytes12 /* extra */ ) public view returns (bool success, bytes32 reason) { address avatar = IModifier(msg.sender).avatar(); uint256 tokenId = uint256(bytes32(data[location:location + size])); return (IERC721(to).ownerOf(tokenId) == avatar, 0); } }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title Enum - Collection of enums /// @author Richard Meissner - <[email protected]> contract Enum { enum Operation {Call, DelegateCall} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../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 address zero. * * 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 v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.17 <0.9.0; import "@gnosis.pm/safe-contracts/contracts/common/Enum.sol"; interface IMultiSend { function multiSend(bytes memory transactions) external payable; } struct UnwrappedTransaction { Enum.Operation operation; address to; uint256 value; // We wanna deal in calldata slices. We return location, let invoker slice uint256 dataLocation; uint256 dataSize; } interface ITransactionUnwrapper { function unwrap( address to, uint256 value, bytes calldata data, Enum.Operation operation ) external view returns (UnwrappedTransaction[] memory result); } interface ICustomCondition { function check( address to, uint256 value, bytes calldata data, Enum.Operation operation, uint256 location, uint256 size, bytes12 extra ) external view returns (bool success, bytes32 reason); }
{ "evmVersion": "shanghai", "optimizer": { "enabled": true, "runs": 100 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"enum Enum.Operation","name":"","type":"uint8"},{"internalType":"uint256","name":"location","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"},{"internalType":"bytes12","name":"","type":"bytes12"}],"name":"check","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes32","name":"reason","type":"bytes32"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b5061032b8061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063b0acb9801461002d575b5f80fd5b61004061003b3660046101b0565b61005b565b60408051921515835260208301919091520160405180910390f35b5f805f336001600160a01b0316635aef7de66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561009a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100be919061026a565b90505f89878a6100ce898361028c565b926100db939291906102b1565b6100e4916102d8565b6040516331a9108f60e11b8152600481018290529091506001600160a01b0383811691908e1690636352211e90602401602060405180830381865afa15801561012f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610153919061026a565b6001600160a01b0316149c5f9c509a5050505050505050505050565b6001600160a01b0381168114610183575f80fd5b50565b803560028110610194575f80fd5b919050565b80356001600160a01b031981168114610194575f80fd5b5f805f805f805f8060e0898b0312156101c7575f80fd5b88356101d28161016f565b975060208901359650604089013567ffffffffffffffff808211156101f5575f80fd5b818b0191508b601f830112610208575f80fd5b813581811115610216575f80fd5b8c6020828501011115610227575f80fd5b60208301985080975050505061023f60608a01610186565b93506080890135925060a0890135915061025b60c08a01610199565b90509295985092959890939650565b5f6020828403121561027a575f80fd5b81516102858161016f565b9392505050565b808201808211156102ab57634e487b7160e01b5f52601160045260245ffd5b92915050565b5f80858511156102bf575f80fd5b838611156102cb575f80fd5b5050820193919092039150565b803560208310156102ab575f19602084900360031b1b169291505056fea26469706673582212207733f53fcf22d3e1f256b11dae338bd38c971e16faf47ddcbb4c91d6cbf7bff664736f6c63430008150033
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063b0acb9801461002d575b5f80fd5b61004061003b3660046101b0565b61005b565b60408051921515835260208301919091520160405180910390f35b5f805f336001600160a01b0316635aef7de66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561009a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100be919061026a565b90505f89878a6100ce898361028c565b926100db939291906102b1565b6100e4916102d8565b6040516331a9108f60e11b8152600481018290529091506001600160a01b0383811691908e1690636352211e90602401602060405180830381865afa15801561012f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610153919061026a565b6001600160a01b0316149c5f9c509a5050505050505050505050565b6001600160a01b0381168114610183575f80fd5b50565b803560028110610194575f80fd5b919050565b80356001600160a01b031981168114610194575f80fd5b5f805f805f805f8060e0898b0312156101c7575f80fd5b88356101d28161016f565b975060208901359650604089013567ffffffffffffffff808211156101f5575f80fd5b818b0191508b601f830112610208575f80fd5b813581811115610216575f80fd5b8c6020828501011115610227575f80fd5b60208301985080975050505061023f60608a01610186565b93506080890135925060a0890135915061025b60c08a01610199565b90509295985092959890939650565b5f6020828403121561027a575f80fd5b81516102858161016f565b9392505050565b808201808211156102ab57634e487b7160e01b5f52601160045260245ffd5b92915050565b5f80858511156102bf575f80fd5b838611156102cb575f80fd5b5050820193919092039150565b803560208310156102ab575f19602084900360031b1b169291505056fea26469706673582212207733f53fcf22d3e1f256b11dae338bd38c971e16faf47ddcbb4c91d6cbf7bff664736f6c63430008150033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.