Address Contract Partially Verified
Address
0xc6C9448a86882D73164A984FA52285Ab51c823bC
Balance
0 ETH
Nonce
1
Code Size
7204 bytes
Creator
0x8f090d3C...AC22 at tx 0xc61cdefb...2ae46f
Indexed Transactions
0
Contract Bytecode
7204 bytes
0x608060405234801561000f575f80fd5b5060043610610135575f3560e01c80635f189361116100b6578063a1b1106a1161007a578063a1b1106a14610315578063a56c62cf1461031f578063a9059cbb1461033b578063d9dbf6571461036b578063dd62ed3e14610389578063f2fde38b146103b957610135565b80635f1893611461029557806370a082311461029f578063715018a6146102cf5780638da5cb5b146102d957806395d89b41146102f757610135565b806323b872dd116100fd57806323b872dd146101f1578063313ce5671461022157806333886f7a1461023f57806344337ea11461025d578063537df3b61461027957610135565b806306fdde0314610139578063095ea7b3146101575780630bef0ec71461018757806310d5a77e146101b757806318160ddd146101d3575b5f80fd5b6101416103d5565b60405161014e9190611649565b60405180910390f35b610171600480360381019061016c91906116fa565b610465565b60405161017e9190611752565b60405180910390f35b6101a1600480360381019061019c919061176b565b610487565b6040516101ae9190611752565b60405180910390f35b6101d160048036038101906101cc919061176b565b6104d9565b005b6101db61063a565b6040516101e891906117a5565b60405180910390f35b61020b600480360381019061020691906117be565b610643565b6040516102189190611752565b60405180910390f35b610229610671565b6040516102369190611829565b60405180910390f35b610247610679565b6040516102549190611851565b60405180910390f35b6102776004803603810190610272919061176b565b61069e565b005b610293600480360381019061028e919061176b565b610785565b005b61029d61086b565b005b6102b960048036038101906102b4919061176b565b61093c565b6040516102c691906117a5565b60405180910390f35b6102d7610981565b005b6102e1610994565b6040516102ee9190611851565b60405180910390f35b6102ff6109bc565b60405161030c9190611649565b60405180910390f35b61031d610a4c565b005b6103396004803603810190610334919061176b565b610b1d565b005b610355600480360381019061035091906116fa565b610c7e565b6040516103629190611752565b60405180910390f35b610373610da5565b6040516103809190611851565b60405180910390f35b6103a3600480360381019061039e919061186a565b610dca565b6040516103b091906117a5565b60405180910390f35b6103d360048036038101906103ce919061176b565b610e4c565b005b6060600380546103e4906118d5565b80601f0160208091040260200160405190810160405280929190818152602001828054610410906118d5565b801561045b5780601f106104325761010080835404028352916020019161045b565b820191905f5260205f20905b81548152906001019060200180831161043e57829003601f168201915b5050505050905090565b5f8061046f610ed0565b905061047c818585610ed7565b600191505092915050565b5f60065f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff169050919050565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055f9061194f565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff1660085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036105f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ee906119dd565b60405180910390fd5b8060085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f600254905090565b5f8061064d610ed0565b905061065a858285610ee9565b610665858585610f7b565b60019150509392505050565b5f6012905090565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107249061194f565b60405180910390fd5b600160065f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555050565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080b9061194f565b60405180910390fd5b5f60065f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff02191690831515021790555050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f19061194f565b60405180910390fd5b5f60075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b61098961106b565b6109925f6110f2565b565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546109cb906118d5565b80601f01602080910402602001604051908101604052809291908181526020018280546109f7906118d5565b8015610a425780601f10610a1957610100808354040283529160200191610a42565b820191905f5260205f20905b815481529060010190602001808311610a2557829003601f168201915b5050505050905090565b60085f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610adb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad29061194f565b60405180910390fd5b5f60085f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610bac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba39061194f565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff1660075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290611a6b565b60405180910390fd5b8060075f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f60065f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615610d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0090611ad3565b60405180910390fd5b60065f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff1615610d93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8a90611b3b565b60405180910390fd5b610d9d83836111b5565b905092915050565b60075f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b610e5461106b565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ec4575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610ebb9190611851565b60405180910390fd5b610ecd816110f2565b50565b5f33905090565b610ee483838360016111d7565b505050565b5f610ef48484610dca565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610f755781811015610f66578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610f5d93929190611b59565b60405180910390fd5b610f7484848484035f6111d7565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610feb575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610fe29190611851565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361105b575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016110529190611851565b60405180910390fd5b6110668383836113a6565b505050565b611073610ed0565b73ffffffffffffffffffffffffffffffffffffffff16611091610994565b73ffffffffffffffffffffffffffffffffffffffff16146110f0576110b4610ed0565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016110e79190611851565b60405180910390fd5b565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f806111bf610ed0565b90506111cc818585610f7b565b600191505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611247575f6040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161123e9190611851565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112b7575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016112ae9190611851565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555080156113a0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161139791906117a5565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036113f6578060025f8282546113ea9190611bbb565b925050819055506114c4565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490508181101561147f578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161147693929190611b59565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361150b578060025f8282540392505081905550611555565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115b291906117a5565b60405180910390a3505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b838110156115f65780820151818401526020810190506115db565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61161b826115bf565b61162581856115c9565b93506116358185602086016115d9565b61163e81611601565b840191505092915050565b5f6020820190508181035f8301526116618184611611565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6116968261166d565b9050919050565b6116a68161168c565b81146116b0575f80fd5b50565b5f813590506116c18161169d565b92915050565b5f819050919050565b6116d9816116c7565b81146116e3575f80fd5b50565b5f813590506116f4816116d0565b92915050565b5f80604083850312156117105761170f611669565b5b5f61171d858286016116b3565b925050602061172e858286016116e6565b9150509250929050565b5f8115159050919050565b61174c81611738565b82525050565b5f6020820190506117655f830184611743565b92915050565b5f602082840312156117805761177f611669565b5b5f61178d848285016116b3565b91505092915050565b61179f816116c7565b82525050565b5f6020820190506117b85f830184611796565b92915050565b5f805f606084860312156117d5576117d4611669565b5b5f6117e2868287016116b3565b93505060206117f3868287016116b3565b9250506040611804868287016116e6565b9150509250925092565b5f60ff82169050919050565b6118238161180e565b82525050565b5f60208201905061183c5f83018461181a565b92915050565b61184b8161168c565b82525050565b5f6020820190506118645f830184611842565b92915050565b5f80604083850312156118805761187f611669565b5b5f61188d858286016116b3565b925050602061189e858286016116b3565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806118ec57607f821691505b6020821081036118ff576118fe6118a8565b5b50919050565b7f4e6f7420617574686f72697a65640000000000000000000000000000000000005f82015250565b5f611939600e836115c9565b915061194482611905565b602082019050919050565b5f6020820190508181035f8301526119668161192d565b9050919050565b7f556e626c61636b6c697374206d616e616765722063616e6e6f742062652063685f8201527f616e6765642061667465722073657420746f2061646472657373283029000000602082015250565b5f6119c7603d836115c9565b91506119d28261196d565b604082019050919050565b5f6020820190508181035f8301526119f4816119bb565b9050919050565b7f426c61636b6c697374206d616e616765722063616e6e6f74206265206368616e5f8201527f6765642061667465722073657420746f20616464726573732830290000000000602082015250565b5f611a55603b836115c9565b9150611a60826119fb565b604082019050919050565b5f6020820190508181035f830152611a8281611a49565b9050919050565b7f53656e64657220697320626c61636b6c697374656400000000000000000000005f82015250565b5f611abd6015836115c9565b9150611ac882611a89565b602082019050919050565b5f6020820190508181035f830152611aea81611ab1565b9050919050565b7f526563697069656e7420697320626c61636b6c697374656400000000000000005f82015250565b5f611b256018836115c9565b9150611b3082611af1565b602082019050919050565b5f6020820190508181035f830152611b5281611b19565b9050919050565b5f606082019050611b6c5f830186611842565b611b796020830185611796565b611b866040830184611796565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611bc5826116c7565b9150611bd0836116c7565b9250828201905080821115611be857611be7611b8e565b5b9291505056fea26469706673582212201ba97302672d03d538bae5555f41b161d30ecdc2786a3d97bdccea3bd3939e0364736f6c63430008160033
Verified Source Code Partial Match
Compiler: v0.8.22+commit.4fc1097e
EVM: shanghai
Optimization: No
RedPillToken.sol 789 lines
// SPDX-License-Identifier: MIT // File: @openzeppelin/[email protected]/interfaces/draft-IERC6093.sol // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); } // File: @openzeppelin/[email protected]/utils/Context.sol // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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/[email protected]/access/Ownable.sol // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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/[email protected]/token/ERC20/IERC20.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); } // File: @openzeppelin/[email protected]/token/ERC20/extensions/IERC20Metadata.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } // File: @openzeppelin/[email protected]/token/ERC20/ERC20.sol // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.20; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. */ abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors { mapping(address account => uint256) private _balances; mapping(address account => mapping(address spender => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `value`. */ function transfer(address to, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, value); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `value`. * - the caller must have allowance for ``from``'s tokens of at least * `value`. */ function transferFrom(address from, address to, uint256 value) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, value); _transfer(from, to, value); return true; } /** * @dev Moves a `value` amount of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _transfer(address from, address to, uint256 value) internal { if (from == address(0)) { revert ERC20InvalidSender(address(0)); } if (to == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(from, to, value); } /** * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from` * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding * this function. * * Emits a {Transfer} event. */ function _update(address from, address to, uint256 value) internal virtual { if (from == address(0)) { // Overflow check required: The rest of the code assumes that totalSupply never overflows _totalSupply += value; } else { uint256 fromBalance = _balances[from]; if (fromBalance < value) { revert ERC20InsufficientBalance(from, fromBalance, value); } unchecked { // Overflow not possible: value <= fromBalance <= totalSupply. _balances[from] = fromBalance - value; } } if (to == address(0)) { unchecked { // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply. _totalSupply -= value; } } else { unchecked { // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256. _balances[to] += value; } } emit Transfer(from, to, value); } /** * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0). * Relies on the `_update` mechanism * * Emits a {Transfer} event with `from` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead. */ function _mint(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidReceiver(address(0)); } _update(address(0), account, value); } /** * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply. * Relies on the `_update` mechanism. * * Emits a {Transfer} event with `to` set to the zero address. * * NOTE: This function is not virtual, {_update} should be overridden instead */ function _burn(address account, uint256 value) internal { if (account == address(0)) { revert ERC20InvalidSender(address(0)); } _update(account, address(0), value); } /** * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address owner, address spender, uint256 value) internal { _approve(owner, spender, value, true); } /** * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event. * * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any * `Approval` event during `transferFrom` operations. * * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to * true using the following override: * ``` * function _approve(address owner, address spender, uint256 value, bool) internal virtual override { * super._approve(owner, spender, value, true); * } * ``` * * Requirements are the same as {_approve}. */ function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual { if (owner == address(0)) { revert ERC20InvalidApprover(address(0)); } if (spender == address(0)) { revert ERC20InvalidSpender(address(0)); } _allowances[owner][spender] = value; if (emitEvent) { emit Approval(owner, spender, value); } } /** * @dev Updates `owner` s allowance for `spender` based on spent `value`. * * Does not update the allowance value in case of infinite allowance. * Revert if not enough allowance is available. * * Does not emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 value) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { if (currentAllowance < value) { revert ERC20InsufficientAllowance(spender, currentAllowance, value); } unchecked { _approve(owner, spender, currentAllowance - value, false); } } } } // File: contract-RPILL.sol pragma solidity ^0.8.20; contract RedPillToken is ERC20, Ownable { mapping(address => bool) private isBlacklisted; address public blacklistManager; address public unblacklistManager; modifier onlyBlacklistManager() { require(msg.sender == blacklistManager, "Not authorized"); _; } modifier onlyUnblacklistManager() { require(msg.sender == unblacklistManager, "Not authorized"); _; } constructor(address initialOwner) ERC20("RED PILL", "RPILL") Ownable(initialOwner) { _mint(msg.sender, 1000000000000 * 10 ** decimals()); blacklistManager = msg.sender; unblacklistManager = msg.sender; } function setBlacklistManager(address _manager) public onlyBlacklistManager { require(blacklistManager != address(0), "Blacklist manager cannot be changed after set to address(0)"); blacklistManager = _manager; } function setUnblacklistManager(address _manager) public onlyUnblacklistManager { require(unblacklistManager != address(0), "Unblacklist manager cannot be changed after set to address(0)"); unblacklistManager = _manager; } function addToBlacklist(address account) public onlyBlacklistManager { isBlacklisted[account] = true; } function removeFromBlacklist(address account) public onlyUnblacklistManager { isBlacklisted[account] = false; } function isBlacklistedAddress(address account) public view returns (bool) { return isBlacklisted[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { require(!isBlacklisted[msg.sender], "Sender is blacklisted"); require(!isBlacklisted[recipient], "Recipient is blacklisted"); return super.transfer(recipient, amount); } function renounceBlacklist() public onlyBlacklistManager { blacklistManager = address(0); } function renounceUnblacklist() public onlyUnblacklistManager { unblacklistManager = address(0); } }
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blacklistManager 0xd9dbf657 → address
decimals 0x313ce567 → uint8
isBlacklistedAddress 0x0bef0ec7 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
unblacklistManager 0x33886f7a → address
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
addToBlacklist 0x44337ea1
address account
approve 0x095ea7b3
address spender
uint256 value
returns: bool
removeFromBlacklist 0x537df3b6
address account
renounceBlacklist 0x5f189361
No parameters
renounceOwnership 0x715018a6
No parameters
renounceUnblacklist 0xa1b1106a
No parameters
setBlacklistManager 0xa56c62cf
address _manager
setUnblacklistManager 0x10d5a77e
address _manager
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address