Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x334aA5996583722cC850344eC02fD99bc263C56d
Balance 0 ETH
Nonce 327
Code Size 3230 bytes
Indexed Transactions 0
External Etherscan ยท Sourcify

Contract Bytecode

3230 bytes
0x6080604052600436106100c25760003560e01c8063831e80f21161007f578063d784d42611610059578063d784d42614610241578063d9eb594714610261578063f2fde38b14610277578063f46901ed1461029757600080fd5b8063831e80f2146101ce5780638da5cb5b146101e1578063bc063e1a146101ff57600080fd5b8063017e7e58146100c757806306bfcec61461010457806323fa495a1461014357806342246a57146101655780635c60da1b14610199578063715018a6146101b9575b600080fd5b3480156100d357600080fd5b506003546100e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561011057600080fd5b5060025461012b90600160a01b90046001600160601b031681565b6040516001600160601b0390911681526020016100fb565b34801561014f57600080fd5b5061016361015e3660046109a1565b6102b7565b005b34801561017157600080fd5b506100e77f000000000000000000000000b2665bc2539b624f5905faede00802f77be73b2b81565b3480156101a557600080fd5b506002546100e7906001600160a01b031681565b3480156101c557600080fd5b5061016361030c565b6100e76101dc366004610a5d565b610320565b3480156101ed57600080fd5b506000546001600160a01b03166100e7565b34801561020b57600080fd5b506102337f00000000000000000000000000000000000000000052b7d2dcc80cd2e400000081565b6040519081526020016100fb565b34801561024d57600080fd5b5061016361025c366004610ae1565b610496565b34801561026d57600080fd5b5061023360045481565b34801561028357600080fd5b50610163610292366004610ae1565b610544565b3480156102a357600080fd5b506101636102b2366004610ae1565b6105bd565b6102bf61062e565b7f00000000000000000000000000000000000000000052b7d2dcc80cd2e400000081106103075760405163179c637760e11b8152600481018290526024015b60405180910390fd5b600455565b61031461062e565b61031e6000610688565b565b60006004543410156103475760405163131398d760e21b81523460048201526024016102fe565b61034f6106d8565b610357610731565b600454600354610372916001600160a01b039091169061074f565b6002546040516103b7916001600160a01b03169061039c9033908990899089908990602001610b35565b6040516020818303038152906040528051906020012061086d565b60405163d72bdc5360e01b81529091506001600160a01b0382169063d72bdc53906103ee9033908990899089908990600401610bcb565b600060405180830381600087803b15801561040857600080fd5b505af115801561041c573d6000803e3d6000fd5b5050505061042c33826000610910565b6002546040805160008152600160a01b9092046001600160601b031660208301526001600160a01b0383169133917f2395b95c14d87a016c2bfcac5b35c32cd39f2127399d3ccc77e145d0a3099d41910160405180910390a361048e60018055565b949350505050565b61049e61062e565b6001600160a01b03811615806104bc57506001600160a01b03811630145b156104e557604051630c76093760e01b81526001600160a01b03821660048201526024016102fe565b600280546001600160a01b0319166001600160a01b0383161780825560149061051d90600160a01b90046001600160601b0316610c2f565b91906101000a8154816001600160601b0302191690836001600160601b0316021790555050565b61054c61062e565b6001600160a01b0381166105b15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102fe565b6105ba81610688565b50565b6105c561062e565b6001600160a01b03811615806105e357506001600160a01b03811630145b1561060c5760405163cb9339d560e01b81526001600160a01b03821660048201526024016102fe565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461031e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102fe565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361072a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102fe565b6002600155565b6000600454346107419190610c55565b905080156105ba576105ba33825b8047101561079f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102fe565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146107ec576040519150601f19603f3d011682016040523d82523d6000602084013e6107f1565b606091505b50509050806108685760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102fe565b505050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008360601b60e81c176000526e5af43d82803e903d91602b57fd5bf38360781b1760205281603760096000f590506001600160a01b03811661090a5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016102fe565b92915050565b60405163141106f560e11b81526001600160a01b038481166004830152838116602483015260ff831660448301527f000000000000000000000000b2665bc2539b624f5905faede00802f77be73b2b16906328220dea90606401600060405180830381600087803b15801561098457600080fd5b505af1158015610998573d6000803e3d6000fd5b50505050505050565b6000602082840312156109b357600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126109e157600080fd5b813567ffffffffffffffff808211156109fc576109fc6109ba565b604051601f8301601f19908116603f01168101908282118183101715610a2457610a246109ba565b81604052838152866020858801011115610a3d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060008060808587031215610a7357600080fd5b843567ffffffffffffffff80821115610a8b57600080fd5b610a97888389016109d0565b95506020870135915080821115610aad57600080fd5b50610aba878288016109d0565b935050604085013560ff81168114610ad157600080fd5b9396929550929360600135925050565b600060208284031215610af357600080fd5b81356001600160a01b0381168114610b0a57600080fd5b9392505050565b60005b83811015610b2c578181015183820152602001610b14565b50506000910152565b6001600160601b03198660601b16815260008551610b5a816014850160208a01610b11565b855190830190610b71816014840160208a01610b11565b60f89590951b6001600160f81b03191660149190950190810194909452505060158201526035019392505050565b60008151808452610bb7816020860160208601610b11565b601f01601f19169290920160200192915050565b6001600160a01b038616815260a060208201819052600090610bef90830187610b9f565b8281036040840152610c018187610b9f565b60ff9590951660608401525050608001529392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160601b03808316818103610c4b57610c4b610c19565b6001019392505050565b8181038181111561090a5761090a610c1956fea2646970667358221220a717ce1b667e0c1c629f8423ede959940a72b5c3bbeb4329868d8f846a58c9ad64736f6c63430008130033

Verified Source Code Full Match

Compiler: v0.8.19+commit.7dd6d404 EVM: paris Optimization: Yes (200 runs)
IStandardERC20.sol 27 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/**
 *  ____  _______  _______           _     
 * |  _ \| ____\ \/ /_   _|__   ___ | |___ 
 * | | | |  _|  \  /  | |/ _ \ / _ \| / __|
 * | |_| | |___ /  \  | | (_) | (_) | \__ \
 * |____/|_____/_/\_\ |_|\___/ \___/|_|___/
 *
 * This smart contract was created effortlessly using the DEXTools Token Creator.
 * 
 * ๐ŸŒ Website: https://www.dextools.io/
 * ๐Ÿฆ Twitter: https://twitter.com/DEXToolsApp
 * ๐Ÿ’ฌ Telegram: https://t.me/DEXToolsCommunity
 * 
 * ๐Ÿš€ Unleash the power of decentralized finances and tokenization with DEXTools Token Creator. Customize your token seamlessly. Manage your created tokens conveniently from your user panel - start creating your dream token today!
 */
interface IStandardERC20 {
    function initialize(
        address owner_,
        string memory name_,
        string memory symbol_,
        uint8 decimals_,
        uint256 totalSupply_
    ) external;
}
Clones.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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));
    }
}
TokenFactoryBase.sol 114 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/**
 *  ____  _______  _______           _     
 * |  _ \| ____\ \/ /_   _|__   ___ | |___ 
 * | | | |  _|  \  /  | |/ _ \ / _ \| / __|
 * | |_| | |___ /  \  | | (_) | (_) | \__ \
 * |____/|_____/_/\_\ |_|\___/ \___/|_|___/
 *
 * This smart contract was created effortlessly using the DEXTools Token Creator.
 * 
 * ๐ŸŒ Website: https://www.dextools.io/
 * ๐Ÿฆ Twitter: https://twitter.com/DEXToolsApp
 * ๐Ÿ’ฌ Telegram: https://t.me/DEXToolsCommunity
 * 
 * ๐Ÿš€ Unleash the power of decentralized finances and tokenization with DEXTools Token Creator. Customize your token seamlessly. Manage your created tokens conveniently from your user panel - start creating your dream token today!
 */
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { IFactoryManager } from "../interfaces/IFactoryManager.sol";

contract TokenFactoryBase is Ownable, ReentrancyGuard {
    using Address for address payable;

    address public immutable FACTORY_MANAGER;
    address public implementation;
    uint96 public implementationVersion; // Max value: 79228162514264337593543950335
    address public feeTo;
    uint256 public flatFee;
    uint256 public immutable MAX_FEE;

    event TokenCreated(
        address indexed owner,
        address indexed token,
        uint8 tokenType,
        uint96 tokenVersion
    );

    error InvalidFactoryManager(address implementation);
    error InvalidImplementation(address factoryManager);
    error InvalidFeeReceiver(address receiver);
    error InvalidFee(uint256 fee);
    error InvalidMaxFee(uint256 maxFee);
    error InsufficientFee(uint256 fee);

    modifier enoughFee() {
        if (msg.value < flatFee) revert InsufficientFee(msg.value);
        _;
    }

    constructor(
        address factoryManager_,
        address implementation_,
        address feeTo_,
        uint256 flatFee_,
        uint256 maxFee_
    ) {
        if (factoryManager_ == address(0))
            revert InvalidFactoryManager(factoryManager_);
        if (implementation_ == address(0))
            revert InvalidImplementation(implementation_);
        if (feeTo_ == address(0)) revert InvalidFeeReceiver(feeTo_);
        if (flatFee_ >= maxFee_) revert InvalidFee(flatFee_);
        if (flatFee_ == 0) revert InvalidMaxFee(maxFee_);

        FACTORY_MANAGER = factoryManager_;
        implementation = implementation_;
        implementationVersion = 1;
        feeTo = feeTo_;
        flatFee = flatFee_;
        MAX_FEE = maxFee_;
    }

    function setImplementation(address implementation_) external onlyOwner {
        if (implementation_ == address(0) || implementation_ == address(this))
            revert InvalidImplementation(implementation_);
        implementation = implementation_;
        ++implementationVersion;
    }

    function setFeeTo(address feeReceivingAddress) external onlyOwner {
        if (
            feeReceivingAddress == address(0) ||
            feeReceivingAddress == address(this)
        ) revert InvalidFeeReceiver(feeReceivingAddress);
        feeTo = feeReceivingAddress;
    }

    function setFlatFee(uint256 fee) external onlyOwner {
        if (fee >= MAX_FEE) revert InvalidFee(fee);
        flatFee = fee;
    }

    function assignTokenToOwner(
        address owner,
        address token,
        uint8 tokenType
    ) internal {
        IFactoryManager(FACTORY_MANAGER).assignTokensToOwner(
            owner,
            token,
            tokenType
        );
    }

    function refundExcessiveFee() internal {
        uint256 refund = msg.value - flatFee;
        if (refund > 0) {
            payable(msg.sender).sendValue(refund);
        }
    }
}
IFactoryManager.sol 25 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/**
 *  ____  _______  _______           _     
 * |  _ \| ____\ \/ /_   _|__   ___ | |___ 
 * | | | |  _|  \  /  | |/ _ \ / _ \| / __|
 * | |_| | |___ /  \  | | (_) | (_) | \__ \
 * |____/|_____/_/\_\ |_|\___/ \___/|_|___/
 *
 * This smart contract was created effortlessly using the DEXTools Token Creator.
 * 
 * ๐ŸŒ Website: https://www.dextools.io/
 * ๐Ÿฆ Twitter: https://twitter.com/DEXToolsApp
 * ๐Ÿ’ฌ Telegram: https://t.me/DEXToolsCommunity
 * 
 * ๐Ÿš€ Unleash the power of decentralized finances and tokenization with DEXTools Token Creator. Customize your token seamlessly. Manage your created tokens conveniently from your user panel - start creating your dream token today!
 */
interface IFactoryManager {
    function assignTokensToOwner(
        address owner,
        address token,
        uint8 tokenType
    ) external;
}
Address.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. 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 {
        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);
    }
}
StandardTokenFactory.sol 61 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

/**
 *  ____  _______  _______           _     
 * |  _ \| ____\ \/ /_   _|__   ___ | |___ 
 * | | | |  _|  \  /  | |/ _ \ / _ \| / __|
 * | |_| | |___ /  \  | | (_) | (_) | \__ \
 * |____/|_____/_/\_\ |_|\___/ \___/|_|___/
 *
 * This smart contract was created effortlessly using the DEXTools Token Creator.
 * 
 * ๐ŸŒ Website: https://www.dextools.io/
 * ๐Ÿฆ Twitter: https://twitter.com/DEXToolsApp
 * ๐Ÿ’ฌ Telegram: https://t.me/DEXToolsCommunity
 * 
 * ๐Ÿš€ Unleash the power of decentralized finances and tokenization with DEXTools Token Creator. Customize your token seamlessly. Manage your created tokens conveniently from your user panel - start creating your dream token today!
 */
import { Clones } from "@openzeppelin/contracts/proxy/Clones.sol";
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { TokenFactoryBase } from "./TokenFactoryBase.sol";
import { IStandardERC20 } from "../interfaces/IStandardERC20.sol";

contract StandardTokenFactory is TokenFactoryBase {
    using Address for address payable;
    constructor(
        address factoryManager_,
        address implementation_,
        address feeTo_,
        uint256 flatFee_,
        uint256 maxFee_
    )
        TokenFactoryBase(
            factoryManager_,
            implementation_,
            feeTo_,
            flatFee_,
            maxFee_
        )
    {}

    function create(
        string memory name,
        string memory symbol,
        uint8 decimals,
        uint256 totalSupply
    ) external payable enoughFee nonReentrant returns (address token) {
        refundExcessiveFee();
        payable(feeTo).sendValue(flatFee);
        token = Clones.cloneDeterministic(implementation, keccak256(abi.encodePacked(msg.sender, name, symbol, decimals, totalSupply)));
        IStandardERC20(token).initialize(
            msg.sender,
            name,
            symbol,
            decimals,
            totalSupply
        );
        assignTokenToOwner(msg.sender, token, 0);
        emit TokenCreated(msg.sender, token, 0, implementationVersion);
    }
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

Read Contract

FACTORY_MANAGER 0x42246a57 → address
MAX_FEE 0xbc063e1a → uint256
feeTo 0x017e7e58 → address
flatFee 0xd9eb5947 → uint256
implementation 0x5c60da1b → address
implementationVersion 0x06bfcec6 → uint96
owner 0x8da5cb5b → address

Write Contract 6 functions

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

create 0x831e80f2
string name
string symbol
uint8 decimals
uint256 totalSupply
returns: address
renounceOwnership 0x715018a6
No parameters
setFeeTo 0xf46901ed
address feeReceivingAddress
setFlatFee 0x23fa495a
uint256 fee
setImplementation 0xd784d426
address implementation_
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address