Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xb0BA9217b1B0C4D63C3a6cc0b08c8264BA367fC7
Balance 0 ETH
Nonce 1
Code Size 5094 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5094 bytes
0x608060405234801561001057600080fd5b506004361061025c5760003560e01c8063715018a611610145578063a1883d26116100bd578063e5ed3d4e1161008c578063f082499f11610071578063f082499f14610579578063f2fde38b1461058c578063f48be82c1461059f57600080fd5b8063e5ed3d4e14610542578063ee3b0d621461055657600080fd5b8063a1883d26146104d0578063a9059cbb146104e3578063b7bda68f146104f6578063dd62ed3e1461050957600080fd5b80638da5cb5b11610114578063942f1a16116100f9578063942f1a161461049c57806395d89b41146104bf578063a071dcf4146104c757600080fd5b80638da5cb5b1461047357806390ed534d1461048957600080fd5b8063715018a61461044557806379cc67901461044d5780637dfcbe3414610460578063893d20e81461047357600080fd5b806334045664116101d85780634838d165116101a75780635c975abb1161018c5780635c975abb146103fe57806368092bd91461040957806370a082311461041c57600080fd5b80634838d165146103b05780634dacf3f5146103d357600080fd5b8063340456641461035c578063378dc3dc146103715780633b78b9e91461037a57806342966c681461039d57600080fd5b806318160ddd1161022f578063298bb0f911610214578063298bb0f9146103125780632e0f26251461033e578063313ce5671461034d57600080fd5b806318160ddd146102ed57806323b872dd146102ff57600080fd5b80630609cbca1461026157806306fdde031461029957806307184e17146102ae578063095ea7b3146102da575b600080fd5b61028461026f36600461117c565b60096020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b6102a16105a7565b604051610290919061119e565b6102846102bc36600461117c565b6001600160a01b031660009081526007602052604090205460ff1690565b6102846102e83660046111ed565b610639565b6002545b604051908152602001610290565b61028461030d366004611217565b610653565b61028461032036600461117c565b6001600160a01b031660009081526009602052604090205460ff1690565b6102f1670de0b6b3a764000081565b60405160128152602001610290565b61036f61036a366004611261565b610677565b005b6102f1600b5481565b61028461038836600461117c565b600a6020526000908152604090205460ff1681565b61036f6103ab366004611298565b6106aa565b6102846103be36600461117c565b600e6020526000908152604090205460ff1681565b6008546103e6906001600160a01b031681565b6040516001600160a01b039091168152602001610290565b60055460ff16610284565b61036f610417366004611261565b6106b7565b6102f161042a36600461117c565b6001600160a01b031660009081526020819052604090205490565b61036f6106ea565b61036f61045b3660046111ed565b6106fe565b6006546103e6906001600160a01b031681565b60055461010090046001600160a01b03166103e6565b61036f61049736600461117c565b610717565b6102846104aa36600461117c565b600f6020526000908152604090205460ff1681565b6102a1610740565b6102f1600c5481565b61036f6104de36600461117c565b61074f565b6102846104f13660046111ed565b6107a9565b600d546103e6906001600160a01b031681565b6102f16105173660046112b1565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600d5461028490600160a01b900460ff1681565b61028461056436600461117c565b60076020526000908152604090205460ff1681565b61036f61058736600461117c565b6107b7565b61036f61059a36600461117c565b6107e0565b61036f610839565b6060600380546105b6906112e4565b80601f01602080910402602001604051908101604052809291908181526020018280546105e2906112e4565b801561062f5780601f106106045761010080835404028352916020019161062f565b820191906000526020600020905b81548152906001019060200180831161061257829003601f168201915b5050505050905090565b60003361064781858561086b565b60019150505b92915050565b60003361066185828561087d565b61066c858585610914565b506001949350505050565b61067f61098c565b6001600160a01b03919091166000908152600f60205260409020805460ff1916911515919091179055565b6106b433826109d8565b50565b6106bf61098c565b6001600160a01b03919091166000908152600e60205260409020805460ff1916911515919091179055565b6106f261098c565b6106fc6000610a0e565b565b61070982338361087d565b61071382826109d8565b5050565b61071f61098c565b6001600160a01b03166000908152600960205260409020805460ff19169055565b6060600480546105b6906112e4565b61075761098c565b600d80546001600160a01b039092167fffffffffffffffffffffffff0000000000000000000000000000000000000000909216821790556000908152600f60205260409020805460ff19166001179055565b600033610647818585610914565b6107bf61098c565b6001600160a01b03166000908152600760205260409020805460ff19169055565b6107e861098c565b6001600160a01b038116610830576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b6106b481610a0e565b61084161098c565b600d80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6108788383836001610a7f565b505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461090e57818110156108ff576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610827565b61090e84848484036000610a7f565b50505050565b6001600160a01b03831661093e57604051634b637e8f60e11b815260006004820152602401610827565b6001600160a01b038216610981576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610827565b610878838383610b86565b6005546001600160a01b036101009091041633146106fc576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610827565b6001600160a01b038216610a0257604051634b637e8f60e11b815260006004820152602401610827565b61071382600083610b86565b600580546001600160a01b038381166101008181027fffffffffffffffffffffff0000000000000000000000000000000000000000ff85161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038416610ac2576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610827565b6001600160a01b038316610b05576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610827565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561090e57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610b7891815260200190565b60405180910390a350505050565b610b8e610f19565b6001600160a01b038316600090815260076020526040902054839060ff16610c70576006546040517fd406b88a0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301529091169063d406b88a906024016020604051808303816000875af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c39919061131e565b15610c70576040517fe6a6c0d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383166000908152600960205260409020548390839060ff16158015610cad5750336000908152600a602052604090205460ff16155b15610d79576008546040517f8450f8a30000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301526024820184905290911690638450f8a3906044016020604051808303816000875af1158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d42919061131e565b15610d79576040517f379d580100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d8285610f56565b610d8b86610fd2565b600d54600160a01b900460ff1615610e1f576001600160a01b0386166000908152600f602052604090205460ff16610e1f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f41697264726f70206d6f646520697320656e61626c65640000000000000000006044820152606401610827565b6001600160a01b0386166000908152600e602052604090205460ff1615610e645760405163d33f19e760e01b81526001600160a01b0387166004820152602401610827565b6001600160a01b0385166000908152600e602052604090205460ff1615610ea95760405163d33f19e760e01b81526001600160a01b0386166004820152602401610827565b6001600160a01b0386166000908152600f602052604081205460ff16610efc57600c54610ed7606487611351565b610ee19190611373565b600d54909150610efc9088906001600160a01b03168361101d565b610f108787610f0b848961138a565b61101d565b50505050505050565b60055460ff16156106fc576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006546040517fa571c0d10000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301529091169063a571c0d1906024015b600060405180830381600087803b158015610fb757600080fd5b505af1158015610fcb573d6000803e3d6000fd5b5050505050565b6008546040517f45f0e0f00000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152909116906345f0e0f090602401610f9d565b6001600160a01b03831661104857806002600082825461103d919061139d565b909155506110d39050565b6001600160a01b038316600090815260208190526040902054818110156110b4576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610827565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166110ef5760028054829003905561110e565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161115391815260200190565b60405180910390a3505050565b80356001600160a01b038116811461117757600080fd5b919050565b60006020828403121561118e57600080fd5b61119782611160565b9392505050565b60006020808352835180602085015260005b818110156111cc578581018301518582016040015282016111b0565b506000604082860101526040601f19601f8301168501019250505092915050565b6000806040838503121561120057600080fd5b61120983611160565b946020939093013593505050565b60008060006060848603121561122c57600080fd5b61123584611160565b925061124360208501611160565b9150604084013590509250925092565b80151581146106b457600080fd5b6000806040838503121561127457600080fd5b61127d83611160565b9150602083013561128d81611253565b809150509250929050565b6000602082840312156112aa57600080fd5b5035919050565b600080604083850312156112c457600080fd5b6112cd83611160565b91506112db60208401611160565b90509250929050565b600181811c908216806112f857607f821691505b60208210810361131857634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561133057600080fd5b815161119781611253565b634e487b7160e01b600052601160045260246000fd5b60008261136e57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761064d5761064d61133b565b8181038181111561064d5761064d61133b565b8082018082111561064d5761064d61133b56fea264697066735822122028e033bc102f34281efca5c3b7c3708963ea6aaf145e41b1f305cd70df8b999064736f6c63430008180033

Verified Source Code Full Match

Compiler: v0.8.24+commit.e11b9ed9 EVM: paris Optimization: Yes (1000 runs)
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.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);
    }
}
draft-IERC6093.sol 161 lines
// SPDX-License-Identifier: MIT
// 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);
}
ERC20.sol 312 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.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 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);
            }
        }
    }
}
ERC20Burnable.sol 39 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.20;

import {ERC20} from "../ERC20.sol";
import {Context} from "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys a `value` amount of tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 value) public virtual {
        _burn(_msgSender(), value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, deducting from
     * the caller's allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `value`.
     */
    function burnFrom(address account, uint256 value) public virtual {
        _spendAllowance(account, _msgSender(), value);
        _burn(account, value);
    }
}
IERC20Metadata.sol 26 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @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);
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// 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);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// 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;
    }
}
Pausable.sol 119 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @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());
    }
}
IERC20AntiBot.sol 56 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
/*
 * IERC20AntiBot interface
 */
/// @title ERC20AntiBot
/// @author Smithii

interface IERC20AntiBot {
    struct Options {
        bool applied;
        bool active;
    }
    /// errors
    error TokenNotActiveOnAntiBot();
    error TokenAlreadyActiveOnAntiBot();
    ///
    /// @param _from the address to check
    function isBotDetected(address _from) external returns (bool);
    /// Registers the block number of the receiver
    /// @param _to the address to register
    function registerBlock(address _to) external;
    /// Registers and pay for a token address to use the Antibot
    /// @param projectId the project id
    /// @param _tokenAddress the address to register
    function setCanUseAntiBot(
        bytes32 projectId,
        address _tokenAddress
    ) external payable;
    /// Set the exempt status of a trader
    /// @param _tokenAddress the token address
    /// @param _traderAddress the trader address
    /// @param _exempt the exempt status
    function setExempt(
        address _tokenAddress,
        address _traderAddress,
        bool _exempt
    ) external;
    /// helper function to check if the trader is exempt
    /// @param _tokenAddress the token address
    /// @param _traderAddress the trader address
    function isExempt(
        address _tokenAddress,
        address _traderAddress
    ) external returns (bool);
    ///
    /// @param _tokenAddress the token address
    /// @param _active the active oft he options to be applied
    function setActive(address _tokenAddress, bool _active) external;
    /// Check if the token address is active to use the Antibot
    /// @param _tokenAddress the address to check
    function isActive(address _tokenAddress) external returns (bool);
    /// Get if the token address can use the Antibot
    /// @param _tokenAddress the address to check
    function canUse(address _tokenAddress) external returns (bool);
}
IERC20AntiWhale.sol 95 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
/*
 * IERC20AntiWhale interface
 */
/// @title IERC20AntiWhale
/// @author Smithii

interface IERC20AntiWhale {
    struct Options {
        uint256 maxAmountPerTrade;
        uint256 maxAmountTotal; /// require to get the traders balance
        uint256 timeLimitPerTrade;
        uint256 activePeriod;
        uint256 activePeriodStarted;
        bool active;
    }
    /// errors
    error TokenNotActiveOnAntiWhale();
    error TokenAlreadyActiveOnAntiWhale();
    ///
    /// @param _to the address to check
    /// @param _amount the amount to check
    function isWhaleDetected(
        address _to,
        uint256 _amount
    ) external returns (bool);
    ///
    /// @param _to the address to register
    function registerBlockTimeStamp(address _to) external;
    ///
    /// @param projectId the project id
    /// @param _address the token address to register
    /// @param _options the options as Options struct
    function setCanUseAntiWhale(
        bytes32 projectId,
        address _address,
        Options memory _options
    ) external payable;
    ///
    /// @param _address the token address
    /// @param _maxAmountPerTrade the maximum amount per trade
    function setMaxAmountPerTrade(
        address _address,
        uint256 _maxAmountPerTrade
    ) external;
    ///
    /// @param _address the token address
    /// @param _maxAmountTotal the maximum amount total accumulated by the trader
    function setMaxAmountTotal(
        address _address,
        uint256 _maxAmountTotal
    ) external;
    ///
    /// @param _address the token address
    /// @param _timeLimitPerTrade the time limit per trade
    function setTimeLimitPerTrade(
        address _address,
        uint256 _timeLimitPerTrade
    ) external;
    ///
    /// @param _tokenAddress the token address
    /// @param _activePeriod the active period of the options to be applied
    function setActivePeriod(
        address _tokenAddress,
        uint256 _activePeriod
    ) external;
    /// Set the exempt status of a trader
    /// @param _tokenAddress the token address
    /// @param _traderAddress the trader address
    /// @param _exempt the exempt status
    function setExempt(
        address _tokenAddress,
        address _traderAddress,
        bool _exempt
    ) external;
    /// Helper function to check if the trader is exempt
    /// @param _tokenAddress the token address
    /// @param _traderAddress the trader address
    function isExempt(
        address _tokenAddress,
        address _traderAddress
    ) external returns (bool);
    /// Set the active status of the token address
    /// @param _tokenAddress the token address
    function isActive(address _tokenAddress) external returns (bool);
    /// Get if the token address can use the AntiWhale
    /// @param _tokenAddress the address to check
    function canUse(address _tokenAddress) external returns (bool);
    /// Get the options of the token address
    /// @param _tokenAddress the address to check
    function getOptions(
        address _tokenAddress
    ) external returns (Options memory);
}
ERC20Template.sol 184 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

/*

                                                                                                    
                    &&&&&& &&&&&                                        &%                          
                     &&&&&&&&&&&&&&&                               && &&&&&&&&&&%                   
                     &&&&&&&      &&&&&                          #&&&&&&&&&&&&&                     
                     &&&&&  &&&&&&&   &&                      &&&&    &%  &&&&&&&                   
                        &&. &&&&&&&&&&                        &  %&&&&&&&  &&&&                     
                        &&&&  *&&&&&&&&&                       &&&&&&&&&  &&&&                      
                           .&&&   &&&&&&&&                   &&&&&&&&   &&&                         
                                    .&&&&&&&               &&&&&&&   &&&%                           
                                       &&&&&&             &&&&&&                                    
                                         &&&&&          /&&&&.                                      
                                           &&&&  %&&&  #&&&,                                        
                                   &&&&(     &&&&&&&&&&&&&                                          
                               &&&&&&&&&&&&&&&&&&&&&&&&&&&&   &&&&&&&&&&                            
                             &&&%        &&&&&&&&&&&&&&&&&&&&&&&&&     &&&                          
                            &&&    &&&*    &&&&&&&&&&&&&&&&&&&&&         &&*                        
                           &&&   .&&&&&&   &&&&&&&&&&&&&&&&&&&&   &&&&&   &&                        
                           &&&   #&&&&&&   &&&&&&&&&&&&&&&&&&&&&  &&&&&   &&                        
                            &&&    &&&&    &&&&&&&&&&&&&&&&&&&&&&  #&&   &&&                        
                             &&&         &&&&&&&&&&&&&&&&&&&&&&&&,     *&&&                         
                              (&&&&&&&&&&&&&&&&&&&&          &&&&&&&&&&&%                           
                                  &&&&&&&&&&&&&&&&&          &&&&&                                  
                                    &&&&&&&&&&&&&&&&&&    %&&&&&&&                                  
                                    &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#                                 
                                      &&&&&&&&&&&&&&&&&&&&&&&&&&&&                                  
                                           &&&&&&&&&&&&&&&&&&&&                                     

*/
/**
 * ERC20Template contract
 */

/// @author Smithii

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Secured} from "../../utils/Secured.sol";
import {Shallowed} from "../../utils/Shallowed.sol";

contract ERC20Template is
    ERC20,
    ERC20Burnable,
    Pausable,
    Ownable,
    Secured,
    Shallowed
{
    uint256 public constant DECIMALS = 1 * 10 ** 18;
    uint256 public initialSupply = 0;
    uint256 public taxFee = 0; // 0 - 100 % tax fee
    address public taxAddress = address(0);
    bool public isAirdrop = false;

    mapping(address => bool) public blackList;
    mapping(address => bool) public noTaxable;

    /// Errors

    error InvalidInitialSupply();
    error InvalidTaxFee();
    error BlacklistedAddress(address _address);

    constructor(
        string memory name,
        string memory symbol,
        address _owner,
        address _taxAddress,
        address _antiBot,
        address _antiWhale,
        uint256 _initialSupply,
        uint256 _taxFee,
        bool _isAirdrop,
        address[] memory globalExemptions,
        address[] memory globalSenderExemptions 
    )
        ERC20(name, symbol)
        Ownable(_owner)
        Secured(_antiBot)
        Shallowed(_antiWhale)
    {
        if (_initialSupply <= 0) revert InvalidInitialSupply();
        if (_taxFee > 20) revert InvalidTaxFee();

        initialSupply = _initialSupply * DECIMALS;
        taxFee = _taxFee;
        taxAddress = _taxAddress;
        noTaxable[_owner] = true;
        noTaxable[address(0)] = true;
        if (_isAirdrop) isAirdrop = true;
        ///@dev contracts from smithii that need to be removed from the tax,Antibot and Antiwhale
        for(uint i = 0; i < globalExemptions.length; i++) {
            noTaxable[globalExemptions[i]] = true;
        }
        _setAntiBotExemptions(globalExemptions);
        _setAntiWhaleExemptions(globalExemptions);
        _setAntiWhaleSenderExemptions(globalSenderExemptions);
        _mint(_owner, initialSupply);
    }
    /// Exclude the address from the tax
    /// @param _address the target address
    /// @param _taxable is the address not taxable
    function setNotTaxable(address _address, bool _taxable) external onlyOwner {
        noTaxable[_address] = _taxable;
    }
    /// BLacklist the address
    /// @param _address the target address
    /// @param _blackList is in the black list
    function setBlackList(
        address _address,
        bool _blackList
    ) external onlyOwner {
        blackList[_address] = _blackList;
    }
    /// Address to receive the tax
    /// @param _taxAddress the address to receive the tax
    function setTaxAddress(address _taxAddress) external onlyOwner {
        taxAddress = _taxAddress;
        noTaxable[_taxAddress] = true;
    }
    /// relesae the airdrop mode
    /// @dev set the airdrop mode to false only once
    function releaseAirdropMode() external onlyOwner {
        isAirdrop = false;
    }
    /// release the global exemption
    /// @param _address the address to set as global exemption
    function releaseAntibotGlobalExemption(address _address) external onlyOwner {
        antiBotExemptions[_address] = false;
    }
    /// release the global exemption
    /// @param _address the address to set as global exemption
    function releaseAntiwhaleGlobalExemption(address _address) external onlyOwner {
        antiWhaleExemptions[_address] = false;
    }
    /// get the global exemption status
    /// @param _address the address to check
    function isAntibotGlobalExemption(address _address) external view returns(bool) {
        return antiBotExemptions[_address];
    }
    /// get the global exemption status
    /// @param _address the address to check
    function isAntiwhaleGlobalExemption(address _address) external view returns(bool) {
        return antiWhaleExemptions[_address];
    }
    /// @inheritdoc ERC20
    function _update(
        address sender,
        address recipient,
        uint256 amount
    )
        internal
        virtual
        override
        whenNotPaused
        noBots(sender)
        noWhales(recipient, amount)
    {
        registerBlock(recipient);
        registerBlockTimeStamp(sender);
        if (isAirdrop) {
            if (!noTaxable[sender]) revert("Airdrop mode is enabled");
        }
        /// @dev the tx is charged based on the sender
        if (blackList[sender]) revert BlacklistedAddress(sender);
        if (blackList[recipient]) revert BlacklistedAddress(recipient);
        uint tax = 0;
        if (!noTaxable[sender]) {
            tax = (amount / 100) * taxFee; // % tax
            super._update(sender, taxAddress, tax);
        }
        super._update(sender, recipient, amount - tax);
    }
    /// BEP compatible
    function getOwner() external view returns (address) {
        return owner();
    }
}
Secured.sol 36 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

/// @title Secured
/// @author Smithii

import {IERC20AntiBot} from "../interfaces/services/IERC20AntiBot.sol";

/// errors
error BotDetected();

abstract contract Secured {
    address public antiBot = address(0);
    mapping(address => bool) public antiBotExemptions;
    constructor(address _antiBot) {
        antiBot = _antiBot;
    }
    modifier noBots(address _from) {
        if (!antiBotExemptions[_from]) {
           if (IERC20AntiBot(antiBot).isBotDetected(_from)) revert BotDetected();
        }
        _;
    }
    /// Registers the block number of the receiver
    /// @param _to the address to register
    function registerBlock(address _to) internal {
        IERC20AntiBot(antiBot).registerBlock(_to);
    }
    /// globally sets the exemptions
    /// @param _exemptions the addresses to set as exemptions
    function _setAntiBotExemptions(address[] memory _exemptions) internal {
        for (uint256 i = 0; i < _exemptions.length; i++) {
            antiBotExemptions[_exemptions[i]] = true;
        }
    }
}
Shallowed.sol 45 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;

/// @title Whale Detector
/// @author Smithii

import {IERC20AntiWhale} from "../interfaces/services/IERC20AntiWhale.sol";

/// errors
error WhaleDetected();

abstract contract Shallowed {
    address public antiWhale = address(0);
    mapping(address => bool) public antiWhaleExemptions;
    mapping(address => bool) public antiWhaleSenderExemptions;
    constructor(address _antiWhale) {
        antiWhale = _antiWhale;
    }
    modifier noWhales(address _to, uint256 _amount) {
        if (!antiWhaleExemptions[_to] && !antiWhaleSenderExemptions[msg.sender]) {
           if (IERC20AntiWhale(antiWhale).isWhaleDetected(_to, _amount))
            revert WhaleDetected();
        }
        _;
    }
    /// Registers the block number of the receiver
    /// @param _to the address to register
    function registerBlockTimeStamp(address _to) internal {
        IERC20AntiWhale(antiWhale).registerBlockTimeStamp(_to);
    }
    /// globally sets the exemptions
    /// @param _exemptions the addresses to set as exemptions
    function _setAntiWhaleExemptions(address[] memory _exemptions) internal {
        for (uint256 i = 0; i < _exemptions.length; i++) {
            antiWhaleExemptions[_exemptions[i]] = true;
        }
    }
    /// globally sets the exemptions
    /// @param _exemptions the addresses to set as exemptions
    function _setAntiWhaleSenderExemptions(address[] memory _exemptions) internal {
        for (uint256 i = 0; i < _exemptions.length; i++) {
            antiWhaleSenderExemptions[_exemptions[i]] = true;
        }
    }
}

Read Contract

DECIMALS 0x2e0f2625 → uint256
allowance 0xdd62ed3e → uint256
antiBot 0x7dfcbe34 → address
antiBotExemptions 0xee3b0d62 → bool
antiWhale 0x4dacf3f5 → address
antiWhaleExemptions 0x0609cbca → bool
antiWhaleSenderExemptions 0x3b78b9e9 → bool
balanceOf 0x70a08231 → uint256
blackList 0x4838d165 → bool
decimals 0x313ce567 → uint8
getOwner 0x893d20e8 → address
initialSupply 0x378dc3dc → uint256
isAirdrop 0xe5ed3d4e → bool
isAntibotGlobalExemption 0x07184e17 → bool
isAntiwhaleGlobalExemption 0x298bb0f9 → bool
name 0x06fdde03 → string
noTaxable 0x942f1a16 → bool
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
taxAddress 0xb7bda68f → address
taxFee 0xa071dcf4 → uint256
totalSupply 0x18160ddd → uint256

Write Contract 13 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x42966c68
uint256 value
burnFrom 0x79cc6790
address account
uint256 value
releaseAirdropMode 0xf48be82c
No parameters
releaseAntibotGlobalExemption 0xf082499f
address _address
releaseAntiwhaleGlobalExemption 0x90ed534d
address _address
renounceOwnership 0x715018a6
No parameters
setBlackList 0x68092bd9
address _address
bool _blackList
setNotTaxable 0x34045664
address _address
bool _taxable
setTaxAddress 0xa1883d26
address _taxAddress
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner

Token Balances (1)

View Transfers →
USDT 0

Recent Transactions

No transactions found for this address