Contract Address Details

0xb90a713d8dAC53686Eb482A66adc205532eaD9f8

Contract Name
Token
Creator
0x111b0f–57375f at 0x9ed227–98fcdc
Balance
0 NOVA
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
195562
Contract name:
Token




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
1000
Verified at
2023-04-10T02:17:19.731695Z

contracts/Token.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IToken.sol";

/// @title Token template
/// @notice This contract is an ERC20 template, have to call initialize to setup name and symbol
contract Token is IToken, ERC20, ERC20Burnable, Ownable {
    string private _name;
    string private _symbol;

    bool private _initialized;

    constructor() ERC20("", "") {}

    /// Initialize the token
    /// @param name_ Name of the token
    /// @param symbol_ Symbol of the token
    function initialize(string memory name_, string memory symbol_) external {
        require(!_initialized, "token: Already initialized");

        // set as initialized
        _initialized = true;

        // set parameters
        _name = name_;
        _symbol = symbol_;

        // transfer token ownership
        _transferOwnership(msg.sender);
    }

    /// Mint tokens to target address, caller must be **owner**
    /// @param to_ Target address
    /// @param amount_ Amount of token to be minted
    function mint(address to_, uint256 amount_) public onlyOwner {
        _mint(to_, amount_);
    }

    /// Return name of the token
    function name() public view override returns (string memory) {
        return _name;
    }

    /// Return symbol of the token
    function symbol() public view override returns (string memory) {
        return _symbol;
    }
}
        

contracts/IToken.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IToken is IERC20 {
    function initialize(string memory name_, string memory symbol_) external;

    function mint(address to_, uint256 amount_) external;
}
          

contracts/TokenCtrl.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";
import "./utils/EIP712Custom.sol";
import "./utils/DeployTokenHasher.sol";
import "./utils/MintTokenHasher.sol";
import "./IToken.sol";

/// @title Token Controller, mint and manage Token
contract TokenCtrl is
    Ownable2Step,
    EIP712Custom,
    DeployTokenHasher,
    MintTokenHasher
{
    using Counters for Counters.Counter;

    // properties
    // token symbol to address mapping
    mapping(bytes32 => address) public tokens;
    // token nonces
    mapping(bytes32 => Counters.Counter) private _nonces;
    // token lists
    bytes32[] public tokenLists;
    // authorities
    mapping(address => bool) public authorities;
    // token template
    address public tokenTemplate;

    // events
    event DeployToken(
        address indexed tokenAddress,
        address indexed authority,
        address sender,
        bytes32 symbol
    );

    event MintToken(
        address indexed tokenAddress,
        address indexed authority,
        address indexed destination,
        uint256 amount,
        address sender,
        bytes32 symbol
    );

    event ChangeTokenAuthority(
        address indexed tokenAddress,
        address indexed newAuthority,
        address sender,
        bytes32 symbol
    );

    event EnlistToken(
        address indexed tokenAddress,
        address sender,
        bytes32 symbol
    );

    event DelistToken(
        address indexed tokenAddress,
        address sender,
        bytes32 symbol
    );

    event SetAuthority(
        address indexed authority,
        address sender,
        bool isAuthority
    );

    event SetTokenTemplate(
        address indexed tokenTemplate,
        address indexed previousTokenTemplate,
        address sender
    );

    constructor(
        address authority_,
        address tokenTemplate_
    ) EIP712Custom("TokenCtrl", "1") {
        //  set authority
        _setAuthority(authority_);

        // set token Template address
        _setTokenTemplate(tokenTemplate_);
    }

    // external functions

    /// Deploy new Token with EIP-712 signature, signer must be **authority**
    /// @param params_ DeployTokenParams of token to be deployed
    /// @param v_ V value of a signature
    /// @param r_ R value of a signature
    /// @param s_ S value of a signature
    function deployToken(
        DeployTokenParam calldata params_,
        uint8 v_,
        bytes32 r_,
        bytes32 s_
    ) external {
        // verify deadline
        require(
            block.timestamp <= params_.deadline,
            "DEPLOY_TOKEN: expired deadline"
        );

        bytes32 symbol32 = _stringToBytes32(params_.symbol);
        // token must not be already deployed
        require(
            _getTokenAddress(symbol32) == address(0),
            "DEPLOY_TOKEN: token already deployed"
        );

        // find parameters by chainId
        EvmDeployToken memory dt;
        for (uint256 i = 0; i < params_.deployTokens.length; i++) {
            if (params_.deployTokens[i].chainId == block.chainid) {
                dt = params_.deployTokens[i];
            }
        }
        require(dt.chainId != 0, "DEPLOY_TOKEN: chain id not match");

        // verify contract address
        require(
            dt.contractAddress == address(this),
            "DEPLOY_TOKEN: mismatch contract address"
        );

        // check nonce, to prevent replay attack
        require(
            dt.nonce == _useNonces(symbol32),
            "DEPLOY_TOKEN: invalid nonce"
        );

        // verify signer of the signature
        bytes32 structHash = _hashDeployTokenStruct(params_);
        address signer = _recoverSigner(structHash, v_, r_, s_);
        require(authorities[signer], "DEPLOY_TOKEN: unauthorized");

        // deploy token
        address tokenAddress = _doDeployToken(params_.name, params_.symbol);
        _registerToken(symbol32, tokenAddress);

        // emit event
        emit DeployToken(tokenAddress, signer, _msgSender(), symbol32);
    }

    /// Mint Tokens with EIP-712 signature, signer must be **authority**
    /// @param params_ MintTokenParams of token to be minted
    /// @param v_ V value of a signature
    /// @param r_ R value of a signature
    /// @param s_ S value of a signature
    function mintToken(
        MintTokenParams calldata params_,
        uint8 v_,
        bytes32 r_,
        bytes32 s_
    ) external {
        // verify deadline
        require(
            block.timestamp <= params_.deadline,
            "MINT_TOKEN: expired deadline"
        );

        bytes32 symbol32 = _stringToBytes32(params_.symbol);
        require(
            _getTokenAddress(symbol32) != address(0),
            "MINT_TOKEN: token not found"
        );

        // find parameters by chainId
        EvmMintDestination memory dt;
        for (uint256 i = 0; i < params_.destinations.length; i++) {
            if (params_.destinations[i].chainId == block.chainid) {
                dt = params_.destinations[i];
            }
        }
        require(dt.chainId != 0, "MINT_TOKEN: chain id not match");

        // verify contract address
        require(
            dt.contractAddress == address(this),
            "MINT_TOKEN: mismatch contract address"
        );

        // verify token nonce, to prevent replay attack
        require(dt.nonce == _useNonces(symbol32), "MINT_TOKEN: invalid nonce");

        // verify signer of the signature
        bytes32 structHash = _hashMintTokenStruct(params_);
        address signer = _recoverSigner(structHash, v_, r_, s_);
        require(authorities[signer], "MINT_TOKEN: unauthorized");

        // mint token
        address tokenAddress = _doMintToken(
            params_.symbol,
            signer,
            params_.amount
        );

        // emit event
        emit MintToken(
            tokenAddress,
            signer,
            signer,
            params_.amount,
            _msgSender(),
            symbol32
        );
    }

    /// Change token authority, caller must be **owner**
    /// @param symbol_ Symbol of the token
    /// @param newAuthority_ New authority to be assgined to
    function changeTokenAuthority(
        string calldata symbol_,
        address newAuthority_
    ) external onlyOwner {
        // authoriy address must not empty
        require(
            newAuthority_ != address(0),
            "CHANGE_TOKEN_AUTHORITY: authority is empty"
        );

        bytes32 symbol32 = _stringToBytes32(symbol_);
        address tokenAddress = _getTokenAddress(symbol32);
        // verify token symbol exists
        require(
            tokenAddress != address(0),
            "CHANGE_TOKEN_AUTHORITY: token not found"
        );

        // bump token nonce
        _useNonces(symbol32);

        // change token authority
        _doChangeTokenAuthority(tokenAddress, newAuthority_);

        // emit event
        emit ChangeTokenAuthority(
            tokenAddress,
            newAuthority_,
            _msgSender(),
            symbol32
        );
    }

    /// Enlist token deployed from other controller, caller must be **owner*
    /// @param symbol_ Symbol of the token
    /// @param tokenAddress_ Token address to be added
    /// @dev token's ownership must be transfered before enlisting the token
    function enlistToken(
        string calldata symbol_,
        address tokenAddress_
    ) external onlyOwner {
        bytes32 symbol32 = _stringToBytes32(symbol_);
        // verify token symbol exists
        require(
            tokens[symbol32] == address(0),
            "ENLIST_TOKEN: token already exists"
        );

        // token address must not be empty
        require(tokenAddress_ != address(0), "ENLIST_TOKEN: address is empty");

        // token owner must be this controller
        require(
            Ownable(tokenAddress_).owner() == address(this),
            "ENLIST_TOKEN: token is not owned by the controller"
        );

        // bump token nonce
        _useNonces(symbol32);

        // register token
        _registerToken(symbol32, tokenAddress_);

        emit EnlistToken(tokenAddress_, _msgSender(), symbol32);
    }

    /// Delist token from the controller, caller must be **owner*
    /// @param symbol_ Symbol of the token
    function delistToken(string calldata symbol_) external onlyOwner {
        bytes32 symbol32 = _stringToBytes32(symbol_);
        address tokenAddress = tokens[symbol32];
        require(tokenAddress != address(0), "DELIST_TOKEN: token not found");

        // bump token nonce
        _useNonces(symbol32);

        // unregister token
        _unregisterToken(symbol32);

        emit DelistToken(tokenAddress, _msgSender(), symbol32);
    }

    /// Set authority address of this controller, caller must be **owner**
    /// @param authority_ New authority
    function setAuthority(address authority_) external onlyOwner {
        _setAuthority(authority_);
    }

    /// Remove authority address from this controller, caller must be **owner**
    /// @param authority_ Authority to be removed
    function removeAuthority(address authority_) external onlyOwner {
        require(authorities[authority_], "REMOVE_AUTHORITY: not authority");
        authorities[authority_] = false;

        emit SetAuthority(authority_, _msgSender(), false);
    }

    /// Set token token template, caller must be **owner**
    /// @param tokenTemplate_ Address of token template
    function setTokenTemplate(address tokenTemplate_) external onlyOwner {
        _setTokenTemplate(tokenTemplate_);
    }

    /// Get token address by symbol
    /// @param symbol_ Symbol of the token
    function getTokenAddress(
        string memory symbol_
    ) external view returns (address) {
        bytes32 symbol32 = _stringToBytes32(symbol_);
        return _getTokenAddress(symbol32);
    }

    /// Get current token nonce by symbol
    /// @param symbol_ Symbol of the token
    function getNonces(string memory symbol_) external view returns (uint256) {
        bytes32 symbol32 = _stringToBytes32(symbol_);
        return _nonces[symbol32].current();
    }

    /// Get symbol of token registered with this controller
    function getTokenLists() external view returns (bytes32[] memory) {
        return tokenLists;
    }

    // private functions
    function _getTokenAddress(
        bytes32 symbol32_
    ) private view returns (address) {
        return tokens[symbol32_];
    }

    function _doDeployToken(
        string memory name_,
        string memory symbol_
    ) private returns (address) {
        IToken token = IToken(Clones.clone(tokenTemplate));
        token.initialize(name_, symbol_);

        return address(token);
    }

    function _registerToken(bytes32 symbol32_, address tokenAddress_) private {
        tokens[symbol32_] = tokenAddress_;
        tokenLists.push(symbol32_);
    }

    function _unregisterToken(bytes32 symbol32_) private {
        delete tokens[symbol32_];
        // intentional not to clear nonce, as it may lead to replay attack

        uint256 len = tokenLists.length;
        if (
            (len == 1 && tokenLists[0] == symbol32_) ||
            tokenLists[len - 1] == symbol32_
        ) {
            // one item and matches
            // or being last item
            tokenLists.pop();
        } else {
            // find item index
            for (uint i = 0; i < len - 1; i++) {
                if (tokenLists[i] == symbol32_) {
                    // swap item from last index
                    tokenLists[i] = tokenLists[len - 1];
                    break;
                }
            }
            tokenLists.pop();
        }
    }

    function _doMintToken(
        string memory symbol_,
        address destination_,
        uint256 amount_
    ) private returns (address _token) {
        _token = this.getTokenAddress(symbol_);

        IToken(_token).mint(destination_, amount_);
    }

    function _doChangeTokenAuthority(
        address tokenAddress_,
        address authority_
    ) private {
        Ownable(tokenAddress_).transferOwnership(authority_);
    }

    function _useNonces(bytes32 symbol32_) private returns (uint256 _current) {
        Counters.Counter storage nonce = _nonces[symbol32_];
        _current = nonce.current();
        nonce.increment();
    }

    function _setAuthority(address authority_) private {
        require(authority_ != address(0), "SET_AUTHORITY: authority is empty");
        require(
            !authorities[authority_],
            "SET_AUTHORITY: already be authority"
        );
        authorities[authority_] = true;

        emit SetAuthority(authority_, _msgSender(), true);
    }

    function _setTokenTemplate(address tokenTemplate_) private {
        require(
            tokenTemplate_ != address(0),
            "SET_TOKEN_TEMPLATE: token template is zero"
        );

        address previousTokenTemplate = tokenTemplate;
        tokenTemplate = tokenTemplate_;

        emit SetTokenTemplate(
            tokenTemplate_,
            previousTokenTemplate,
            _msgSender()
        );
    }

    // utilities funcitons
    function _stringToBytes32(
        string memory source_
    ) private pure returns (bytes32 result_) {
        bytes memory tempEmptyStringTest = bytes(source_);
        if (tempEmptyStringTest.length == 0) {
            return 0x0;
        }

        assembly {
            result_ := mload(add(source_, 32))
        }
    }
}
          

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev 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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

@openzeppelin/contracts/access/Ownable2Step.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() external {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}
          

@openzeppelin/contracts/utils/Strings.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}
          

@openzeppelin/contracts/utils/cryptography/ECDSA.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n á 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}
          

@openzeppelin/contracts/utils/math/Math.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}
          

@openzeppelin/contracts/proxy/Clones.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/Clones.sol)

pragma solidity ^0.8.0;

/**
 * @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
 * deploying minimal proxy contracts, also known as "clones".
 *
 * > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
 * > a minimal bytecode implementation that delegates all calls to a known, fixed address.
 *
 * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
 * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
 * deterministic method.
 *
 * _Available since v3.4._
 */
library Clones {
    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create opcode, which should never revert.
     */
    function clone(address implementation) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create(0, 0x09, 0x37)
        }
        require(instance != address(0), "ERC1167: create failed");
    }

    /**
     * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
     *
     * This function uses the create2 opcode and a `salt` to deterministically deploy
     * the clone. Using the same `implementation` and `salt` multiple time will revert, since
     * the clones cannot be deployed twice at the same address.
     */
    function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
        /// @solidity memory-safe-assembly
        assembly {
            // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
            // of the `implementation` address with the bytecode before the address.
            mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
            // Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
            mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
            instance := create2(0, 0x09, 0x37, salt)
        }
        require(instance != address(0), "ERC1167: create2 failed");
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(
        address implementation,
        bytes32 salt,
        address deployer
    ) internal pure returns (address predicted) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(add(ptr, 0x38), deployer)
            mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
            mstore(add(ptr, 0x14), implementation)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
            mstore(add(ptr, 0x58), salt)
            mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
            predicted := keccak256(add(ptr, 0x43), 0x55)
        }
    }

    /**
     * @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
     */
    function predictDeterministicAddress(address implementation, bytes32 salt)
        internal
        view
        returns (address predicted)
    {
        return predictDeterministicAddress(implementation, salt, address(this));
    }
}
          

@openzeppelin/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.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}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * 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].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * 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 override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override 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 value {ERC20} uses, unless this function is
     * 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 override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override 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 `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` 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 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `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.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` 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.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount
    ) external returns (bool);
}
          

@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../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 `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` 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
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}
          

@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
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);
}
          

@openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

@openzeppelin/contracts/utils/Counters.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}
          

contracts/utils/DeployTokenHasher.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/// @title Deploy Token Hasher
abstract contract DeployTokenHasher {
    // keccak256("DeployToken(string name,string symbol,EvmDeployToken[] deployTokens,StellarDeployToken stellarDeployToken,uint256 deadline)EvmDeployToken(address contractAddress,uint256 chainId,uint256 nonce)StellarDeployToken(string asset,string authority,uint256 sequenceNo)");
    bytes32 private constant _DEPLOY_TOKEN_TYPEHASH =
        0xb0d684284bab62fd5887a7ff9bf55a567a90e78b8a82f543d2d7aad12f721eb7;

    // keccak256("EvmDeployToken(address contractAddress,uint256 chainId,uint256 nonce)");
    bytes32 private constant _EVM_DEPLOY_TOKEN_TYPEHASH =
        0x16be7e703a5ec19023dc1f99e6b1b464b2e71aefd0c9b6e791b34f20755bdd6f;

    // keccak256("StellarDeployToken(string asset,string authority,uint256 sequenceNo)");
    bytes32 private constant _STELLAR_DEPLOY_TOKEN_TYPEHASH =
        0xc7036020acece1e4e42197d1db5470d4a8c7b7c4071b1b01e6c2e3a007fde9d5;

    struct EvmDeployToken {
        address contractAddress;
        uint256 chainId;
        uint256 nonce;
    }

    struct StellarDeployToken {
        string asset;
        string authority;
        uint256 sequenceNo;
    }

    struct DeployTokenParam {
        string name;
        string symbol;
        EvmDeployToken[] deployTokens;
        StellarDeployToken stellarDeployToken;
        uint256 deadline;
    }

    /// Hash `DeployTokenParams` for ERC-712 signature validation
    function _hashDeployTokenStruct(
        DeployTokenParam memory _params
    ) internal pure returns (bytes32) {
        bytes32[] memory deployTokensHashes = new bytes32[](
            _params.deployTokens.length
        );

        // hash each EvmDeployToken
        for (uint256 i = 0; i < _params.deployTokens.length; i++) {
            deployTokensHashes[i] = _hashEvmDeployTokenStruct(
                _params.deployTokens[i]
            );
        }

        // hash StellarDeployToken
        bytes32 stellarDeployTokenHash = _hashStellarDeployTokenStruct(
            _params.stellarDeployToken
        );

        // hash DeployTokenParam
        bytes32 structHash = keccak256(
            abi.encode(
                _DEPLOY_TOKEN_TYPEHASH,
                keccak256(bytes(_params.name)),
                keccak256(bytes(_params.symbol)),
                keccak256(abi.encodePacked(deployTokensHashes)),
                stellarDeployTokenHash,
                _params.deadline
            )
        );

        return structHash;
    }

    /// Hash `EvmDeployToken` for ERC-712 signature validation
    function _hashEvmDeployTokenStruct(
        EvmDeployToken memory _params
    ) private pure returns (bytes32 _encodedStruct) {
        // hash EvmDeployToken
        _encodedStruct = keccak256(
            abi.encode(
                _EVM_DEPLOY_TOKEN_TYPEHASH,
                _params.contractAddress,
                _params.chainId,
                _params.nonce
            )
        );
    }

    /// Hash `StellarDeployToken` for ERC-712 signature validation
    function _hashStellarDeployTokenStruct(
        StellarDeployToken memory _params
    ) private pure returns (bytes32 _encodedStruct) {
        // hash StellarDeployToken
        _encodedStruct = keccak256(
            abi.encode(
                _STELLAR_DEPLOY_TOKEN_TYPEHASH,
                keccak256(bytes(_params.asset)),
                keccak256(bytes(_params.authority)),
                _params.sequenceNo
            )
        );
    }
}
          

contracts/utils/EIP712Custom.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol)

pragma solidity 0.8.9;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

/**
 * Modified from openzeppelin/contracts/utils/cryptography/EIP712.sol
 * This fixed verifying contract address to 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC and chain_id to 56789
 */

abstract contract EIP712Custom {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory _name, string memory _version) {
        bytes32 hashedName = keccak256(bytes(_name));
        bytes32 hashedVersion = keccak256(bytes(_version));
        // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
        bytes32 typeHash = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;

        // verifyingContract: 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC
        // chain_id: 56789
        _CACHED_DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                typeHash,
                hashedName,
                hashedVersion,
                56789,
                address(0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC)
            )
        );
    }

    function _hashTypedDataV4(
        bytes32 _structHash
    ) private view returns (bytes32) {
        return ECDSA.toTypedDataHash(_CACHED_DOMAIN_SEPARATOR, _structHash);
    }

    /// Recover signature
    function _recoverSigner(
        bytes32 _structHash,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) internal view returns (address _signer) {
        bytes32 hash = _hashTypedDataV4(_structHash);
        _signer = ECDSA.recover(hash, _v, _r, _s);
    }
}
          

contracts/utils/MintTokenHasher.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/// @title Mint Token Hasher
abstract contract MintTokenHasher {
    // keccak256("MintToken(string symbol,uint256 amount,EvmMintDestination[] destinations,StellarMintDestination stellarDestination,uint256 deadline)EvmMintDestination(address contractAddress,uint256 chainId,uint256 nonce)StellarMintDestination(string asset,string authority,uint256 sequenceNo)");
    bytes32 private constant _MINT_TOKEN_TYPEHASH =
        0x7768cc1a3091453e40ae794b95130b9a7ecd0497b18984c57c52995e34d884fd;

    // keccak256("EvmMintDestination(address contractAddress,uint256 chainId,uint256 nonce)");
    bytes32 private constant _EVM_MINT_DESTINATION_TYPEHASH =
        0xf926565b58497271466ade9f996776ec81486c663ec41ce3bea33da7e1f9c031;

    // keccak256("StellarMintDestination(string asset,string authority,uint256 sequenceNo)");
    bytes32 private constant _STELLAR_MINT_DESTINATION_TYPEHASH =
        0x1169d81a1d4f5d9bdd3142477ed3d12d102799cac7ce46e17f2a3ba127f70c55;

    struct EvmMintDestination {
        address contractAddress;
        uint256 chainId;
        uint256 nonce;
    }

    struct StellarMintDestination {
        string asset;
        string authority;
        uint256 sequenceNo;
    }

    struct MintTokenParams {
        string symbol;
        uint256 amount;
        EvmMintDestination[] destinations;
        StellarMintDestination stellarDestination;
        uint256 deadline;
    }

    /// Hash `MintTokenParams` for ERC-712 signature validation
    function _hashMintTokenStruct(
        MintTokenParams memory _params
    ) internal pure returns (bytes32) {
        bytes32[] memory destinations = new bytes32[](
            _params.destinations.length
        );

        // hash each EvmMintDestination
        for (uint256 i = 0; i < _params.destinations.length; i++) {
            destinations[i] = _hashEvmMintDestinationStruct(
                _params.destinations[i]
            );
        }

        // hash StellarMintDestination
        bytes32 stellarDestination = _hashStellarMintDestinationStruct(
            _params.stellarDestination
        );

        // hash MintTokenParams
        bytes32 structHash = keccak256(
            abi.encode(
                _MINT_TOKEN_TYPEHASH,
                keccak256(bytes(_params.symbol)),
                _params.amount,
                keccak256(abi.encodePacked(destinations)),
                stellarDestination,
                _params.deadline
            )
        );

        return structHash;
    }

    /// Hash `EvmMintDestination` for ERC-712 signature validation
    function _hashEvmMintDestinationStruct(
        EvmMintDestination memory _params
    ) private pure returns (bytes32 _encodedStruct) {
        _encodedStruct = keccak256(
            abi.encode(
                _EVM_MINT_DESTINATION_TYPEHASH,
                _params.contractAddress,
                _params.chainId,
                _params.nonce
            )
        );
    }

    /// Hash `StellarMintDestination` for ERC-712 signature validation
    function _hashStellarMintDestinationStruct(
        StellarMintDestination memory _params
    ) private pure returns (bytes32 _encodedStruct) {
        _encodedStruct = keccak256(
            abi.encode(
                _STELLAR_MINT_DESTINATION_TYPEHASH,
                keccak256(bytes(_params.asset)),
                keccak256(bytes(_params.authority)),
                _params.sequenceNo
            )
        );
    }
}
          

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnFrom","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"name_","internalType":"string"},{"type":"string","name":"symbol_","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mint","inputs":[{"type":"address","name":"to_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101365760003560e01c806370a08231116100b257806395d89b4111610081578063a9059cbb11610066578063a9059cbb14610278578063dd62ed3e1461028b578063f2fde38b146102c457600080fd5b806395d89b411461025d578063a457c2d71461026557600080fd5b806370a08231146101fe578063715018a61461022757806379cc67901461022f5780638da5cb5b1461024257600080fd5b8063313ce5671161010957806340c10f19116100ee57806340c10f19146101c357806342966c68146101d85780634cd88b76146101eb57600080fd5b8063313ce567146101a157806339509351146101b057600080fd5b806306fdde031461013b578063095ea7b31461015957806318160ddd1461017c57806323b872dd1461018e575b600080fd5b6101436102d7565b6040516101509190610d6f565b60405180910390f35b61016c610167366004610de0565b610369565b6040519015158152602001610150565b6002545b604051908152602001610150565b61016c61019c366004610e0a565b610381565b60405160128152602001610150565b61016c6101be366004610de0565b6103a5565b6101d66101d1366004610de0565b6103e4565b005b6101d66101e6366004610e46565b6103fa565b6101d66101f9366004610f02565b610407565b61018061020c366004610f66565b6001600160a01b031660009081526020819052604090205490565b6101d661049d565b6101d661023d366004610de0565b6104b1565b6005546040516001600160a01b039091168152602001610150565b6101436104c6565b61016c610273366004610de0565b6104d5565b61016c610286366004610de0565b61057f565b610180610299366004610f88565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101d66102d2366004610f66565b61058d565b6060600680546102e690610fbb565b80601f016020809104026020016040519081016040528092919081815260200182805461031290610fbb565b801561035f5780601f106103345761010080835404028352916020019161035f565b820191906000526020600020905b81548152906001019060200180831161034257829003601f168201915b5050505050905090565b60003361037781858561061a565b5060019392505050565b60003361038f858285610773565b61039a858585610805565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061037790829086906103df908790610ff6565b61061a565b6103ec6109f2565b6103f68282610a4c565b5050565b6104043382610b0b565b50565b60085460ff161561045f5760405162461bcd60e51b815260206004820152601a60248201527f746f6b656e3a20416c726561647920696e697469616c697a656400000000000060448201526064015b60405180910390fd5b6008805460ff19166001179055815161047f906006906020850190610cd6565b508051610493906007906020840190610cd6565b506103f633610c6c565b6104a56109f2565b6104af6000610c6c565b565b6104bc823383610773565b6103f68282610b0b565b6060600780546102e690610fbb565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156105725760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610456565b61039a828686840361061a565b600033610377818585610805565b6105956109f2565b6001600160a01b0381166106115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610456565b61040481610c6c565b6001600160a01b0383166106955760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b0382166107115760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146107ff57818110156107f25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610456565b6107ff848484840361061a565b50505050565b6001600160a01b0383166108815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b0382166108fd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b0383166000908152602081905260409020548181101561098c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36107ff565b6005546001600160a01b031633146104af5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610456565b6001600160a01b038216610aa25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610456565b8060026000828254610ab49190610ff6565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b038216610b875760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b03821660009081526020819052604090205481811015610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610456565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610766565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054610ce290610fbb565b90600052602060002090601f016020900481019282610d045760008555610d4a565b82601f10610d1d57805160ff1916838001178555610d4a565b82800160010185558215610d4a579182015b82811115610d4a578251825591602001919060010190610d2f565b50610d56929150610d5a565b5090565b5b80821115610d565760008155600101610d5b565b600060208083528351808285015260005b81811015610d9c57858101830151858201604001528201610d80565b81811115610dae576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610ddb57600080fd5b919050565b60008060408385031215610df357600080fd5b610dfc83610dc4565b946020939093013593505050565b600080600060608486031215610e1f57600080fd5b610e2884610dc4565b9250610e3660208501610dc4565b9150604084013590509250925092565b600060208284031215610e5857600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112610e8657600080fd5b813567ffffffffffffffff80821115610ea157610ea1610e5f565b604051601f8301601f19908116603f01168101908282118183101715610ec957610ec9610e5f565b81604052838152866020858801011115610ee257600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610f1557600080fd5b823567ffffffffffffffff80821115610f2d57600080fd5b610f3986838701610e75565b93506020850135915080821115610f4f57600080fd5b50610f5c85828601610e75565b9150509250929050565b600060208284031215610f7857600080fd5b610f8182610dc4565b9392505050565b60008060408385031215610f9b57600080fd5b610fa483610dc4565b9150610fb260208401610dc4565b90509250929050565b600181811c90821680610fcf57607f821691505b60208210811415610ff057634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561101757634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220eb23eb983e140accf606fe48dfc013b072192afa2aae0b2023d37c88f4cf98dd64736f6c63430008090033