Address Contract Partially Verified
Address
0xcE695Cf1c4638D1678377BA9dCf32345292048d4
Balance
0 ETH
Nonce
1
Code Size
8304 bytes
Creator
0x0A616704...E6A9 at tx 0x9097f18c...344451
Indexed Transactions
0
Contract Bytecode
8304 bytes
0x608060405234801561000f575f80fd5b50600436106101d8575f3560e01c806379d747be11610102578063acb2ad6f116100a0578063e74b981b1161006f578063e74b981b14610520578063e85455d71461053c578063ee6a934c1461056c578063f2fde38b14610588576101d8565b8063acb2ad6f1461049a578063ae22107f146104b8578063cec10c11146104d4578063dd62ed3e146104f0576101d8565b80638da5cb5b116100dc5780638da5cb5b1461041257806395d89b4114610430578063a0712d681461044e578063a9059cbb1461046a576101d8565b806379d747be146103a85780637ca87cb6146103d85780638456cb5914610408576101d8565b8063355274ea1161017a578063470624021161014957806347062402146103325780635c975abb1461035057806370a082311461036e578063715018a61461039e576101d8565b8063355274ea146102d05780633f4ba83a146102ee57806342966c68146102f85780634690484014610314576101d8565b806323b872dd116101b657806323b872dd146102485780632b14ca561461027857806330f1f67c14610296578063313ce567146102b2576101d8565b806306fdde03146101dc578063095ea7b3146101fa57806318160ddd1461022a575b5f80fd5b6101e46105a4565b6040516101f191906118b3565b60405180910390f35b610214600480360381019061020f9190611964565b610634565b60405161022191906119bc565b60405180910390f35b610232610656565b60405161023f91906119e4565b60405180910390f35b610262600480360381019061025d91906119fd565b61065f565b60405161026f91906119bc565b60405180910390f35b6102806106ce565b60405161028d91906119e4565b60405180910390f35b6102b060048036038101906102ab9190611964565b6106d4565b005b6102ba6106ea565b6040516102c79190611a68565b60405180910390f35b6102d86106f2565b6040516102e591906119e4565b60405180910390f35b6102f66106ff565b005b610312600480360381019061030d9190611a81565b610711565b005b61031c61071e565b6040516103299190611abb565b60405180910390f35b61033a610743565b60405161034791906119e4565b60405180910390f35b610358610749565b60405161036591906119bc565b60405180910390f35b61038860048036038101906103839190611ad4565b61075e565b60405161039591906119e4565b60405180910390f35b6103a66107a3565b005b6103c260048036038101906103bd9190611a81565b6107de565b6040516103cf9190611abb565b60405180910390f35b6103f260048036038101906103ed91906119fd565b610819565b6040516103ff91906119e4565b60405180910390f35b6104106108a2565b005b61041a6108b4565b6040516104279190611abb565b60405180910390f35b6104386108dd565b60405161044591906118b3565b60405180910390f35b61046860048036038101906104639190611a81565b61096d565b005b610484600480360381019061047f9190611964565b610a03565b60405161049191906119bc565b60405180910390f35b6104a2610a7b565b6040516104af91906119e4565b60405180910390f35b6104d260048036038101906104cd9190611ad4565b610a81565b005b6104ee60048036038101906104e99190611aff565b610c0c565b005b61050a60048036038101906105059190611b4f565b610c2e565b60405161051791906119e4565b60405180910390f35b61053a60048036038101906105359190611ad4565b610cb0565b005b61055660048036038101906105519190611ad4565b610cfb565b60405161056391906119bc565b60405180910390f35b61058660048036038101906105819190611ad4565b610da3565b005b6105a2600480360381019061059d9190611ad4565b610e1c565b005b6060600380546105b390611bba565b80601f01602080910402602001604051908101604052809291908181526020018280546105df90611bba565b801561062a5780601f106106015761010080835404028352916020019161062a565b820191905f5260205f20905b81548152906001019060200180831161060d57829003601f168201915b5050505050905090565b5f8061063e610ea0565b905061064b818585610ea7565b600191505092915050565b5f600254905090565b5f8061066c858585610819565b90505f818461067b9190611c17565b90505f8211156106b3576106b186600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eb9565b505b5f6106bf878784610eb9565b90508093505050509392505050565b60075481565b6106dc610ee7565b6106e68282610f6e565b5050565b5f6012905090565b5f650746a5288000905090565b610707610ee7565b61070f610fed565b565b61071b3382610f6e565b50565b600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b5f60055f9054906101000a900460ff16905090565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d590611c94565b60405180910390fd5b600981815481106107ed575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f8061082484610cfb565b1561084a576064600754846108399190611cb2565b6108439190611d20565b9050610897565b61085385610cfb565b15610879576064600654846108689190611cb2565b6108729190611d20565b9050610896565b6064600854846108899190611cb2565b6108939190611d20565b90505b5b809150509392505050565b6108aa610ee7565b6108b261104e565b565b5f600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546108ec90611bba565b80601f016020809104026020016040519081016040528092919081815260200182805461091890611bba565b80156109635780601f1061093a57610100808354040283529160200191610963565b820191905f5260205f20905b81548152906001019060200180831161094657829003601f168201915b5050505050905090565b610975610ee7565b61097d6106ea565b600a6109899190611e7f565b6109916106f2565b61099b9190611cb2565b816109a4610656565b6109ae9190611ec9565b11156109ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e690611f46565b60405180910390fd5b610a006109fa6108b4565b826110b0565b50565b5f80610a0d610ea0565b90505f610a1b828686610819565b90505f8185610a2a9190611c17565b90505f821115610a6157610a5f600a5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168361112f565b505b5f610a6c878361112f565b90508094505050505092915050565b60085481565b610a89610ee7565b5f5b600980549050811015610c08578173ffffffffffffffffffffffffffffffffffffffff1660098281548110610ac357610ac2611f64565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610bf55760096001600980549050610b1a9190611c17565b81548110610b2b57610b2a611f64565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660098281548110610b6757610b66611f64565b5b905f5260205f20015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506009805480610bbe57610bbd611f91565b5b600190038181905f5260205f20015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055610c08565b8080610c0090611fbe565b915050610a8b565b5050565b610c14610ee7565b826006819055508160078190555080600881905550505050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b610cb8610ee7565b80600a5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f805f90505b600980549050811015610d99578273ffffffffffffffffffffffffffffffffffffffff1660098281548110610d3957610d38611f64565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610d86576001915050610d9e565b8080610d9190611fbe565b915050610d01565b505f90505b919050565b610dab610ee7565b610db481610cfb565b610e1957600981908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b610e24610ee7565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e94575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610e8b9190611abb565b60405180910390fd5b610e9d81611151565b50565b5f33905090565b610eb48383836001611216565b505050565b5f80610ec3610ea0565b9050610ed08582856113e5565b610edb858585611477565b60019150509392505050565b610eef610ea0565b73ffffffffffffffffffffffffffffffffffffffff16610f0d6108b4565b73ffffffffffffffffffffffffffffffffffffffff1614610f6c57610f30610ea0565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610f639190611abb565b60405180910390fd5b565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610fde575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610fd59190611abb565b60405180910390fd5b610fe9825f83611567565b5050565b610ff5611577565b5f60055f6101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611037610ea0565b6040516110449190611abb565b60405180910390a1565b6110566115b7565b600160055f6101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611099610ea0565b6040516110a69190611abb565b60405180910390a1565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611120575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016111179190611abb565b60405180910390fd5b61112b5f8383611567565b5050565b5f80611139610ea0565b9050611146818585611477565b600191505092915050565b5f600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611286575f6040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161127d9190611abb565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036112f6575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016112ed9190611abb565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208190555080156113df578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516113d691906119e4565b60405180910390a35b50505050565b5f6113f08484610c2e565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146114715781811015611462578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161145993929190612005565b60405180910390fd5b61147084848484035f611216565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036114e7575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016114de9190611abb565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611557575f6040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161154e9190611abb565b60405180910390fd5b611562838383611567565b505050565b6115728383836115f8565b505050565b61157f610749565b6115b5576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6115bf610749565b156115f6576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6116006115b7565b61160b838383611610565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611660578060025f8282546116549190611ec9565b9250508190555061172e565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156116e9578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016116e093929190612005565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611775578060025f82825403925050819055506117bf565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161181c91906119e4565b60405180910390a3505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015611860578082015181840152602081019050611845565b5f8484015250505050565b5f601f19601f8301169050919050565b5f61188582611829565b61188f8185611833565b935061189f818560208601611843565b6118a88161186b565b840191505092915050565b5f6020820190508181035f8301526118cb818461187b565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611900826118d7565b9050919050565b611910816118f6565b811461191a575f80fd5b50565b5f8135905061192b81611907565b92915050565b5f819050919050565b61194381611931565b811461194d575f80fd5b50565b5f8135905061195e8161193a565b92915050565b5f806040838503121561197a576119796118d3565b5b5f6119878582860161191d565b925050602061199885828601611950565b9150509250929050565b5f8115159050919050565b6119b6816119a2565b82525050565b5f6020820190506119cf5f8301846119ad565b92915050565b6119de81611931565b82525050565b5f6020820190506119f75f8301846119d5565b92915050565b5f805f60608486031215611a1457611a136118d3565b5b5f611a218682870161191d565b9350506020611a328682870161191d565b9250506040611a4386828701611950565b9150509250925092565b5f60ff82169050919050565b611a6281611a4d565b82525050565b5f602082019050611a7b5f830184611a59565b92915050565b5f60208284031215611a9657611a956118d3565b5b5f611aa384828501611950565b91505092915050565b611ab5816118f6565b82525050565b5f602082019050611ace5f830184611aac565b92915050565b5f60208284031215611ae957611ae86118d3565b5b5f611af68482850161191d565b91505092915050565b5f805f60608486031215611b1657611b156118d3565b5b5f611b2386828701611950565b9350506020611b3486828701611950565b9250506040611b4586828701611950565b9150509250925092565b5f8060408385031215611b6557611b646118d3565b5b5f611b728582860161191d565b9250506020611b838582860161191d565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680611bd157607f821691505b602082108103611be457611be3611b8d565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611c2182611931565b9150611c2c83611931565b9250828203905081811115611c4457611c43611bea565b5b92915050565b7f72656e6f756e63654f776e6572736869702069732064697361626c65640000005f82015250565b5f611c7e601d83611833565b9150611c8982611c4a565b602082019050919050565b5f6020820190508181035f830152611cab81611c72565b9050919050565b5f611cbc82611931565b9150611cc783611931565b9250828202611cd581611931565b91508282048414831517611cec57611ceb611bea565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611d2a82611931565b9150611d3583611931565b925082611d4557611d44611cf3565b5b828204905092915050565b5f8160011c9050919050565b5f808291508390505b6001851115611da557808604811115611d8157611d80611bea565b5b6001851615611d905780820291505b8081029050611d9e85611d50565b9450611d65565b94509492505050565b5f82611dbd5760019050611e78565b81611dca575f9050611e78565b8160018114611de05760028114611dea57611e19565b6001915050611e78565b60ff841115611dfc57611dfb611bea565b5b8360020a915084821115611e1357611e12611bea565b5b50611e78565b5060208310610133831016604e8410600b8410161715611e4e5782820a905083811115611e4957611e48611bea565b5b611e78565b611e5b8484846001611d5c565b92509050818404811115611e7257611e71611bea565b5b81810290505b9392505050565b5f611e8982611931565b9150611e9483611a4d565b9250611ec17fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484611dae565b905092915050565b5f611ed382611931565b9150611ede83611931565b9250828201905080821115611ef657611ef5611bea565b5b92915050565b7f43617020657863656564656400000000000000000000000000000000000000005f82015250565b5f611f30600c83611833565b9150611f3b82611efc565b602082019050919050565b5f6020820190508181035f830152611f5d81611f24565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b5f611fc882611931565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611ffa57611ff9611bea565b5b600182019050919050565b5f6060820190506120185f830186611aac565b61202560208301856119d5565b61203260408301846119d5565b94935050505056fea26469706673582212203848b90fb913c94f239caeeb2dc23eeb81b6def40c891d242110c3efcd718ecc64736f6c63430008140033
Verified Source Code Partial Match
Compiler: v0.8.20+commit.a1b79de6
EVM: shanghai
Optimization: No
Sanaol.sol 1029 lines
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 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/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 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 ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-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 ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 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/ERC20.sol
// OpenZeppelin Contracts (last updated v5.1.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 ERC-20
* applications.
*/
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}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* 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:
*
* ```solidity
* 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/utils/Pausable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: @openzeppelin/contracts/token/ERC20/extensions/ERC20Pausable.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/ERC20Pausable.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC-20 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*
* IMPORTANT: This contract does not include public pause and unpause functions. In
* addition to inheriting this contract, you must define both functions, invoking the
* {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate
* access control, e.g. using {AccessControl} or {Ownable}. Not doing so will
* make the contract pause mechanism of the contract unreachable, and thus unusable.
*/
abstract contract ERC20Pausable is ERC20, Pausable {
/**
* @dev See {ERC20-_update}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _update(address from, address to, uint256 value) internal virtual override whenNotPaused {
super._update(from, to, value);
}
}
// File: @openzeppelin/contracts/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: contracts/SanaolTokenV3.sol
pragma solidity 0.8.20;
contract Sanaol is ERC20("SANAOL", "SANAOL"), ERC20Pausable, Ownable {
uint256 public buyFee = 2; // 2% buy fee
uint256 public sellFee = 0; // 0% sell fee
uint256 public transferFee = 0; // 0% normal transfer fee
address[] public liquidityPools; // Liquidity pool addresses
address public feeRecipient; // Address to receive the fees
constructor() Ownable(msg.sender) {
// Mint the total supply based on the cap
_mint(msg.sender, cap() * 10 ** decimals());
}
function cap() public pure returns (uint256) {
// Set cap to 8 trillion
return 8000000000000;
}
// Function to add a liquidity pool address
function addLiquidityPool(address _liquidityPool) external onlyOwner {
if (!isLiquidityPool(_liquidityPool)) {
liquidityPools.push(_liquidityPool);
}
}
// Function to remove a liquidity pool address
function removeLiquidityPool(address _liquidityPool) external onlyOwner {
for (uint256 i = 0; i < liquidityPools.length; i++) {
if (liquidityPools[i] == _liquidityPool) {
liquidityPools[i] = liquidityPools[liquidityPools.length - 1];
liquidityPools.pop();
break;
}
}
}
// Function to set the fee recipient address
function setFeeRecipient(address _feeRecipient) external onlyOwner {
feeRecipient = _feeRecipient;
}
// Function to update buy, sell, and transfer fees
function setFees(uint256 _buyFee, uint256 _sellFee, uint256 _transferFee) external onlyOwner {
buyFee = _buyFee;
sellFee = _sellFee;
transferFee = _transferFee;
}
// Helper function to check if an address is a liquidity pool
function isLiquidityPool(address addr) public view returns (bool) {
for (uint256 i = 0; i < liquidityPools.length; i++) {
if (liquidityPools[i] == addr) {
return true;
}
}
return false;
}
// Calculate the fee based on transaction type (buy, sell, or regular transfer)
function calculateFee(address from, address to, uint256 value) public view returns (uint256) {
uint256 fee;
if (isLiquidityPool(to)) {
// Selling tokens, apply sell fee
fee = (value * sellFee) / 100;
} else if (isLiquidityPool(from)) {
// Buying tokens, apply buy fee
fee = (value * buyFee) / 100;
} else {
// Regular transfer, apply transfer fee
fee = (value * transferFee) / 100;
}
return fee;
}
// Override the transfer function to include fee logic
function transfer(address to, uint256 value) public override returns (bool) {
address from = _msgSender();
uint256 fee = calculateFee(from, to, value);
// Calculate amount after fee
uint256 amountAfterFee = value - fee;
// Transfer the fee to the feeRecipient
if (fee > 0) {
super.transfer(feeRecipient, fee);
}
// Transfer tokens to recipient after fee deduction
bool success = super.transfer(to, amountAfterFee);
return success;
}
// Override the transferFrom function to include fee logic
function transferFrom(address from, address to, uint256 value) public override returns (bool) {
uint256 fee = calculateFee(from, to, value);
// Calculate amount after fee
uint256 amountAfterFee = value - fee;
// Transfer the fee to the feeRecipient
if (fee > 0) {
super.transferFrom(from, feeRecipient, fee);
}
// Transfer tokens to recipient after fee deduction
bool success = super.transferFrom(from, to, amountAfterFee);
return success;
}
// Function for owner to mint new tokens
function mint(uint256 value) external onlyOwner {
require(totalSupply() + value <= cap() * 10 ** decimals(), "Cap exceeded");
_mint(owner(), value);
}
// Function to burn tokens
function burn(uint256 value) external {
_burn(msg.sender, value);
}
// Function for owner to burn tokens
function onlyOwnerBurn(address account, uint256 value) external onlyOwner {
_burn(account, value);
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Pausable) {
super._update(from, to, value);
}
// Override the renounceOwnership function to disable it
function renounceOwnership() public pure override {
revert("renounceOwnership is disabled");
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyFee 0x47062402 → uint256
calculateFee 0x7ca87cb6 → uint256
cap 0x355274ea → uint256
decimals 0x313ce567 → uint8
feeRecipient 0x46904840 → address
isLiquidityPool 0xe85455d7 → bool
liquidityPools 0x79d747be → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
renounceOwnership 0x715018a6
sellFee 0x2b14ca56 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
transferFee 0xacb2ad6f → uint256
Write Contract 13 functions
These functions modify contract state and require a wallet transaction to execute.
addLiquidityPool 0xee6a934c
address _liquidityPool
approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x42966c68
uint256 value
mint 0xa0712d68
uint256 value
onlyOwnerBurn 0x30f1f67c
address account
uint256 value
pause 0x8456cb59
No parameters
removeLiquidityPool 0xae22107f
address _liquidityPool
setFeeRecipient 0xe74b981b
address _feeRecipient
setFees 0xcec10c11
uint256 _buyFee
uint256 _sellFee
uint256 _transferFee
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address