Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0xbcF4FaEd6842eF36ACcB2a4F4e999E9aCbB7c286
Balance 0 ETH
Nonce 1
Code Size 7355 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

7355 bytes
0x608060405260043610610220575f3560e01c80639500f2841161011e578063cbe696c5116100a8578063ea1229e41161006d578063ea1229e4146105f2578063eb4eebc714610607578063f2fde38b14610626578063f887ea4014610645578063f928364c14610664575f80fd5b8063cbe696c514610577578063ced6789f1461058a578063cf46f24c146105a9578063dca69d21146105be578063dd62ed3e146105d3575f80fd5b8063a9059cbb116100ee578063a9059cbb146104e1578063aa4bde2814610500578063ac38693e14610515578063b277c6a714610539578063b5998a0614610558575f80fd5b80639500f2841461047957806395d89b411461048e578063a457c2d7146104a2578063a64e4f8a146104c1575f80fd5b806325b5e9a7116101aa57806370a082311161016f57806370a08231146103df578063715018a6146104135780637b24ab32146104275780638091f3bf1461043c5780638da5cb5b1461045c575f80fd5b806325b5e9a714610339578063313ce5671461034e5780633582ad231461036957806339509351146103895780633fc8cef3146103a8575f80fd5b8063095ea7b3116101f0578063095ea7b31461029f5780630b78f9c0146102ce57806318160ddd146102ed578063232b1c8f1461030157806323b872dd1461031a575f80fd5b80630150fe4c1461022b5780630163f0ca14610241578063046f71501461026957806306fdde031461027e575f80fd5b3661022757005b5f80fd5b348015610236575f80fd5b5061023f610678565b005b34801561024c575f80fd5b50610256600d5481565b6040519081526020015b60405180910390f35b348015610274575f80fd5b50610256600a5481565b348015610289575f80fd5b506102926106f7565b604051610260919061183a565b3480156102aa575f80fd5b506102be6102b9366004611883565b610787565b6040519015158152602001610260565b3480156102d9575f80fd5b5061023f6102e83660046118ad565b6107a0565b3480156102f8575f80fd5b50600454610256565b34801561030c575f80fd5b50600f546102be9060ff1681565b348015610325575f80fd5b506102be6103343660046118cd565b6107f0565b348015610344575f80fd5b50610256600c5481565b348015610359575f80fd5b5060405160128152602001610260565b348015610374575f80fd5b506005546102be90600160a81b900460ff1681565b348015610394575f80fd5b506102be6103a3366004611883565b610813565b3480156103b3575f80fd5b506012546103c7906001600160a01b031681565b6040516001600160a01b039091168152602001610260565b3480156103ea575f80fd5b506102566103f936600461190b565b6001600160a01b03165f9081526001602052604090205490565b34801561041e575f80fd5b5061023f610834565b348015610432575f80fd5b5061025660065481565b348015610447575f80fd5b506005546102be90600160a01b900460ff1681565b348015610467575f80fd5b506005546001600160a01b03166103c7565b348015610484575f80fd5b50610256600b5481565b348015610499575f80fd5b50610292610847565b3480156104ad575f80fd5b506102be6104bc366004611883565b610856565b3480156104cc575f80fd5b506005546102be90600160b01b900460ff1681565b3480156104ec575f80fd5b506102be6104fb366004611883565b6108d5565b34801561050b575f80fd5b5061025660095481565b348015610520575f80fd5b50600f546103c79061010090046001600160a01b031681565b348015610544575f80fd5b5061023f61055336600461190b565b6108e2565b348015610563575f80fd5b5061023f610572366004611883565b61092f565b61023f6105853660046119fd565b61095b565b348015610595575f80fd5b506010546103c7906001600160a01b031681565b3480156105b4575f80fd5b5061025660085481565b3480156105c9575f80fd5b5061025660075481565b3480156105de575f80fd5b506102566105ed366004611aa7565b610d61565b3480156105fd575f80fd5b50610256600e5481565b348015610612575f80fd5b506011546103c7906001600160a01b031681565b348015610631575f80fd5b5061023f61064036600461190b565b610d89565b348015610650575f80fd5b506013546103c7906001600160a01b031681565b34801561066f575f80fd5b5061023f610dff565b600d54600b54101580156106905750600e54600c5410155b610698575f80fd5b6011546040515f916001600160a01b03169047908381818185875af1925050503d805f81146106e2576040519150601f19603f3d011682016040523d82523d5f602084013e6106e7565b606091505b50509050806106f4575f80fd5b50565b60606002805461070690611ade565b80601f016020809104026020016040519081016040528092919081815260200182805461073290611ade565b801561077d5780601f106107545761010080835404028352916020019161077d565b820191905f5260205f20905b81548152906001019060200180831161076057829003601f168201915b5050505050905090565b5f33610794818585610e2b565b60019150505b92915050565b6107a8610f4c565b60065482111580156107bc57506007548111155b6107c4575f80fd5b600682905560078190556107d88183611b2a565b5f036107ec576005805460ff60b01b191690555b5050565b5f336107fd858285610fb5565b61080885858561102d565b506001949350505050565b5f336107948185856108258383610d61565b61082f9190611b2a565b610e2b565b61083c610f4c565b6108455f61142d565b565b60606003805461070690611ade565b5f33816108638286610d61565b9050838110156108c85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6108088286868403610e2b565b5f3361079481858561102d565b6005546001600160a01b031633148061090557506011546001600160a01b031633145b61090d575f80fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b03831603610943575f80fd5b6011546107ec9083906001600160a01b03168361147e565b610963610f4c565b8251601380546001600160a01b0319166001600160a01b039092169182179055604080516315ab88c960e31b8152905163ad5c4648916004808201926020929091908290030181865afa1580156109bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109e09190611b51565b601280546001600160a01b0319166001600160a01b0392909216919091179055305f9081526001602052604081205485519091505f90606490610a239084611b6c565b610a2d9190611b83565b90505f60648760016020020151610a449085611b6c565b610a4e9190611b83565b90505f60648860026020020151610a659086611b6c565b610a6f9190611b83565b90508381610a7d8486611b2a565b610a879190611b2a565b14610a90575f80fd5b601354610aa99030906001600160a01b03165f19610e2b565b60135460405163f305d71960e01b8152306004820152602481018590525f6044820181905260648201523360848201524260a48201526001600160a01b039091169063f305d71990349060c40160606040518083038185885af1158015610b12573d5f803e3d5ffd5b50505050506040513d601f19601f82011682018060405250810190610b379190611ba2565b5050601154610b52915030906001600160a01b0316846115b6565b601054610b6a9030906001600160a01b0316836115b6565b6013546040805163c45a015560e01b815290515f926001600160a01b03169163c45a01559160048083019260209291908290030181865afa158015610bb1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd59190611b51565b9050806001600160a01b031663e6a439053060135f9054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c37573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c5b9190611b51565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa158015610ca4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cc89190611b51565b600f80546001600160a01b039290921661010002610100600160a81b0319909216919091179055865160065560208088015160075586516008558601516009556040860151610d179043611b2a565b6014556060860151610d299042611b2a565b600a555050600580546040870151600d55606090960151600e5562ffffff60a01b199095166201010160a01b17909455505050505050565b6001600160a01b039182165f9081526020818152604080832093909416825291909152205490565b610d91610f4c565b6001600160a01b038116610df65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108bf565b6106f48161142d565b610e07610f4c565b600554600160a81b900460ff16610e1c575f80fd5b6005805460ff60a81b19169055565b6001600160a01b038316610e8d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108bf565b6001600160a01b038216610eee5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108bf565b6001600160a01b038381165f818152602081815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b33610f5f6005546001600160a01b031690565b6001600160a01b0316146108455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108bf565b5f610fc08484610d61565b90505f198114611027578181101561101a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016108bf565b6110278484848403610e2b565b50505050565b80158061103c575060155460ff165b806110515750600554600160a01b900460ff16155b15611066576110618383836115b6565b505050565b600f546001600160a01b036101009091048116908316036112e157305f90815260016020526040902054156110eb576015805460ff191660011790555f6110c1306001600160a01b03165f9081526001602052604090205490565b90505f8282116110d157816110d3565b825b90506110de81611760565b50506015805460ff191690555b600554600160b01b900460ff161561113a575f6127106007548361110f9190611b6c565b6111199190611b83565b905080156111385761112b8183611bcd565b91506111388430836115b6565b505b600f5460ff1615801561114c57505f47115b156112e157600d54600b54101580156111695750600e54600c5410155b156111a0575f600654118061117f57505f600754115b1561118e5761118e5f806107a0565b600f805460ff191660011790556112e1565b5f805f479050600e54600c5410156111cc5760646111bf82605a611b6c565b6111c99190611b83565b91505b600d54600b5410156111e9576111e28282611bcd565b92506111ed565b8091505b8215611265576010546040515f916001600160a01b03169085908381818185875af1925050503d805f811461123d576040519150601f19603f3d011682016040523d82523d5f602084013e611242565b606091505b5050905080156112635783600b5f82825461125d9190611b2a565b90915550505b505b81156112dd576011546040515f916001600160a01b03169084908381818185875af1925050503d805f81146112b5576040519150601f19603f3d011682016040523d82523d5f602084013e6112ba565b606091505b5050905080156112db5782600c5f8282546112d59190611b2a565b90915550505b505b5050505b600f546001600160a01b038481166101009092041614801561130c5750600554600160b01b900460ff165b1561134e575f612710600654836113239190611b6c565b61132d9190611b83565b9050801561134c5761133f8183611bcd565b915061134c8430836115b6565b505b600554600160a81b900460ff16801561137257506010546001600160a01b03163214155b1561142257600a54421115611393576005805460ff60a81b19169055611422565b6014544310156113a1575f80fd5b325f9081526016602052604090205443116113ba575f80fd5b325f9081526016602052604090204390556008548111156113d9575f80fd5b600f546001600160a01b038381166101009092041614611422576009546001600160a01b0383165f908152600160205260409020546114189083611b2a565b1115611422575f80fd5b6110618383836115b6565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0385811660248301526044808301869052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b17905291515f9283928716916115099190611be0565b5f604051808303815f865af19150503d805f8114611542576040519150601f19603f3d011682016040523d82523d5f602084013e611547565b606091505b50915091508180156115715750805115806115715750808060200190518101906115719190611bf6565b6115af5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016108bf565b5050505050565b6001600160a01b03831661161a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108bf565b6001600160a01b03821661167c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108bf565b6001600160a01b0383165f90815260016020526040902054818110156116f35760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016108bf565b6001600160a01b038085165f8181526001602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906117529086815260200190565b60405180910390a350505050565b6040805160028082526060820183525f9260208301908036833701905050905030815f8151811061179357611793611b3d565b6001600160a01b0392831660209182029290920101526012548251911690829060019081106117c4576117c4611b3d565b6001600160a01b03928316602091820292909201015260135460405163791ac94760e01b815291169063791ac947906118099085905f90869030904290600401611c15565b5f604051808303815f87803b158015611820575f80fd5b505af1158015611832573d5f803e3d5ffd5b505050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b6001600160a01b03811681146106f4575f80fd5b5f8060408385031215611894575f80fd5b823561189f8161186f565b946020939093013593505050565b5f80604083850312156118be575f80fd5b50508035926020909101359150565b5f805f606084860312156118df575f80fd5b83356118ea8161186f565b925060208401356118fa8161186f565b929592945050506040919091013590565b5f6020828403121561191b575f80fd5b81356119268161186f565b9392505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561196257634e487b7160e01b5f52604160045260245ffd5b604052919050565b5f611975606061192d565b9050806060830184811115611988575f80fd5b835b818110156119a257803583526020928301920161198a565b50505092915050565b5f82601f8301126119ba575f80fd5b5f6119c5608061192d565b90508060808401858111156119d8575f80fd5b845b818110156119f25780358352602092830192016119da565b509195945050505050565b5f805f806101808587031215611a11575f80fd5b85601f860112611a1f575f80fd5b611a29868661196a565b935085607f860112611a39575f80fd5b6020611a448161192d565b806080880189811115611a55575f80fd5b606089015b81811015611a7a578035611a6d8161186f565b8452928401928401611a5a565b50819650611a888a826119ab565b955050505050611a9c8661010087016119ab565b905092959194509250565b5f8060408385031215611ab8575f80fd5b8235611ac38161186f565b91506020830135611ad38161186f565b809150509250929050565b600181811c90821680611af257607f821691505b602082108103611b1057634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561079a5761079a611b16565b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215611b61575f80fd5b81516119268161186f565b808202811582820484141761079a5761079a611b16565b5f82611b9d57634e487b7160e01b5f52601260045260245ffd5b500490565b5f805f60608486031215611bb4575f80fd5b5050815160208301516040909301519094929350919050565b8181038181111561079a5761079a611b16565b5f82518060208501845e5f920191825250919050565b5f60208284031215611c06575f80fd5b81518015158114611926575f80fd5b5f60a0820187835286602084015260a0604084015280865180835260c0850191506020880192505f5b81811015611c655783516001600160a01b0316835260209384019390920191600101611c3e565b50506001600160a01b03959095166060840152505060800152939250505056fea2646970667358221220baabeb41829e00764f62745aafa11847369678a37c176938aafef8495c19300564736f6c634300081a0033

Verified Source Code Partial Match

Compiler: v0.8.26+commit.8a97fa7a EVM: cancun Optimization: Yes (200 runs)
OpenFaceDAO.sol 494 lines
//    ____                   ______                   ____  ___   ____
//   / __ \____  ___  ____  / ____/___ _________     / __ \/   | / __ \
//  / / / / __ \/ _ \/ __ \/ /_  / __ `/ ___/ _ \   / / / / /| |/ / / /
// / /_/ / /_/ /  __/ / / / __/ / /_/ / /__/  __/  / /_/ / ___ / /_/ /
// \____/ .___/\___/_/ /_/_/    \__,_/\___/\___/  /_____/_/  |_\____/
//     /_/
//
//   We believe in democratizing AI model development and deployment.
//     OpenFace is built to be the community-driven alternative to
//      proprietary AI platforms, ensuring knowledge and resources
//                remain free and available to all.
//
// Discord: https://discord.gg/3swfECPMcr
// Website: https://openface.dev (tentative, may move to https://openface.co)
//  Github: https://github.com/openface-ai
//   x.com: https://twitter.com/openface_ai
//
//      A community funding apparatus in search of a governance function
//
//
// This is a specialized smart contract token that collects a fee to be paid
// to the contract creators, liquidity providers, and most importantly and
// in a greater amount to the OpenFace donation wallet until an initial
// maximum collections is met.
//
// This will help give the project runway and enable the token to become a
// feeless token once that service is complete - making it perfect for pure
// governance and exchange trading.
//
// A portion of the initial supply will be granted to the OpenFace donation
// wallet, and multiple portions will be locked away on their behalf for
// 6 and 12 months. A small portion will be sent to LPs and DeFi advisors.
//
// SPDX-License-Identifier: MIT
pragma solidity =0.8.26;

abstract contract Ownable {
    address private _owner;

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

    constructor() {
        _transferOwnership(msg.sender);
    }

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    function owner() public view virtual returns (address) {
        return _owner;
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function _checkOwner() internal view virtual {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

interface IERC20 {
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    function balanceOf(address account) external view returns (uint256);
    function totalSupply() external view returns (uint256);
    function transfer(address to, uint256 amount) external returns (bool);
    function approve(address spender, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

interface IERC20Metadata is IERC20 {
    function symbol() external view returns (string memory);
    function name() external view returns (string memory);
    function decimals() external view returns (uint8);
}

contract ERC20 is IERC20, IERC20Metadata {
    mapping(address => mapping(address => uint256)) private _allowances;
    mapping(address => uint256) private _balances;
    string private _name;
    string private _symbol;
    uint256 private _totalSupply;

    constructor(string memory name_, string memory symbol_) {
        _symbol = symbol_;
        _name = name_;
    }

    function name() public view virtual override returns (string memory) {
        return _name;
    }

    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = msg.sender;
        _transfer(owner, to, amount);
        return true;
    }

    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = msg.sender;
        _approve(owner, spender, amount);
        return true;
    }

    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = msg.sender;
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = msg.sender;
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = msg.sender;
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    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");

        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);
    }

    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _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);
    }

    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        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);
    }

    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);
    }

    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);
            }
        }
    }
}

interface IFactory {
    function getPair(address tokenA, address tokenB) external view returns (address pair);
}

interface IRouter {
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;

    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);

    function factory() external pure returns (address);
    function WETH() external pure returns (address);
}


contract OpenFaceDAO is ERC20, Ownable {

    bool public launched;
    bool public limitsEnabled;
    bool public feesEnabled;

    uint256 public buyFeeNumerator;
    uint256 public sellFeeNumerator;
    uint256 public maxTxnAmount;
    uint256 public maxWalletAmount;

    uint256 public disableLimitsTimestamp;

    uint256 public tAndEFeesCollected;
    uint256 public treasuryFeesCollected;
    uint256 public maxTandEFeesToCollect;
    uint256 public maxTreasuryFeesToCollect;
    bool public maxFeesCollected;

    address public liquidationAMM;
    address public tAndEFeeRecipient;
    address public treasuryRecipient;
    address public weth;
    IRouter public router;

    uint256 private startTradingBlockNumber;
    bool private inFeeLiquidation = false;

    mapping(address => uint256) lastBlockTransaction;

    bytes4 private constant TRANSFERSELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));

    receive() external payable {}

    constructor(
        string memory name,
        string memory symbol,
        uint256 supply,
        address treasuryRecipient_
    ) Ownable() ERC20(name, symbol) {
        _mint(address(this), supply);
        tAndEFeeRecipient = msg.sender;
        treasuryRecipient = treasuryRecipient_;
    }

    function setTreasuryRecipient(address feeRecipient_) external {
        require(msg.sender == owner() || msg.sender == treasuryRecipient);
        treasuryRecipient = feeRecipient_;
    }

    function disableLimits() external onlyOwner {
        require(limitsEnabled);
        limitsEnabled = false;
    }

    function setFees(uint256 _buyFeeNumerator, uint256 _sellFeeNumerator) public onlyOwner {
        require(_buyFeeNumerator <= buyFeeNumerator && _sellFeeNumerator <= sellFeeNumerator);
        buyFeeNumerator = _buyFeeNumerator;
        sellFeeNumerator = _sellFeeNumerator;
        if (buyFeeNumerator + sellFeeNumerator == 0) {
            feesEnabled = false;
        }
    }

    function _transfer(address from, address to, uint256 amount) internal override {
        if (amount == 0 || inFeeLiquidation || !launched) {
            super._transfer(from, to, amount);
            return;
        }

        // Sell
        if (to == liquidationAMM) {
            if (balanceOf(address(this)) > 0) {
                inFeeLiquidation = true;
                uint256 tokenBalance = balanceOf(address(this));
                uint256 amountToSell = tokenBalance > amount ? amount : tokenBalance;
                swapTokensForEth(amountToSell);
                inFeeLiquidation = false;
            }

            if (feesEnabled) {
                uint256 feeAmount = amount * sellFeeNumerator / 10000;
                if (feeAmount > 0) {
                    amount = amount - feeAmount;
                    super._transfer(from, address(this), feeAmount);
                }
            }

            if (!maxFeesCollected && address(this).balance > 0) {
                if (
                    tAndEFeesCollected >= maxTandEFeesToCollect &&
                    treasuryFeesCollected >= maxTreasuryFeesToCollect
                ) {
                    if (buyFeeNumerator > 0 || sellFeeNumerator > 0) {
                        setFees(0, 0);
                    }
                    maxFeesCollected = true;
                } else {
                    uint256 tAndEAmount = 0;
                    uint256 treasuryAmount = 0;
                    uint256 ethBalance = address(this).balance;

                    if (treasuryFeesCollected < maxTreasuryFeesToCollect) {
                        treasuryAmount = ethBalance * 90 / 100;
                    }

                    if (tAndEFeesCollected < maxTandEFeesToCollect) {
                        tAndEAmount = ethBalance - treasuryAmount;
                    } else {
                        treasuryAmount = ethBalance;
                    }

                    if (tAndEAmount > 0) {
                        (bool success,) = tAndEFeeRecipient.call{value: tAndEAmount}("");
                        if (success) {
                            tAndEFeesCollected += tAndEAmount;
                        }
                    }

                    if (treasuryAmount > 0) {
                        (bool success,) = treasuryRecipient.call{value: treasuryAmount}("");
                        if (success) {
                            treasuryFeesCollected += treasuryAmount;
                        }
                    }
                }
            }
        }

        // Buy
        if (from == liquidationAMM && feesEnabled) {
            uint256 feeAmount = amount * buyFeeNumerator / 10000;
            if (feeAmount > 0) {
                amount = amount - feeAmount;
                super._transfer(from, address(this), feeAmount);
            }
        }

        if (limitsEnabled && tx.origin != tAndEFeeRecipient) {
            if (block.timestamp > disableLimitsTimestamp) {
                limitsEnabled = false;
            } else {
                require(block.number >= startTradingBlockNumber);

                // one txn per block while limits are enabled
                require(lastBlockTransaction[tx.origin] < block.number);
                lastBlockTransaction[tx.origin] = block.number;

                require(amount <= maxTxnAmount);
                if (to != liquidationAMM) {
                    require(amount + balanceOf(to) <= maxWalletAmount);
                }
            }
        }
        super._transfer(from, to, amount);
    }

    function launch(
        // LP, treasury, tAndE
        uint256[3] memory amountsConfig,
        // router
        address[1] memory addressConfig,
        // Buy, sell, maxTandEFeesToCollect, maxTreasuryFeesToCollect
        uint256[4] memory feeConfig,
        // Txn, wallet, block delay, limitSeconds
        uint256[4] memory limitConfig
    ) external payable onlyOwner {
        router = IRouter(addressConfig[0]);
        weth = router.WETH();

        uint256 totalSupply = balanceOf(address(this));

        // Expected 70
        uint256 LPSupply = totalSupply * amountsConfig[0] / 100;

        // Expected 15
        uint256 treasuryInitialSupply = totalSupply * amountsConfig[1] / 100;

        // Expected 15 -> 6 locked up for 6 months, 6 locked up for 12 months, 3 apportioned to LPs and contract devs
        uint256 tAndESupply = totalSupply * amountsConfig[2] / 100;

        require(LPSupply + treasuryInitialSupply + tAndESupply == totalSupply);

        _approve(address(this), address(router), type(uint256).max);
        router.addLiquidityETH{ value: msg.value }(
            address(this),
            LPSupply,
            0,
            0,
            msg.sender,
            block.timestamp
        );

        super._transfer(address(this), treasuryRecipient, treasuryInitialSupply);
        super._transfer(address(this), tAndEFeeRecipient, tAndESupply);

        IFactory factory = IFactory(router.factory());
        liquidationAMM = factory.getPair(address(this), router.WETH());

        buyFeeNumerator = feeConfig[0];
        sellFeeNumerator = feeConfig[1];

        maxTxnAmount = limitConfig[0];
        maxWalletAmount = limitConfig[1];

        startTradingBlockNumber = block.number + limitConfig[2];
        disableLimitsTimestamp = block.timestamp + limitConfig[3];

        feesEnabled = true;
        limitsEnabled = true;
        maxTandEFeesToCollect = feeConfig[2];
        maxTreasuryFeesToCollect = feeConfig[3];
        launched = true;
    }

    function swapTokensForEth(uint256 tokenAmount) internal {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = weth;
        router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0,
            path,
            address(this),
            block.timestamp
        );
    }

    function rescueStuckETH() external {
        require(tAndEFeesCollected >= maxTandEFeesToCollect && treasuryFeesCollected >= maxTreasuryFeesToCollect);
        (bool success,) = treasuryRecipient.call{value: address(this).balance}("");
        require(success);
    }

    function rescueStuckTokens(address token, uint256 amount) external {
        require(token != address(this));
        _safeTransfer(token, treasuryRecipient, amount);
    }

    function _safeTransfer(address token, address to, uint value) private {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(TRANSFERSELECTOR, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TRANSFER_FAILED');
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyFeeNumerator 0x7b24ab32 → uint256
decimals 0x313ce567 → uint8
disableLimitsTimestamp 0x046f7150 → uint256
feesEnabled 0xa64e4f8a → bool
launched 0x8091f3bf → bool
limitsEnabled 0x3582ad23 → bool
liquidationAMM 0xac38693e → address
maxFeesCollected 0x232b1c8f → bool
maxTandEFeesToCollect 0x0163f0ca → uint256
maxTreasuryFeesToCollect 0xea1229e4 → uint256
maxTxnAmount 0xcf46f24c → uint256
maxWalletAmount 0xaa4bde28 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
router 0xf887ea40 → address
sellFeeNumerator 0xdca69d21 → uint256
symbol 0x95d89b41 → string
tAndEFeeRecipient 0xced6789f → address
tAndEFeesCollected 0x9500f284 → uint256
totalSupply 0x18160ddd → uint256
treasuryFeesCollected 0x25b5e9a7 → uint256
treasuryRecipient 0xeb4eebc7 → address
weth 0x3fc8cef3 → address

Write Contract 13 functions

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

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
disableLimits 0xf928364c
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
launch 0xcbe696c5
uint256[3] amountsConfig
address[1] addressConfig
uint256[4] feeConfig
uint256[4] limitConfig
renounceOwnership 0x715018a6
No parameters
rescueStuckETH 0x0150fe4c
No parameters
rescueStuckTokens 0xb5998a06
address token
uint256 amount
setFees 0x0b78f9c0
uint256 _buyFeeNumerator
uint256 _sellFeeNumerator
setTreasuryRecipient 0xb277c6a7
address feeRecipient_
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address