Address Contract Partially Verified
Address
0x7A65CB87F596Caf31a4932f074c59c0592bE77D7
Balance
0.150080 ETH
Nonce
1
Code Size
7796 bytes
Creator
0x86A0985a...0F59 at tx 0xffb48ed0...1213c3
Indexed Transactions
0
Contract Bytecode
7796 bytes
0x608060405260043610610241575f3560e01c8063962dfc7511610134578063cc08e393116100b3578063e0bf7fd111610078578063e0bf7fd114610690578063e29e5476146106be578063e4be2246146106d3578063f2fde38b14610701578063fb0ecfa414610720578063fb201b1d1461073f575f80fd5b8063cc08e393146105ea578063ccb3480f1461060a578063ccec37161461061f578063dd62ed3e1461063e578063e0af36161461065d575f80fd5b8063b670c793116100f9578063b670c7931461055a578063c02466681461056f578063c492f0461461058e578063c49b9a80146105ad578063cbecede0146105cc575f80fd5b8063962dfc75146104ab5780639a7a23d6146104ca5780639c74daf0146104e9578063a9059cbb1461051c578063b19709841461053b575f80fd5b80635bcae2be116101c0578063715018a611610185578063715018a61461043d5780637a64088c146104515780637f635cc0146104655780638da5cb5b1461047a57806395d89b4114610497575f80fd5b80635bcae2be146103a15780635d098b38146103b65780636311bc3e146103d55780636ac9a870146103ea57806370a0823114610409575f80fd5b806320800a001161020657806320800a00146102f157806323b872dd146103075780632fd689e314610326578063313ce5671461033b578063583e056814610356575f80fd5b806306fdde031461024c578063095ea7b3146102765780630bf999a9146102a557806318160ddd146102c85780631d767633146102dc575f80fd5b3661024857005b5f80fd5b348015610257575f80fd5b50610260610753565b60405161026d9190611a37565b60405180910390f35b348015610281575f80fd5b50610295610290366004611a7d565b6107e3565b604051901515815260200161026d565b3480156102b0575f80fd5b506102ba600c5481565b60405190815260200161026d565b3480156102d3575f80fd5b506002546102ba565b3480156102e7575f80fd5b506102ba60095481565b3480156102fc575f80fd5b506103056107fc565b005b348015610312575f80fd5b50610295610321366004611aa7565b610810565b348015610331575f80fd5b506102ba60115481565b348015610346575f80fd5b506040516012815260200161026d565b348015610361575f80fd5b506103897f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b03909116815260200161026d565b3480156103ac575f80fd5b506102ba60065481565b3480156103c1575f80fd5b506103056103d0366004611ae5565b610835565b3480156103e0575f80fd5b506102ba60075481565b3480156103f5575f80fd5b50610305610404366004611b00565b6108c1565b348015610414575f80fd5b506102ba610423366004611ae5565b6001600160a01b03165f9081526020819052604090205490565b348015610448575f80fd5b50610305610937565b34801561045c575f80fd5b50610305610948565b348015610470575f80fd5b506102ba61019081565b348015610485575f80fd5b506005546001600160a01b0316610389565b3480156104a2575f80fd5b50610260610969565b3480156104b6575f80fd5b50600d54610389906001600160a01b031681565b3480156104d5575f80fd5b506103056104e4366004611b2d565b610978565b3480156104f4575f80fd5b506103897f0000000000000000000000001ecb460a532c1d76937bedbadf7d333da30255a481565b348015610527575f80fd5b50610295610536366004611a7d565b610acc565b348015610546575f80fd5b50610305610555366004611b64565b610ad9565b348015610565575f80fd5b506102ba600b5481565b34801561057a575f80fd5b50610305610589366004611b2d565b610ae6565b348015610599575f80fd5b506103056105a8366004611b7b565b610bce565b3480156105b8575f80fd5b506103056105c7366004611bfa565b610c7b565b3480156105d7575f80fd5b5060105461029590610100900460ff1681565b3480156105f5575f80fd5b50600d5461029590600160a01b900460ff1681565b348015610615575f80fd5b506102ba60085481565b34801561062a575f80fd5b50610305610639366004611ae5565b610cd7565b348015610649575f80fd5b506102ba610658366004611c15565b610d5c565b348015610668575f80fd5b506103897f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561069b575f80fd5b506102956106aa366004611ae5565b600e6020525f908152604090205460ff1681565b3480156106c9575f80fd5b506102ba600a5481565b3480156106de575f80fd5b506102956106ed366004611ae5565b600f6020525f908152604090205460ff1681565b34801561070c575f80fd5b5061030561071b366004611ae5565b610d86565b34801561072b575f80fd5b5061030561073a366004611b00565b610dc0565b34801561074a575f80fd5b50610305610e32565b60606003805461076290611c41565b80601f016020809104026020016040519081016040528092919081815260200182805461078e90611c41565b80156107d95780601f106107b0576101008083540402835291602001916107d9565b820191905f5260205f20905b8154815290600101906020018083116107bc57829003601f168201915b5050505050905090565b5f336107f0818585610e4f565b60019150505b92915050565b610804610e61565b61080e3347610e8e565b565b5f3361081d858285610f21565b610828858585610f84565b60019150505b9392505050565b61083d610e61565b600d546001600160a01b0380831691160361089f5760405162461bcd60e51b815260206004820152601c60248201527f4d61726b6574696e672077616c6c6574206973207468652073616d650000000060448201526064015b60405180910390fd5b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6108c9610e61565b6009829055600a8190556108dd8183611c8d565b600b81905561019010156109335760405162461bcd60e51b815260206004820152601860248201527f73656c6c466565546f74616c20697320746f6f206869676800000000000000006044820152606401610896565b5050565b61093f610e61565b61080e5f610fe1565b305f9081526020819052604090205480156109665761096681611032565b50565b60606004805461076290611c41565b610980610e61565b7f0000000000000000000000001ecb460a532c1d76937bedbadf7d333da30255a46001600160a01b0316826001600160a01b031603610a335760405162461bcd60e51b815260206004820152604360248201527f54686520556e697377617020706169722063616e6e6f742062652072656d6f7660448201527f65642066726f6d205f69734175746f6d617465644d61726b65744d616b65725060648201526230b4b960e91b608482015260a401610896565b6001600160a01b0382165f908152600f602052604090205481151560ff909116151503610aa25760405162461bcd60e51b815260206004820152601b60248201527f5061697220616c72656164792068617320746861742076616c756500000000006044820152606401610896565b6001600160a01b03919091165f908152600f60205260409020805460ff1916911515919091179055565b5f336107f0818585610f84565b610ae1610e61565b601155565b610aee610e61565b6001600160a01b0382165f908152600e602052604090205481151560ff909116151503610b705760405162461bcd60e51b815260206004820152602a60248201527f4163636f756e7420697320616c7265616479207468652076616c7565206f6620604482015269276578636c756465642760b01b6064820152608401610896565b6001600160a01b0382165f818152600e6020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b610bd6610e61565b5f5b82811015610c3a5781600e5f868685818110610bf657610bf6611ca0565b9050602002016020810190610c0b9190611ae5565b6001600160a01b0316815260208101919091526040015f20805460ff1916911515919091179055600101610bd8565b507f7fdaf542373fa84f4ee8d662c642f44e4c2276a217d7d29e548b6eb29a233b35838383604051610c6e93929190611cb4565b60405180910390a1505050565b610c83610e61565b601080548215156101000261ff00199091161790556040517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc15990610ccc90831515815260200190565b60405180910390a150565b610cdf610e61565b6040516370a0823160e01b81523060048201526109669033906001600160a01b038416906370a0823190602401602060405180830381865afa158015610d27573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d4b9190611d0c565b6001600160a01b0384169190611104565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b610d8e610e61565b6001600160a01b038116610db757604051631e4fbdf760e01b81525f6004820152602401610896565b61096681610fe1565b610dc8610e61565b60068290556007819055610ddc8183611c8d565b600881905561019010156109335760405162461bcd60e51b815260206004820152601760248201527f627579466565546f74616c20697320746f6f20686967680000000000000000006044820152606401610896565b610e3a610e61565b600d805460ff60a01b1916600160a01b179055565b610e5c8383836001611156565b505050565b6005546001600160a01b0316331461080e5760405163118cdaa760e01b8152336004820152602401610896565b80471015610eb15760405163cd78605960e01b8152306004820152602401610896565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114610efa576040519150601f19603f3d011682016040523d82523d5f602084013e610eff565b606091505b5050905080610e5c57604051630a12f52160e11b815260040160405180910390fd5b5f610f2c8484610d5c565b90505f198114610f7e5781811015610f7057604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610896565b610f7e84848484035f611156565b50505050565b6001600160a01b038316610fad57604051634b637e8f60e11b81525f6004820152602401610896565b6001600160a01b038216610fd65760405163ec442f0560e01b81525f6004820152602401610896565b610e5c838383611228565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6010805460ff19166001179055600c541561107d575f81600c541161105957600c5461105b565b815b905061106681611292565b305f908152602081905260409020545f600c559150505b5f611089600283611d23565b90505f6110968284611d42565b9050476110a382306112a5565b5f6110ae8247611d42565b90506110ba848261142f565b60408051858152602081018390527f28fc98272ce761178794ad6768050fea1648e07f1e2ffe15afd3a290f8381486910160405180910390a150506010805460ff19169055505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e5c908490611507565b6001600160a01b03841661117f5760405163e602df0560e01b81525f6004820152602401610896565b6001600160a01b0383166111a857604051634a1406b160e11b81525f6004820152602401610896565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015610f7e57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161121a91815260200190565b60405180910390a350505050565b6112328383611568565b158061125557506001600160a01b0383165f908152600e602052604090205460ff165b8061127757506001600160a01b0382165f908152600e602052604090205460ff165b1561128757610e5c8383836115a9565b610e5c8383836116cf565b600d546109669082906001600160a01b03165b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106112d8576112d8611ca0565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061132c5761132c611ca0565b60200260200101906001600160a01b031690816001600160a01b03168152505082611377307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d610d5c565b10156113a9576113a9307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d5f19610e4f565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac947906113fd9086905f90869088904290600401611d55565b5f604051808303815f87803b158015611414575f80fd5b505af1158015611426573d5f803e3d5ffd5b50505050505050565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d7198230855f806114756005546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156114db573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906115009190611dc6565b5050505050565b5f61151b6001600160a01b03841683611862565b905080515f1415801561153f57508080602001905181019061153d9190611df1565b155b15610e5c57604051635274afe760e01b81526001600160a01b0384166004820152602401610896565b6001600160a01b0382165f908152600f602052604081205460ff168061082e5750506001600160a01b03165f908152600f602052604090205460ff16919050565b6001600160a01b0383166115d3578060025f8282546115c89190611c8d565b909155506116439050565b6001600160a01b0383165f90815260208190526040902054818110156116255760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610896565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b03821661165f5760028054829003905561167d565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116c291815260200190565b60405180910390a3505050565b600d5483908390600160a01b900460ff168061170257506001600160a01b0382165f908152600e602052604090205460ff165b8061172457506001600160a01b0381165f908152600e602052604090205460ff165b6117705760405162461bcd60e51b815260206004820152601860248201527f4e6f74206f70656e20666f722074726164696e672079657400000000000000006044820152606401610896565b5f805f61177c8861186f565b9194509250905080156117e1575f61179487856118be565b90505f6117a188856118be565b90505f6117ae8284611c8d565b90506117ba818a611d42565b98506117c78b30836115a9565b81600c5f8282546117d89190611c8d565b90915550505050505b305f9081526020819052604090205460115481108015908190611807575060105460ff16155b801561182a57506001600160a01b0389165f908152600f602052604090205460ff165b801561183d5750601054610100900460ff165b1561184b5761184b82611032565b6118568a8a8a6115a9565b50505050505050505050565b606061082e83835f6118f7565b6001600160a01b0381165f908152600f60205260408120548190819060ff16156118a7576006549250600754915060085490506118b7565b6009549250600a549150600b5490505b9193909250565b5f8115806118ca575082155b156118d657505f6107f6565b5f6127106118e48486611e0c565b6118ee9190611d23565b91506107f69050565b60608147101561191c5760405163cd78605960e01b8152306004820152602401610896565b5f80856001600160a01b031684866040516119379190611e23565b5f6040518083038185875af1925050503d805f8114611971576040519150601f19603f3d011682016040523d82523d5f602084013e611976565b606091505b5091509150611986868383611990565b9695505050505050565b6060826119a5576119a0826119ec565b61082e565b81511580156119bc57506001600160a01b0384163b155b156119e557604051639996b31560e01b81526001600160a01b0385166004820152602401610896565b508061082e565b8051156119fc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5f5b83811015611a2f578181015183820152602001611a17565b50505f910152565b602081525f8251806020840152611a55816040850160208701611a15565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610966575f80fd5b5f8060408385031215611a8e575f80fd5b8235611a9981611a69565b946020939093013593505050565b5f805f60608486031215611ab9575f80fd5b8335611ac481611a69565b92506020840135611ad481611a69565b929592945050506040919091013590565b5f60208284031215611af5575f80fd5b813561082e81611a69565b5f8060408385031215611b11575f80fd5b50508035926020909101359150565b8015158114610966575f80fd5b5f8060408385031215611b3e575f80fd5b8235611b4981611a69565b91506020830135611b5981611b20565b809150509250929050565b5f60208284031215611b74575f80fd5b5035919050565b5f805f60408486031215611b8d575f80fd5b833567ffffffffffffffff80821115611ba4575f80fd5b818601915086601f830112611bb7575f80fd5b813581811115611bc5575f80fd5b8760208260051b8501011115611bd9575f80fd5b60209283019550935050840135611bef81611b20565b809150509250925092565b5f60208284031215611c0a575f80fd5b813561082e81611b20565b5f8060408385031215611c26575f80fd5b8235611c3181611a69565b91506020830135611b5981611a69565b600181811c90821680611c5557607f821691505b602082108103611c7357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156107f6576107f6611c79565b634e487b7160e01b5f52603260045260245ffd5b604080825281018390525f8460608301825b86811015611cf6578235611cd981611a69565b6001600160a01b0316825260209283019290910190600101611cc6565b5080925050508215156020830152949350505050565b5f60208284031215611d1c575f80fd5b5051919050565b5f82611d3d57634e487b7160e01b5f52601260045260245ffd5b500490565b818103818111156107f6576107f6611c79565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611da55784516001600160a01b031683529383019391830191600101611d80565b50506001600160a01b03969096166060850152505050608001529392505050565b5f805f60608486031215611dd8575f80fd5b8351925060208401519150604084015190509250925092565b5f60208284031215611e01575f80fd5b815161082e81611b20565b80820281158282048414176107f6576107f6611c79565b5f8251611e34818460208701611a15565b919091019291505056fea26469706673582212202f40d0dd66b485bc8d9d57c507a813042f284ee7aeec1a1a9237ab5e4bafa39d64736f6c63430008180033
Verified Source Code Partial Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: shanghai
Optimization: Yes (200 runs)
ZyptoToken.sol 1561 lines
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } } // File @openzeppelin/contracts/access/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * 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/contracts/interfaces/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) /** * @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/contracts/token/ERC20/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) /** * @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/contracts/token/ERC20/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) /** * @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/contracts/token/ERC20/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol) /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * * 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 @openzeppelin/contracts/token/ERC20/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } } // File @openzeppelin/contracts/token/ERC20/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } } // File contracts/lib/Rescuable.sol // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.23; abstract contract Rescuable is Ownable { using SafeERC20 for IERC20; using Address for address payable; function rescueERC20(IERC20 _token) external onlyOwner { _token.safeTransfer(msg.sender, _token.balanceOf(address(this))); } function rescueETH() external onlyOwner { payable(_msgSender()).sendValue(address(this).balance); } } // File contracts/interfaces/IUniswapV2.sol // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.23; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } // File contracts/lib/Percentages.sol // Original license: SPDX_License_Identifier: MIT pragma solidity ^0.8.23; library Percentages { // Get value of a percent of a number function calcPortionFromBasisPoints(uint256 _amount, uint256 _basisPoints) internal pure returns(uint256) { if(_basisPoints == 0 || _amount == 0) { return 0; } else { uint256 _portion = (_amount * _basisPoints) / 10000; return _portion; } } // Get basis points (percentage) of _portion relative to _amount function calcBasisPoints(uint256 _amount, uint256 _portion) internal pure returns(uint256) { if(_portion == 0 || _amount == 0) { return 0; } else { uint256 _basisPoints = (_portion * 10000) / _amount; return _basisPoints; } } } // File contracts/ZyptoToken.sol // Original license: SPDX_License_Identifier: MIT // Contract notes: // * SafeMath is generally not needed anymore since Solidity 0.8.0 // * All percentages are expressed in "basis points" (100bps = 1%) contract ZyptoToken is ERC20, Rescuable { using Percentages for uint256; using SafeERC20 for IERC20; IUniswapV2Router02 public immutable _uniswapV2Router; address public immutable _WETH; address public immutable _uniswapV2Pair; // Fees uint256 public constant MAX_TOTAL_FEE = 400; // 400 basis points (4%) uint256 public _buyFeeLiquidity; uint256 public _buyFeeMarketing;... // [truncated — 59970 bytes total]
Read Contract
MAX_TOTAL_FEE 0x7f635cc0 → uint256
_WETH 0xe0af3616 → address
_buyFeeLiquidity 0x5bcae2be → uint256
_buyFeeMarketing 0x6311bc3e → uint256
_buyFeeTotal 0xccb3480f → uint256
_isAutomatedMarketMakerPair 0xe4be2246 → bool
_isExcludedFromFees 0xe0bf7fd1 → bool
_isOpenForTrading 0xcc08e393 → bool
_marketingWallet 0x962dfc75 → address
_pendingMarketingValue 0x0bf999a9 → uint256
_sellFeeLiquidity 0x1d767633 → uint256
_sellFeeMarketing 0xe29e5476 → uint256
_sellFeeTotal 0xb670c793 → uint256
_swapAndLiquifyEnabled 0xcbecede0 → bool
_swapTokensAtAmount 0x2fd689e3 → uint256
_uniswapV2Pair 0x9c74daf0 → address
_uniswapV2Router 0x583e0568 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
excludeFromFees 0xc0246668
address account
bool excluded
excludeMultipleAccountsFromFees 0xc492f046
address[] accounts
bool excluded
openTrade 0xfb201b1d
No parameters
renounceOwnership 0x715018a6
No parameters
rescueERC20 0xccec3716
address _token
rescueETH 0x20800a00
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setBuyFee 0xfb0ecfa4
uint256 liquidityFee
uint256 marketingFee
setMarketingWallet 0x5d098b38
address account
setSellFee 0x6ac9a870
uint256 liquidityFee
uint256 marketingFee
setSwapAmont 0xb1970984
uint256 swapTokensAtAmount
setSwapAndLiquifyEnabled 0xc49b9a80
bool enabled
swapAndLiquifyNow 0x7a64088c
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address