ETH Price: $3,407.89 (-1.60%)
Gas: 8 Gwei

Contract

0x1aF086B5B229fDa19E6885D8f44f44bADAEe1CC4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Mint191492742024-02-03 17:20:11149 days ago1706980811IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0006067620.81464871
Mint191492682024-02-03 17:18:59149 days ago1706980739IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0006361721.8233002
Turn Mint191492682024-02-03 17:18:59149 days ago1706980739IN
0x1aF086B5...ADAEe1CC4
0 ETH0.0007091624.81156167
Mint191492652024-02-03 17:18:23149 days ago1706980703IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0033053220.54795343
Mint191492552024-02-03 17:16:11149 days ago1706980571IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0033279320.59149357
Mint191492502024-02-03 17:15:11149 days ago1706980511IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0034722321.53834149
Mint191492452024-02-03 17:14:11149 days ago1706980451IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0031906921.46029717
Mint191492412024-02-03 17:13:23149 days ago1706980403IN
0x1aF086B5...ADAEe1CC4
0.285 ETH0.0054716121.1821835
Mint191492402024-02-03 17:13:11149 days ago1706980391IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0032464320.0620429
Mint191492342024-02-03 17:11:59149 days ago1706980319IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0029030920.03972761
Mint191492322024-02-03 17:11:35149 days ago1706980295IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0034343221.23008667
Mint191492312024-02-03 17:11:23149 days ago1706980283IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0029158920.15216791
Mint191492312024-02-03 17:11:23149 days ago1706980283IN
0x1aF086B5...ADAEe1CC4
0.285 ETH0.0052535820.15216791
Mint191492312024-02-03 17:11:23149 days ago1706980283IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0032594920.19203118
Mint191492302024-02-03 17:11:11149 days ago1706980271IN
0x1aF086B5...ADAEe1CC4
0.285 ETH0.0054083820.77153882
Mint191492282024-02-03 17:10:47149 days ago1706980247IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0029151720.25215832
Mint191492252024-02-03 17:10:11149 days ago1706980211IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0033266920.65758931
Mint191492232024-02-03 17:09:47149 days ago1706980187IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0031746722.02124452
Mint191492212024-02-03 17:09:23149 days ago1706980163IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0032216522.39015255
Mint191492032024-02-03 17:05:47149 days ago1706979947IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0030898219.165621
Mint191491992024-02-03 17:04:59149 days ago1706979899IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0027384819.03883109
Mint191491972024-02-03 17:04:35149 days ago1706979875IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0031135119.23692382
Mint191491822024-02-03 17:01:35149 days ago1706979695IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.003062621.24078585
Mint191491822024-02-03 17:01:35149 days ago1706979695IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0034340621.32971999
Mint191491802024-02-03 17:01:11149 days ago1706979671IN
0x1aF086B5...ADAEe1CC4
0.06 ETH0.0034790421.55622185
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
191492652024-02-03 17:18:23149 days ago1706980703
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492652024-02-03 17:18:23149 days ago1706980703
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492552024-02-03 17:16:11149 days ago1706980571
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492552024-02-03 17:16:11149 days ago1706980571
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492502024-02-03 17:15:11149 days ago1706980511
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492502024-02-03 17:15:11149 days ago1706980511
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492452024-02-03 17:14:11149 days ago1706980451
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492412024-02-03 17:13:23149 days ago1706980403
0x1aF086B5...ADAEe1CC4
0.15 ETH
191492412024-02-03 17:13:23149 days ago1706980403
0x1aF086B5...ADAEe1CC4
0.135 ETH
191492402024-02-03 17:13:11149 days ago1706980391
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492402024-02-03 17:13:11149 days ago1706980391
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492342024-02-03 17:11:59149 days ago1706980319
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492342024-02-03 17:11:59149 days ago1706980319
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492322024-02-03 17:11:35149 days ago1706980295
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492322024-02-03 17:11:35149 days ago1706980295
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.15 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.135 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492312024-02-03 17:11:23149 days ago1706980283
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492302024-02-03 17:11:11149 days ago1706980271
0x1aF086B5...ADAEe1CC4
0.15 ETH
191492302024-02-03 17:11:11149 days ago1706980271
0x1aF086B5...ADAEe1CC4
0.135 ETH
191492282024-02-03 17:10:47149 days ago1706980247
0x1aF086B5...ADAEe1CC4
0.03 ETH
191492282024-02-03 17:10:47149 days ago1706980247
0x1aF086B5...ADAEe1CC4
0.03 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
smolMinting

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 6 : smolMinting.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "openzeppelin/access/Ownable.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ReentrancyGuard} from "solmate/utils/ReentrancyGuard.sol";

//import {IERC721} from "openzeppelin/token/ERC721/IERC721.sol";
// import {basePool} from "../basePool/basePoolSTETHNFT.sol";

interface IPool {
    function addNfts(uint256 newMints) external;
}

interface IERC721Mint {
    function mint(uint256 amount, address to) external;
}

contract smolMinting is Ownable, ReentrancyGuard {
    address public smolDollar;
    address public smolFed;
    address public smolBasePool;
    uint256 public mintingBasePrice;
    bool public mintOn;
    /// @notice constant to scale uints into percentages (1e6 == 100%)
    uint256 public constant PERCENTAGE_SCALE = 1e6;
    address artistSafe;
    IERC721Mint smolDollarInterface;
    IPool smolBasePoolInterface;

    constructor() {}

    function initalize(
        address _smolDollar,
        address _smolFed,
        address _smolBasePool,
        uint256 _mintingBasePriceInit,
        address _artistSafe
    ) public onlyOwner {
        smolDollar = _smolDollar;
        smolFed = _smolFed;
        mintingBasePrice = _mintingBasePriceInit;
        artistSafe = _artistSafe;
        smolBasePool = _smolBasePool;
        smolDollarInterface = IERC721Mint(_smolDollar);
        smolBasePoolInterface = IPool(_smolBasePool);
    }

    function turnMint(bool onOf) public onlyOwner {
        mintOn = onOf;
    }

    function setFed(address fed) public onlyOwner {
        smolFed = fed;
    }

    function setSmolDollar(address dollar) public onlyOwner {
        smolDollar = dollar;
        smolDollarInterface = IERC721Mint(dollar);
    }

    function setBasePool(address pool) public onlyOwner {
        smolBasePool = pool;
        smolBasePoolInterface = IPool(pool);
    }

    function mint(address to, uint256 amount) public payable nonReentrant {
        require(mintOn == true, "MINTING_NOT_STARTED");

        (
            uint256 priceAll,
            uint256 artistProfit,
            uint256 reserve
        ) = calculatePrice(amount);

        require(msg.value >= priceAll, "WRONG_VALUE");

        smolDollarInterface.mint(amount, to);
        // (bool suc1, ) = address(smolDollar).call(
        //     abi.encodeWithSignature("mint(uint256,address)", amount, to)
        // );
        // require(suc1 == true, "MINTING_CALL_FAILED");

        smolBasePoolInterface.addNfts(amount);
        // (bool suc2, ) = address(smolBasePool).call(
        //     abi.encodeWithSignature("addNfts(uint256)", amount)
        // );
        // require(suc2 == true, "BASEPOOL_CALL_FAILED");

        //send fee to artistsafe
        SafeTransferLib.safeTransferETH(artistSafe, artistProfit);

        //send backing to smol fed
        SafeTransferLib.safeTransferETH(smolFed, reserve);
    }

    function calculatePrice(
        uint256 amount
    )
        public
        view
        returns (uint256 price, uint256 artistProfit, uint256 reserve)
    {
        artistProfit = calculatedPriceDiscount(amount) * amount;
        reserve = mintingBasePrice * amount;
        price = (artistProfit + reserve);
    }

    function calculatedPriceDiscount(
        uint256 amount
    ) internal view returns (uint256 price) {
        if (amount >= 50) {
            ///50 Mints 75% off of Artist Fee
            price = _scaleAmountByPercentage(mintingBasePrice, 250000);
        } else if (amount >= 25) {
            ///25 Mints 50% off of Artist Fee
            price = _scaleAmountByPercentage(mintingBasePrice, 500000);
        } else if (amount >= 10) {
            ///10 Mints 25% off of Artist Fee
            price = _scaleAmountByPercentage(mintingBasePrice, 750000);
        } else if (amount >= 5) {
            ///5 Mints 10% off of Artist Fee
            price = _scaleAmountByPercentage(mintingBasePrice, 900000);
        } else {
            price = mintingBasePrice;
        }
    }

    ///https://github.com/0xSplits/splits-contracts/blob/main/contracts/SplitMain.sol
    function _scaleAmountByPercentage(
        uint256 amount,
        uint256 scaledPercent
    ) public pure returns (uint256 scaledAmount) {
        // use assembly to bypass checking for overflow & division by 0
        // scaledPercent has been validated to be < PERCENTAGE_SCALE)
        // & PERCENTAGE_SCALE will never be 0
        // pernicious ERC20s may cause overflow, but results do not affect ETH & other ERC20 balances
        assembly {
            /* eg (100 * 2*1e4) / (1e6) */
            scaledAmount := div(mul(amount, scaledPercent), PERCENTAGE_SCALE)
        }
    }
}

File 2 of 6 : 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);
    }
}

File 3 of 6 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
            mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 4 of 6 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() virtual {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

File 5 of 6 : 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;
    }
}

File 6 of 6 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "solady/=lib/solady/src/",
    "closedsea/=lib/closedsea/",
    "erc721a-upgradeable/=lib/ERC721A-Upgradeable/",
    "operator-filter-registry/=lib/closedsea/lib/operator-filter-registry/",
    "ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "erc721a/=lib/closedsea/lib/erc721a/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-upgrades/=lib/openzeppelin-upgrades/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"PERCENTAGE_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"scaledPercent","type":"uint256"}],"name":"_scaleAmountByPercentage","outputs":[{"internalType":"uint256","name":"scaledAmount","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculatePrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"artistProfit","type":"uint256"},{"internalType":"uint256","name":"reserve","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_smolDollar","type":"address"},{"internalType":"address","name":"_smolFed","type":"address"},{"internalType":"address","name":"_smolBasePool","type":"address"},{"internalType":"uint256","name":"_mintingBasePriceInit","type":"uint256"},{"internalType":"address","name":"_artistSafe","type":"address"}],"name":"initalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingBasePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"setBasePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fed","type":"address"}],"name":"setFed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dollar","type":"address"}],"name":"setSmolDollar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smolBasePool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolDollar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"smolFed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"onOf","type":"bool"}],"name":"turnMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080806040523461005f5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055610a1090816100658239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c80630179e3031461012757806301ff772b146101225780632f4da27c1461011d5780633f26479e1461011857806340c10f19146101135780634613862e1461010e5780634f6bc86814610109578063715018a6146101045780637c05ce7f146100ff57806387193559146100fa5780638da5cb5b146100f557806397ec2b3e146100f0578063ae104265146100eb578063b25882e2146100e6578063b462d2bb146100e1578063d64733a4146100dc5763f2fde38b146100d757600080fd5b6106de565b6106b8565b61069a565b610671565b610640565b6105f5565b6105cc565b610581565b6104ac565b61044e565b610425565b6103e2565b610237565b6101c1565b61019e565b610165565b61013c565b600091031261013757565b600080fd5b34610137576000366003190112610137576002546040516001600160a01b039091168152602090f35b34610137576020366003190112610137576004358015158091036101375761018b6107a1565b60ff801960065416911617600655600080f35b3461013757600036600319011261013757602060ff600654166040519015158152f35b34610137576000366003190112610137576020604051620f42408152f35b600435906001600160a01b038216820361013757565b602435906001600160a01b038216820361013757565b604435906001600160a01b038216820361013757565b608435906001600160a01b038216820361013757565b60403660031901126101375761024b6101df565b6024359060018054036103b0576002600155610276600161026e60065460ff1690565b1515146107f9565b61028d61028283610931565b92909134101561083b565b6007546102aa906001600160a01b03165b6001600160a01b031690565b93843b15610137576040516394bf804d60e01b8152600481018290526001600160a01b0394909416602485015260009485908590604490829084905af193841561039457859461039d575b5060085461030b906001600160a01b031661029e565b90813b156103995760405163241e9ebf60e11b8152600481019190915293908490602490829084905af19081156103945761036f9361035e9261037b575b5060065460081c6001600160a01b03166108ab565b6003546001600160a01b03166108ab565b61037860018055565b80f35b8061038861038e92610875565b8061012c565b38610349565b61089f565b8480fd5b806103886103aa92610875565b386102f5565b60405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b6044820152606490fd5b34610137576020366003190112610137576103fb6101df565b6104036107a1565b600380546001600160a01b0319166001600160a01b0392909216919091179055005b34610137576000366003190112610137576003546040516001600160a01b039091168152602090f35b34610137576000806003193601126104a9576104686107a1565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101375760a03660031901126101375761057f6104c86101df565b6104d06101f5565b6105616104db61020b565b916104e4610221565b6104ec6107a1565b600280546001600160a01b03199081166001600160a01b039788169081179092556003805482169488169490941790935560643560055560068054610100600160a81b03191660089390931b610100600160a81b03169290921790915560048054831685871617905560078054909216179055565b1660018060a01b03166001600160601b0360a01b6008541617600855565b005b346101375760203660031901126101375761059a6101df565b6105a26107a1565b60018060a01b03166001600160601b0360a01b818160025416176002556007541617600755600080f35b34610137576000366003190112610137576000546040516001600160a01b039091168152602090f35b346101375760203660031901126101375761060e6101df565b6106166107a1565b60018060a01b03166001600160601b0360a01b818160045416176004556008541617600855600080f35b3461013757602036600319011261013757606061065e600435610931565b9060405192835260208301526040820152f35b34610137576000366003190112610137576004546040516001600160a01b039091168152602090f35b34610137576000366003190112610137576020600554604051908152f35b34610137576040366003190112610137576020604051620f424060243560043502048152f35b34610137576020366003190112610137576106f76101df565b6106ff6107a1565b6001600160a01b03908116801561074d57600080546001600160a01b03198116831782559092167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b6000546001600160a01b031633036107b557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561080057565b60405162461bcd60e51b815260206004820152601360248201527213525395125391d7d393d517d4d51054951151606a1b6044820152606490fd5b1561084257565b60405162461bcd60e51b815260206004820152600b60248201526a57524f4e475f56414c554560a81b6044820152606490fd5b67ffffffffffffffff811161088957604052565b634e487b7160e01b600052604160045260246000fd5b6040513d6000823e3d90fd5b600080809381935af1156108bb57565b60405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561091f57565b6108f6565b9190820180921161091f57565b603281106109685761095b61095282620f42406203d090600554020461090c565b9160055461090c565b6109658183610924565b92565b601981106109895761095b61095282620f42406207a120600554020461090c565b600a81106109aa5761095b61095282620f4240620b71b0600554020461090c565b600581106109cb5761095b61095282620f4240620dbba0600554020461090c565b61095b6109528260055461090c56fea26469706673582212207750bc9c8db0a1115431139cc3e5ef77e88fa2e59656d4ff2d7e42911e9c055b64736f6c63430008150033

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c80630179e3031461012757806301ff772b146101225780632f4da27c1461011d5780633f26479e1461011857806340c10f19146101135780634613862e1461010e5780634f6bc86814610109578063715018a6146101045780637c05ce7f146100ff57806387193559146100fa5780638da5cb5b146100f557806397ec2b3e146100f0578063ae104265146100eb578063b25882e2146100e6578063b462d2bb146100e1578063d64733a4146100dc5763f2fde38b146100d757600080fd5b6106de565b6106b8565b61069a565b610671565b610640565b6105f5565b6105cc565b610581565b6104ac565b61044e565b610425565b6103e2565b610237565b6101c1565b61019e565b610165565b61013c565b600091031261013757565b600080fd5b34610137576000366003190112610137576002546040516001600160a01b039091168152602090f35b34610137576020366003190112610137576004358015158091036101375761018b6107a1565b60ff801960065416911617600655600080f35b3461013757600036600319011261013757602060ff600654166040519015158152f35b34610137576000366003190112610137576020604051620f42408152f35b600435906001600160a01b038216820361013757565b602435906001600160a01b038216820361013757565b604435906001600160a01b038216820361013757565b608435906001600160a01b038216820361013757565b60403660031901126101375761024b6101df565b6024359060018054036103b0576002600155610276600161026e60065460ff1690565b1515146107f9565b61028d61028283610931565b92909134101561083b565b6007546102aa906001600160a01b03165b6001600160a01b031690565b93843b15610137576040516394bf804d60e01b8152600481018290526001600160a01b0394909416602485015260009485908590604490829084905af193841561039457859461039d575b5060085461030b906001600160a01b031661029e565b90813b156103995760405163241e9ebf60e11b8152600481019190915293908490602490829084905af19081156103945761036f9361035e9261037b575b5060065460081c6001600160a01b03166108ab565b6003546001600160a01b03166108ab565b61037860018055565b80f35b8061038861038e92610875565b8061012c565b38610349565b61089f565b8480fd5b806103886103aa92610875565b386102f5565b60405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b6044820152606490fd5b34610137576020366003190112610137576103fb6101df565b6104036107a1565b600380546001600160a01b0319166001600160a01b0392909216919091179055005b34610137576000366003190112610137576003546040516001600160a01b039091168152602090f35b34610137576000806003193601126104a9576104686107a1565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b346101375760a03660031901126101375761057f6104c86101df565b6104d06101f5565b6105616104db61020b565b916104e4610221565b6104ec6107a1565b600280546001600160a01b03199081166001600160a01b039788169081179092556003805482169488169490941790935560643560055560068054610100600160a81b03191660089390931b610100600160a81b03169290921790915560048054831685871617905560078054909216179055565b1660018060a01b03166001600160601b0360a01b6008541617600855565b005b346101375760203660031901126101375761059a6101df565b6105a26107a1565b60018060a01b03166001600160601b0360a01b818160025416176002556007541617600755600080f35b34610137576000366003190112610137576000546040516001600160a01b039091168152602090f35b346101375760203660031901126101375761060e6101df565b6106166107a1565b60018060a01b03166001600160601b0360a01b818160045416176004556008541617600855600080f35b3461013757602036600319011261013757606061065e600435610931565b9060405192835260208301526040820152f35b34610137576000366003190112610137576004546040516001600160a01b039091168152602090f35b34610137576000366003190112610137576020600554604051908152f35b34610137576040366003190112610137576020604051620f424060243560043502048152f35b34610137576020366003190112610137576106f76101df565b6106ff6107a1565b6001600160a01b03908116801561074d57600080546001600160a01b03198116831782559092167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b6000546001600160a01b031633036107b557565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b1561080057565b60405162461bcd60e51b815260206004820152601360248201527213525395125391d7d393d517d4d51054951151606a1b6044820152606490fd5b1561084257565b60405162461bcd60e51b815260206004820152600b60248201526a57524f4e475f56414c554560a81b6044820152606490fd5b67ffffffffffffffff811161088957604052565b634e487b7160e01b600052604160045260246000fd5b6040513d6000823e3d90fd5b600080809381935af1156108bb57565b60405162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561091f57565b6108f6565b9190820180921161091f57565b603281106109685761095b61095282620f42406203d090600554020461090c565b9160055461090c565b6109658183610924565b92565b601981106109895761095b61095282620f42406207a120600554020461090c565b600a81106109aa5761095b61095282620f4240620b71b0600554020461090c565b600581106109cb5761095b61095282620f4240620dbba0600554020461090c565b61095b6109528260055461090c56fea26469706673582212207750bc9c8db0a1115431139cc3e5ef77e88fa2e59656d4ff2d7e42911e9c055b64736f6c63430008150033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.