Address Contract Partially Verified
Address
0x577c0379Ba192c3293F207b40327f34d18F9e7e3
Balance
0 ETH
Nonce
1
Code Size
6939 bytes
Creator
0xc3A5a5D7...f061 at tx 0xe1b074c3...1e703e
Indexed Transactions
0
Contract Bytecode
6939 bytes
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80637ec4a65911610104578063c87b56dd116100a2578063d600ddef11610071578063d600ddef146103ea578063db9771f5146103fd578063e985e9c514610410578063f2fde38b1461044c57600080fd5b8063c87b56dd14610388578063cf9bed2f1461039b578063d44624b2146103bb578063d5abeb01146103ce57600080fd5b8063a0712d68116100de578063a0712d681461033c578063a22cb4651461034f578063b88d4fde14610362578063baf9e3dc1461037557600080fd5b80637ec4a659146103105780638da5cb5b1461032357806395d89b411461033457600080fd5b80632f745c59116101715780636352211e1161014b5780636352211e146102c257806370a08231146102d5578063715018a6146102e857806376c63873146102f057600080fd5b80632f745c591461028957806342842e0e1461029c5780634f6ccce7146102af57600080fd5b8063095ea7b3116101ad578063095ea7b31461023c5780630cdd42341461025157806318160ddd1461026457806323b872dd1461027657600080fd5b806301ffc9a7146101d457806306fdde03146101fc578063081812fc14610211575b600080fd5b6101e76101e2366004611772565b61045f565b60405190151581526020015b60405180910390f35b61020461048a565b6040516101f391906118c2565b61022461021f3660046117e5565b61051c565b6040516001600160a01b0390911681526020016101f3565b61024f61024a366004611746565b6105a9565b005b600a54610224906001600160a01b031681565b6002545b6040519081526020016101f3565b61024f610284366004611652565b6106bf565b610268610297366004611746565b610708565b61024f6102aa366004611652565b6107bb565b6102686102bd3660046117e5565b6107d6565b6102246102d03660046117e5565b610843565b6102686102e33660046115df565b6108cf565b61024f6109a1565b6102686102fe3660046117e5565b60086020526000908152604090205481565b61024f61031e36600461179c565b6109d7565b6005546001600160a01b0316610224565b610204610a18565b61024f61034a3660046117e5565b610a27565b61024f61035d366004611713565b610b1e565b61024f610370366004611693565b610be3565b61024f6103833660046117e5565b610c30565b6102046103963660046117e5565b610cb5565b6102686103a93660046117e5565b60096020526000908152604090205481565b61024f6103c93660046117e5565b610d91565b6103d7611e6181565b60405161ffff90911681526020016101f3565b6101e76103f83660046117e5565b610e19565b61024f61040b3660046115df565b610e25565b6101e761041e366004611619565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b61024f61045a3660046115df565b610e7b565b60006001600160e01b0319821663780e9d6360e01b1480610484575061048482610f16565b92915050565b60606000805461049990611a0e565b80601f01602080910402602001604051908101604052809291908181526020018280546104c590611a0e565b80156105125780601f106104e757610100808354040283529160200191610512565b820191906000526020600020905b8154815290600101906020018083116104f557829003601f168201915b5050505050905090565b600061052782610f66565b61058d5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600360205260409020546001600160a01b031690565b60006105b482610843565b9050806001600160a01b0316836001600160a01b031614156106225760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610584565b336001600160a01b038216148061063e575061063e813361041e565b6106b05760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610584565b6106ba8383610fb0565b505050565b505060405162461bcd60e51b8152602060048201526014602482015273151c985b9cd9995c881b9bdd08185b1b1bddd95960621b60448201526000915081908190606401610584565b6000610713836108cf565b82106107315760405162461bcd60e51b8152600401610584906118f5565b6000805b6002548110156107a2576002818154811061075257610752611aa4565b6000918252602090912001546001600160a01b038681169116141561079057838214156107825791506104849050565b8161078c81611a49565b9250505b8061079a81611a49565b915050610735565b5060405162461bcd60e51b8152600401610584906118f5565b6106ba83838360405180602001604052806000815250610be3565b600254600090821061083f5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610584565b5090565b6000806002838154811061085957610859611aa4565b6000918252602090912001546001600160a01b03169050806104845760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610584565b60006001600160a01b03821661093a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610584565b600254600090815b81811015610998576002818154811061095d5761095d611aa4565b6000918252602090912001546001600160a01b03868116911614156109885761098583611a49565b92505b61099181611a49565b9050610942565b50909392505050565b6005546001600160a01b031633146109cb5760405162461bcd60e51b815260040161058490611940565b6109d5600061101e565b565b6005546001600160a01b03163314610a015760405162461bcd60e51b815260040161058490611940565b8051610a149060069060208401906114d9565b5050565b60606001805461049990611a0e565b600254611e61610a38826001611975565b61ffff161115610a805760405162461bcd60e51b815260206004820152601360248201527222bc31b2b2b2399036b0bc1039bab838363c9760691b6044820152606401610584565b600b546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd90606401600060405180830381600087803b158015610ad257600080fd5b505af1158015610ae6573d6000803e3d6000fd5b50505050610af8338261ffff16611070565b61ffff166000818152600960209081526040808320859055938252600890529190912055565b6001600160a01b038216331415610b775760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610584565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b505060405162461bcd60e51b8152602060048201526014602482015273151c985b9cd9995c881b9bdd08185b1b1bddd95960621b6044820152600092508291508190606090606401610584565b6000818152600960205260409081902054600b5491516323b872dd60e01b81523060048201523360248201526044810182905290916001600160a01b0316906323b872dd90606401600060405180830381600087803b158015610c9257600080fd5b505af1158015610ca6573d6000803e3d6000fd5b50505050610a143330846110ec565b6060610cc082610f66565b610d245760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610584565b60009182526009602052604082205491610d3c6110f7565b90506000815111610d5c5760405180602001604052806000815250610d8a565b80610d6684611106565b6007604051602001610d7a939291906117fe565b6040516020818303038152906040525b9392505050565b600081815260086020526040902054610dab3033836110ec565b600b546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd90606401600060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b505050505050565b600080610d8a83610f66565b6005546001600160a01b03163314610e4f5760405162461bcd60e51b815260040161058490611940565b600a80546001600160a01b039092166001600160a01b03199283168117909155600b8054909216179055565b6005546001600160a01b03163314610ea55760405162461bcd60e51b815260040161058490611940565b6001600160a01b038116610f0a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610584565b610f138161101e565b50565b60006001600160e01b031982166380ac58cd60e01b1480610f4757506001600160e01b03198216635b5e139f60e01b145b8061048457506301ffc9a760e01b6001600160e01b0319831614610484565b60025460009082108015610484575060006001600160a01b031660028381548110610f9357610f93611aa4565b6000918252602090912001546001600160a01b0316141592915050565b600081815260036020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610fe582610843565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6002805460018101825560009182527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6106ba83838361120c565b60606006805461049990611a0e565b60608161112a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611154578061113e81611a49565b915061114d9050600a836119b3565b915061112e565b60008167ffffffffffffffff81111561116f5761116f611aba565b6040519080825280601f01601f191660200182016040528015611199576020820181803683370190505b5090505b8415611204576111ae6001836119c7565b91506111bb600a86611a64565b6111c690603061199b565b60f81b8183815181106111db576111db611aa4565b60200101906001600160f81b031916908160001a9053506111fd600a866119b3565b945061119d565b949350505050565b826001600160a01b031661121f82610843565b6001600160a01b0316146112875760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610584565b6001600160a01b0382166112e95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610584565b6112f483838361136d565b6112ff600082610fb0565b816002828154811061131357611313611aa4565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b60008181526009602052604080822054600b5491516331a9108f60e11b8152600481018290529092916001600160a01b031690636352211e9060240160206040518083038186803b1580156113c157600080fd5b505afa1580156113d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f991906115fc565b90506001600160a01b03851630148061141a57506001600160a01b03841630145b61145d5760405162461bcd60e51b8152602060048201526014602482015273151c985b9cd9995c881b9bdd08105b1b1bddd95960621b6044820152606401610584565b806001600160a01b0316856001600160a01b0316148061148e5750806001600160a01b0316846001600160a01b0316145b6114d25760405162461bcd60e51b815260206004820152601560248201527402a3930b739b332b9103737ba1020b63637bbb2b21605d1b6044820152606401610584565b5050505050565b8280546114e590611a0e565b90600052602060002090601f016020900481019282611507576000855561154d565b82601f1061152057805160ff191683800117855561154d565b8280016001018555821561154d579182015b8281111561154d578251825591602001919060010190611532565b5061083f9291505b8082111561083f5760008155600101611555565b600067ffffffffffffffff8084111561158457611584611aba565b604051601f8501601f19908116603f011681019082821181831017156115ac576115ac611aba565b816040528093508581528686860111156115c557600080fd5b858560208301376000602087830101525050509392505050565b6000602082840312156115f157600080fd5b8135610d8a81611ad0565b60006020828403121561160e57600080fd5b8151610d8a81611ad0565b6000806040838503121561162c57600080fd5b823561163781611ad0565b9150602083013561164781611ad0565b809150509250929050565b60008060006060848603121561166757600080fd5b833561167281611ad0565b9250602084013561168281611ad0565b929592945050506040919091013590565b600080600080608085870312156116a957600080fd5b84356116b481611ad0565b935060208501356116c481611ad0565b925060408501359150606085013567ffffffffffffffff8111156116e757600080fd5b8501601f810187136116f857600080fd5b61170787823560208401611569565b91505092959194509250565b6000806040838503121561172657600080fd5b823561173181611ad0565b91506020830135801515811461164757600080fd5b6000806040838503121561175957600080fd5b823561176481611ad0565b946020939093013593505050565b60006020828403121561178457600080fd5b81356001600160e01b031981168114610d8a57600080fd5b6000602082840312156117ae57600080fd5b813567ffffffffffffffff8111156117c557600080fd5b8201601f810184136117d657600080fd5b61120484823560208401611569565b6000602082840312156117f757600080fd5b5035919050565b6000845160206118118285838a016119de565b8551918401916118248184848a016119de565b8554920191600090600181811c908083168061184157607f831692505b85831081141561185f57634e487b7160e01b85526022600452602485fd5b8080156118735760018114611884576118b1565b60ff198516885283880195506118b1565b60008b81526020902060005b858110156118a95781548a820152908401908801611890565b505083880195505b50939b9a5050505050505050505050565b60208152600082518060208401526118e18160408501602087016119de565b601f01601f19169190910160400192915050565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff80831681851680830382111561199257611992611a78565b01949350505050565b600082198211156119ae576119ae611a78565b500190565b6000826119c2576119c2611a8e565b500490565b6000828210156119d9576119d9611a78565b500390565b60005b838110156119f95781810151838201526020016119e1565b83811115611a08576000848401525b50505050565b600181811c90821680611a2257607f821691505b60208210811415611a4357634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611a5d57611a5d611a78565b5060010190565b600082611a7357611a73611a8e565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610f1357600080fdfea26469706673582212201ce1d3632dc1b5dcd32a35c9608e56b8e97ba4f5a678c31fde9e4eda299c0af664736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: Yes (200 runs)
PAYCDegenHours.sol 1102 lines
// SPDX-License-Identifier: MIT
// Pepe Ape Yacht Club Portal Contract
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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);
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// 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);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* 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 Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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 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);
/**
* @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;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
/**
* @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 tokenId);
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: ERC2000000.sol
pragma solidity ^0.8.7;
library Address {
function isContract(address account) internal view returns (bool) {
uint size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
}
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
// Mapping from token ID to owner address
address[] internal _owners;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner)
public
view
virtual
override
returns (uint)
{
require(owner != address(0), "ERC721: balance query for the zero address");
uint count;
uint length= _owners.length;
for( uint i; i < length; ++i ){
if( owner == _owners[i] )
++count;
}
delete length;
return count;
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
address owner = _owners[tokenId];
require(
owner != address(0),
"ERC721: owner query for nonexistent token"
);
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId)
public
view
virtual
override
returns (address)
{
require(
_exists(tokenId),
"ERC721: approved query for nonexistent token"
);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved)
public
virtual
override
{
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
delete from;
delete to;
delete tokenId;
revert("Transfer not allowed");
}
function pepetransferFrom(
address from,
address to,
uint256 tokenId
) internal {
//solhint-disable-next-line max-line-length
// require(
// _isApprovedOrOwner(_msgSender(), tokenId),
// "ERC721: transfer caller is not owner nor approved"
// );
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
delete from;
delete to;
delete tokenId;
delete _data;
revert("Transfer not allowed");
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return tokenId < _owners.length && _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId)
internal
view
virtual
returns (bool)
{
require(
_exists(tokenId),
"ERC721: operator query for nonexistent token"
);
address owner = ERC721.ownerOf(tokenId);
return (spender == owner ||
getApproved(tokenId) == spender ||
isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_owners.push(to);
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_owners[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(
ERC721.ownerOf(tokenId) == from,
"ERC721: transfer of token that is not own"
);
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try
IERC721Receiver(to).onERC721Received(
_msgSender(),
from,
tokenId,
_data
)
returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(
"ERC721: transfer to non ERC721Receiver implementer"
);
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` 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 tokenId
) internal virtual {}
}
pragma solidity ^0.8.7;
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account but rips out the core of the gas-wasting processing that comes from OpenZeppelin.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _owners.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < _owners.length, "ERC721Enumerable: global index out of bounds");
return index;
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
uint count;
for(uint i; i < _owners.length; i++){
if(owner == _owners[i]){
if(count == index) return i;
else count++;
}
}
revert("ERC721Enumerable: owner index out of bounds");
}
}
pragma solidity ^0.8.7;
interface IMain {
function transferFrom( address from, address to, uint256 tokenId) external;
function ownerOf( uint _tokenid) external view returns (address);
}
contract PAYCDegenHours is ERC721Enumerable, Ownable {
using Strings for uint256;
string private uriPrefix = "ipfs://Qmae138hdMAu2DKmwxmkkVnw66oHQC9W6Cc7dAUer8C5yE/";
string private uriSuffix = ".json";
uint16 public constant maxSupply = 7777;
mapping (uint => uint) public mappingOldtoNewTokens;
mapping (uint => uint) public mappingNewtoOldTokens;
address public mainAddress = 0x2D0D57D004F82e9f4471CaA8b9f8B1965a814154;
IMain Main = IMain(mainAddress);
constructor() ERC721("PAYC Degen Hours", "PAYC Degen Hours") {
}
function setMainAddress(address contractAddr) external onlyOwner {
mainAddress = contractAddr;
Main= IMain(mainAddress);
}
function mint( uint tokenNumber) external {
uint16 totalSupply = uint16(_owners.length);
require(totalSupply + 1 <= maxSupply, "Exceeds max supply.");
Main.transferFrom( msg.sender, address(this),tokenNumber);
_mint(msg.sender, totalSupply);
mappingNewtoOldTokens[totalSupply] = tokenNumber;
mappingOldtoNewTokens[tokenNumber] = totalSupply;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
uint token =mappingNewtoOldTokens[tokenId];
address _address = Main.ownerOf(token);
require (from == address(this) || to == address(this) , "Transfer not Allowed");
require (from == _address || to == _address , "Transfer not Allowed ");
delete token;
}
function ExchangeOldForNew( uint tokenNumber ) external {
uint _token = mappingOldtoNewTokens[tokenNumber] ;
pepetransferFrom( address(this), msg.sender,_token);
Main.transferFrom(msg.sender, address(this),tokenNumber);
}
function ExchangeNewForOld( uint tokenNumber) external {
uint _token = mappingNewtoOldTokens[tokenNumber] ;
Main.transferFrom( address(this), msg.sender,_token);
pepetransferFrom( msg.sender, address(this),tokenNumber);
}
function checkIfNFTExist(uint256 _tokenId)
public
view
returns (bool)
{
bool exist = _exists(_tokenId);
return exist;
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(_tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
_tokenId = mappingNewtoOldTokens[_tokenId];
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix))
: "";
}
function setUriPrefix(string memory _uriPrefix) external onlyOwner {
uriPrefix = _uriPrefix;
}
function _mint(address to, uint256 tokenId) internal virtual override {
_owners.push(to);
emit Transfer(address(0), to, tokenId);
}
function _baseURI() internal view returns (string memory) {
return uriPrefix;
}
}
Read Contract
balanceOf 0x70a08231 → uint256
checkIfNFTExist 0xd600ddef → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
mainAddress 0x0cdd4234 → address
mappingNewtoOldTokens 0xcf9bed2f → uint256
mappingOldtoNewTokens 0x76c63873 → uint256
maxSupply 0xd5abeb01 → uint16
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
ExchangeNewForOld 0xbaf9e3dc
uint256 tokenNumber
ExchangeOldForNew 0xd44624b2
uint256 tokenNumber
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 tokenNumber
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setMainAddress 0xdb9771f5
address contractAddr
setUriPrefix 0x7ec4a659
string _uriPrefix
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address