Created
May 2, 2023 05:50
-
-
Save cassc/f396a7c21cb04e50d5e3afcb6b800638 to your computer and use it in GitHub Desktop.
Json from Etherscan API for a contract consistenting of multiple source files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SourceCode": "{{\r\n \"language\": \"Solidity\",\r\n \"settings\": {\r\n \"evmVersion\": \"london\",\r\n \"libraries\": {},\r\n \"metadata\": {\r\n \"bytecodeHash\": \"ipfs\",\r\n \"useLiteralContent\": true\r\n },\r\n \"optimizer\": {\r\n \"enabled\": true,\r\n \"runs\": 200\r\n },\r\n \"remappings\": [],\r\n \"outputSelection\": {\r\n \"*\": {\r\n \"*\": [\r\n \"evm.bytecode\",\r\n \"evm.deployedBytecode\",\r\n \"devdoc\",\r\n \"userdoc\",\r\n \"metadata\",\r\n \"abi\"\r\n ]\r\n }\r\n }\r\n },\r\n \"sources\": {\r\n \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(1);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\"\r\n },\r\n \"contracts/CryptopunksEscrowBuyer.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"./interfaces/IEscrowBuyer.sol\\\";\\nimport \\\"./interfaces/ICryptopunksMarket.sol\\\";\\n\\ncontract CryptopunksEscrowBuyer is\\n Initializable,\\n OwnableUpgradeable,\\n IEscrowBuyer\\n{\\n address public immutable EXCHANGE; //CRYPTOPUNKS_ADDRESS\\n\\n constructor(address _exchange) {\\n EXCHANGE = _exchange;\\n }\\n\\n function initialize() external initializer {\\n __Ownable_init();\\n }\\n\\n /**\\n * @notice Purchase an NFT and escrow it in this contract.\\n * @param parameters Seaport Protocol order parameters.\\n */\\n function fulfillBasicOrderThrough(BasicOrderParameters calldata parameters)\\n public\\n payable\\n onlyOwner\\n returns (bool)\\n {\\n require(\\n parameters.offerToken == EXCHANGE,\\n \\\"Invalid token address in offer\\\"\\n );\\n\\n uint256 punkId = parameters.offerIdentifier;\\n\\n ICryptopunksMarket(EXCHANGE).buyPunk{ value: msg.value }(punkId);\\n\\n return true;\\n }\\n\\n /**\\n * @notice Transfer the NFT from escrow to a users wallet.\\n * @param tokenAddress The NFT contract address.\\n * @param tokenId The NFT token ID.\\n * @param tokenType The type of NFT asset\\n * @param amount The amount of NFT asset quantity (1 if not 1155)\\n * @param recipient The address that will receive the NFT.\\n */\\n\\n function claimNFT(\\n address tokenAddress,\\n uint256 tokenId,\\n IBNPLMarket.TokenType tokenType,\\n uint256 amount,\\n address recipient\\n ) external onlyOwner returns (bool) {\\n ICryptopunksMarket(EXCHANGE).transferPunk(recipient, tokenId);\\n return true;\\n }\\n\\n /**\\n * @notice A read-only method to validate that an NFT is escrowed in this contract\\n * @param assetContractAddress The NFT contract address.\\n * @param assetTokenId The NFT token ID.\\n * @param quantity The amount of NFT asset quantity (1 if not 1155).\\n * @param tokenType The type of NFT asset.\\n */\\n function hasOwnershipOfAsset(\\n address assetContractAddress,\\n uint256 assetTokenId,\\n uint256 quantity,\\n IBNPLMarket.TokenType tokenType\\n ) public view returns (bool) {\\n if (\\n tokenType == IBNPLMarket.TokenType.PUNK &&\\n quantity == 1 &&\\n assetContractAddress == EXCHANGE\\n ) {\\n return\\n ICryptopunksMarket(EXCHANGE).punkIndexToAddress(assetTokenId) ==\\n address(this);\\n }\\n\\n return false;\\n }\\n}\\n\"\r\n },\r\n \"contracts/interfaces/IBNPLMarket.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IBNPLMarket {\\n enum TokenType {\\n ERC721,\\n ERC1155,\\n PUNK\\n }\\n}\\n\"\r\n },\r\n \"contracts/interfaces/ICryptopunksMarket.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/**\\n * @notice The interface of functions for the Cryptopunks contract\\n\\n */\\ninterface ICryptopunksMarket {\\n function punkIndexToAddress(uint256 punkId) external view returns (address);\\n\\n function buyPunk(uint256 punkId) external payable;\\n\\n function transferPunk(address to, uint256 punkIndex) external;\\n\\n function getPunk(uint256 punkIndex) external;\\n\\n function setInitialOwner(address owner, uint256 punkId) external;\\n\\n function allInitialOwnersAssigned() external;\\n\\n function offerPunkForSale(uint256 punkId, uint256 price) external;\\n}\\n\"\r\n },\r\n \"contracts/interfaces/IEscrowBuyer.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { BasicOrderParameters } from \\\"../seaport/lib/ConsiderationStructs.sol\\\";\\n\\nimport \\\"./IBNPLMarket.sol\\\";\\n\\n/**\\n * @notice It is the interface of functions that we use for the canonical WETH contract.\\n *\\n * @author [email protected]\\n */\\ninterface IEscrowBuyer {\\n function initialize() external;\\n\\n function fulfillBasicOrderThrough(BasicOrderParameters calldata parameters)\\n external\\n payable\\n returns (bool);\\n\\n function claimNFT(\\n address tokenAddress,\\n uint256 tokenId,\\n IBNPLMarket.TokenType tokenType,\\n uint256 amount,\\n address recipient\\n ) external returns (bool);\\n\\n function hasOwnershipOfAsset(\\n address assetContractAddress,\\n uint256 assetTokenId,\\n uint256 quantity,\\n IBNPLMarket.TokenType tokenType\\n ) external view returns (bool);\\n}\\n\"\r\n },\r\n \"contracts/seaport/lib/ConsiderationEnums.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\n// prettier-ignore\\nenum OrderType {\\n // 0: no partial fills, anyone can execute\\n FULL_OPEN,\\n\\n // 1: partial fills supported, anyone can execute\\n PARTIAL_OPEN,\\n\\n // 2: no partial fills, only offerer or zone can execute\\n FULL_RESTRICTED,\\n\\n // 3: partial fills supported, only offerer or zone can execute\\n PARTIAL_RESTRICTED\\n}\\n\\n// prettier-ignore\\nenum BasicOrderType {\\n // 0: no partial fills, anyone can execute\\n ETH_TO_ERC721_FULL_OPEN,\\n\\n // 1: partial fills supported, anyone can execute\\n ETH_TO_ERC721_PARTIAL_OPEN,\\n\\n // 2: no partial fills, only offerer or zone can execute\\n ETH_TO_ERC721_FULL_RESTRICTED,\\n\\n // 3: partial fills supported, only offerer or zone can execute\\n ETH_TO_ERC721_PARTIAL_RESTRICTED,\\n\\n // 4: no partial fills, anyone can execute\\n ETH_TO_ERC1155_FULL_OPEN,\\n\\n // 5: partial fills supported, anyone can execute\\n ETH_TO_ERC1155_PARTIAL_OPEN,\\n\\n // 6: no partial fills, only offerer or zone can execute\\n ETH_TO_ERC1155_FULL_RESTRICTED,\\n\\n // 7: partial fills supported, only offerer or zone can execute\\n ETH_TO_ERC1155_PARTIAL_RESTRICTED,\\n\\n // 8: no partial fills, anyone can execute\\n ERC20_TO_ERC721_FULL_OPEN,\\n\\n // 9: partial fills supported, anyone can execute\\n ERC20_TO_ERC721_PARTIAL_OPEN,\\n\\n // 10: no partial fills, only offerer or zone can execute\\n ERC20_TO_ERC721_FULL_RESTRICTED,\\n\\n // 11: partial fills supported, only offerer or zone can execute\\n ERC20_TO_ERC721_PARTIAL_RESTRICTED,\\n\\n // 12: no partial fills, anyone can execute\\n ERC20_TO_ERC1155_FULL_OPEN,\\n\\n // 13: partial fills supported, anyone can execute\\n ERC20_TO_ERC1155_PARTIAL_OPEN,\\n\\n // 14: no partial fills, only offerer or zone can execute\\n ERC20_TO_ERC1155_FULL_RESTRICTED,\\n\\n // 15: partial fills supported, only offerer or zone can execute\\n ERC20_TO_ERC1155_PARTIAL_RESTRICTED,\\n\\n // 16: no partial fills, anyone can execute\\n ERC721_TO_ERC20_FULL_OPEN,\\n\\n // 17: partial fills supported, anyone can execute\\n ERC721_TO_ERC20_PARTIAL_OPEN,\\n\\n // 18: no partial fills, only offerer or zone can execute\\n ERC721_TO_ERC20_FULL_RESTRICTED,\\n\\n // 19: partial fills supported, only offerer or zone can execute\\n ERC721_TO_ERC20_PARTIAL_RESTRICTED,\\n\\n // 20: no partial fills, anyone can execute\\n ERC1155_TO_ERC20_FULL_OPEN,\\n\\n // 21: partial fills supported, anyone can execute\\n ERC1155_TO_ERC20_PARTIAL_OPEN,\\n\\n // 22: no partial fills, only offerer or zone can execute\\n ERC1155_TO_ERC20_FULL_RESTRICTED,\\n\\n // 23: partial fills supported, only offerer or zone can execute\\n ERC1155_TO_ERC20_PARTIAL_RESTRICTED\\n}\\n\\n// prettier-ignore\\nenum BasicOrderRouteType {\\n // 0: provide Ether (or other native token) to receive offered ERC721 item.\\n ETH_TO_ERC721,\\n\\n // 1: provide Ether (or other native token) to receive offered ERC1155 item.\\n ETH_TO_ERC1155,\\n\\n // 2: provide ERC20 item to receive offered ERC721 item.\\n ERC20_TO_ERC721,\\n\\n // 3: provide ERC20 item to receive offered ERC1155 item.\\n ERC20_TO_ERC1155,\\n\\n // 4: provide ERC721 item to receive offered ERC20 item.\\n ERC721_TO_ERC20,\\n\\n // 5: provide ERC1155 item to receive offered ERC20 item.\\n ERC1155_TO_ERC20\\n}\\n\\n// prettier-ignore\\nenum ItemType {\\n // 0: ETH on mainnet, MATIC on polygon, etc.\\n NATIVE,\\n\\n // 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)\\n ERC20,\\n\\n // 2: ERC721 items\\n ERC721,\\n\\n // 3: ERC1155 items\\n ERC1155,\\n\\n // 4: ERC721 items where a number of tokenIds are supported\\n ERC721_WITH_CRITERIA,\\n\\n // 5: ERC1155 items where a number of ids are supported\\n ERC1155_WITH_CRITERIA\\n}\\n\\n// prettier-ignore\\nenum Side {\\n // 0: Items that can be spent\\n OFFER,\\n\\n // 1: Items that must be received\\n CONSIDERATION\\n}\\n\"\r\n },\r\n \"contracts/seaport/lib/ConsiderationStructs.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.7;\\n\\n// prettier-ignore\\nimport {\\n OrderType,\\n BasicOrderType,\\n ItemType,\\n Side\\n} from \\\"./ConsiderationEnums.sol\\\";\\n\\n/**\\n * @dev An order contains eleven components: an offerer, a zone (or account that\\n * can cancel the order or restrict who can fulfill the order depending on\\n * the type), the order type (specifying partial fill support as well as\\n * restricted order status), the start and end time, a hash that will be\\n * provided to the zone when validating restricted orders, a salt, a key\\n * corresponding to a given conduit, a counter, and an arbitrary number of\\n * offer items that can be spent along with consideration items that must\\n * be received by their respective recipient.\\n */\\nstruct OrderComponents {\\n address offerer;\\n address zone;\\n OfferItem[] offer;\\n ConsiderationItem[] consideration;\\n OrderType orderType;\\n uint256 startTime;\\n uint256 endTime;\\n bytes32 zoneHash;\\n uint256 salt;\\n bytes32 conduitKey;\\n uint256 counter;\\n}\\n\\n/**\\n * @dev An offer item has five components: an item type (ETH or other native\\n * tokens, ERC20, ERC721, and ERC1155, as well as criteria-based ERC721 and\\n * ERC1155), a token address, a dual-purpose \\\"identifierOrCriteria\\\"\\n * component that will either represent a tokenId or a merkle root\\n * depending on the item type, and a start and end amount that support\\n * increasing or decreasing amounts over the duration of the respective\\n * order.\\n */\\nstruct OfferItem {\\n ItemType itemType;\\n address token;\\n uint256 identifierOrCriteria;\\n uint256 startAmount;\\n uint256 endAmount;\\n}\\n\\n/**\\n * @dev A consideration item has the same five components as an offer item and\\n * an additional sixth component designating the required recipient of the\\n * item.\\n */\\nstruct ConsiderationItem {\\n ItemType itemType;\\n address token;\\n uint256 identifierOrCriteria;\\n uint256 startAmount;\\n uint256 endAmount;\\n address payable recipient;\\n}\\n\\n/**\\n * @dev A spent item is translated from a utilized offer item and has four\\n * components: an item type (ETH or other native tokens, ERC20, ERC721, and\\n * ERC1155), a token address, a tokenId, and an amount.\\n */\\nstruct SpentItem {\\n ItemType itemType;\\n address token;\\n uint256 identifier;\\n uint256 amount;\\n}\\n\\n/**\\n * @dev A received item is translated from a utilized consideration item and has\\n * the same four components as a spent item, as well as an additional fifth\\n * component designating the required recipient of the item.\\n */\\nstruct ReceivedItem {\\n ItemType itemType;\\n address token;\\n uint256 identifier;\\n uint256 amount;\\n address payable recipient;\\n}\\n\\n/**\\n * @dev For basic orders involving ETH / native / ERC20 <=> ERC721 / ERC1155\\n * matching, a group of six functions may be called that only requires a\\n * subset of the usual order arguments. Note the use of a \\\"basicOrderType\\\"\\n * enum; this represents both the usual order type as well as the \\\"route\\\"\\n * of the basic order (a simple derivation function for the basic order\\n * type is `basicOrderType = orderType + (4 * basicOrderRoute)`.)\\n */\\nstruct BasicOrderParameters {\\n // calldata offset\\n address considerationToken; // 0x24\\n uint256 considerationIdentifier; // 0x44\\n uint256 considerationAmount; // 0x64\\n address payable offerer; // 0x84\\n address zone; // 0xa4\\n address offerToken; // 0xc4\\n uint256 offerIdentifier; // 0xe4\\n uint256 offerAmount; // 0x104\\n BasicOrderType basicOrderType; // 0x124\\n uint256 startTime; // 0x144\\n uint256 endTime; // 0x164\\n bytes32 zoneHash; // 0x184\\n uint256 salt; // 0x1a4\\n bytes32 offererConduitKey; // 0x1c4\\n bytes32 fulfillerConduitKey; // 0x1e4\\n uint256 totalOriginalAdditionalRecipients; // 0x204\\n AdditionalRecipient[] additionalRecipients; // 0x224\\n bytes signature; // 0x244\\n // Total length, excluding dynamic array data: 0x264 (580)\\n}\\n\\n/**\\n * @dev Basic orders can supply any number of additional recipients, with the\\n * implied assumption that they are supplied from the offered ETH (or other\\n * native token) or ERC20 token for the order.\\n */\\nstruct AdditionalRecipient {\\n uint256 amount;\\n address payable recipient;\\n}\\n\\n/**\\n * @dev The full set of order components, with the exception of the counter,\\n * must be supplied when fulfilling more sophisticated orders or groups of\\n * orders. The total number of original consideration items must also be\\n * supplied, as the caller may specify additional consideration items.\\n */\\nstruct OrderParameters {\\n address offerer; // 0x00\\n address zone; // 0x20\\n OfferItem[] offer; // 0x40\\n ConsiderationItem[] consideration; // 0x60\\n OrderType orderType; // 0x80\\n uint256 startTime; // 0xa0\\n uint256 endTime; // 0xc0\\n bytes32 zoneHash; // 0xe0\\n uint256 salt; // 0x100\\n bytes32 conduitKey; // 0x120\\n uint256 totalOriginalConsiderationItems; // 0x140\\n // offer.length // 0x160\\n}\\n\\n/**\\n * @dev Orders require a signature in addition to the other order parameters.\\n */\\nstruct Order {\\n OrderParameters parameters;\\n bytes signature;\\n}\\n\\n/**\\n * @dev Advanced orders include a numerator (i.e. a fraction to attempt to fill)\\n * and a denominator (the total size of the order) in addition to the\\n * signature and other order parameters. It also supports an optional field\\n * for supplying extra data; this data will be included in a staticcall to\\n * `isValidOrderIncludingExtraData` on the zone for the order if the order\\n * type is restricted and the offerer or zone are not the caller.\\n */\\nstruct AdvancedOrder {\\n OrderParameters parameters;\\n uint120 numerator;\\n uint120 denominator;\\n bytes signature;\\n bytes extraData;\\n}\\n\\n/**\\n * @dev Orders can be validated (either explicitly via `validate`, or as a\\n * consequence of a full or partial fill), specifically cancelled (they can\\n * also be cancelled in bulk via incrementing a per-zone counter), and\\n * partially or fully filled (with the fraction filled represented by a\\n * numerator and denominator).\\n */\\nstruct OrderStatus {\\n bool isValidated;\\n bool isCancelled;\\n uint120 numerator;\\n uint120 denominator;\\n}\\n\\n/**\\n * @dev A criteria resolver specifies an order, side (offer vs. consideration),\\n * and item index. It then provides a chosen identifier (i.e. tokenId)\\n * alongside a merkle proof demonstrating the identifier meets the required\\n * criteria.\\n */\\nstruct CriteriaResolver {\\n uint256 orderIndex;\\n Side side;\\n uint256 index;\\n uint256 identifier;\\n bytes32[] criteriaProof;\\n}\\n\\n/**\\n * @dev A fulfillment is applied to a group of orders. It decrements a series of\\n * offer and consideration items, then generates a single execution\\n * element. A given fulfillment can be applied to as many offer and\\n * consideration items as desired, but must contain at least one offer and\\n * at least one consideration that match. The fulfillment must also remain\\n * consistent on all key parameters across all offer items (same offerer,\\n * token, type, tokenId, and conduit preference) as well as across all\\n * consideration items (token, type, tokenId, and recipient).\\n */\\nstruct Fulfillment {\\n FulfillmentComponent[] offerComponents;\\n FulfillmentComponent[] considerationComponents;\\n}\\n\\n/**\\n * @dev Each fulfillment component contains one index referencing a specific\\n * order and another referencing a specific offer or consideration item.\\n */\\nstruct FulfillmentComponent {\\n uint256 orderIndex;\\n uint256 itemIndex;\\n}\\n\\n/**\\n * @dev An execution is triggered once all consideration items have been zeroed\\n * out. It sends the item in question from the offerer to the item's\\n * recipient, optionally sourcing approvals from either this contract\\n * directly or from the offerer's chosen conduit if one is specified. An\\n * execution is not provided as an argument, but rather is derived via\\n * orders, criteria resolvers, and fulfillments (where the total number of\\n * executions will be less than or equal to the total number of indicated\\n * fulfillments) and returned as part of `matchOrders`.\\n */\\nstruct Execution {\\n ReceivedItem item;\\n address offerer;\\n bytes32 conduitKey;\\n}\\n\"\r\n }\r\n }\r\n}}", | |
"ABI": "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_exchange\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"EXCHANGE\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"enum IBNPLMarket.TokenType\",\"name\":\"tokenType\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"claimNFT\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"considerationToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"considerationIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"considerationAmount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"offerer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"zone\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"offerToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"offerIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"offerAmount\",\"type\":\"uint256\"},{\"internalType\":\"enum BasicOrderType\",\"name\":\"basicOrderType\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"zoneHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"salt\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"offererConduitKey\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"fulfillerConduitKey\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"totalOriginalAdditionalRecipients\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"recipient\",\"type\":\"address\"}],\"internalType\":\"struct AdditionalRecipient[]\",\"name\":\"additionalRecipients\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"internalType\":\"struct BasicOrderParameters\",\"name\":\"parameters\",\"type\":\"tuple\"}],\"name\":\"fulfillBasicOrderThrough\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"assetContractAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"assetTokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quantity\",\"type\":\"uint256\"},{\"internalType\":\"enum IBNPLMarket.TokenType\",\"name\":\"tokenType\",\"type\":\"uint8\"}],\"name\":\"hasOwnershipOfAsset\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", | |
"ContractName": "CryptopunksEscrowBuyer", | |
"CompilerVersion": "v0.8.13+commit.abaa5c0e", | |
"OptimizationUsed": "1", | |
"Runs": "200", | |
"ConstructorArguments": "000000000000000000000000b47e3cd837ddf8e4c57f05d70ab865de6e193bbb", | |
"EVMVersion": "Default", | |
"Library": "", | |
"LicenseType": "MIT", | |
"Proxy": "0", | |
"Implementation": "", | |
"SwarmSource": "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get the standard json input for solc, remove the extract starting and ending brackets from
SourceCode
.