ETH Price: $1,947.83 (-1.64%)

Contract

0x83FBCF4607A6C015437BFE4dd77d2C40c1Abcb57
 

Overview

ETH Balance

0.039125353664755153 ETH

Eth Value

$76.21 (@ $1,947.83/ETH)

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Sell211226282024-11-05 16:25:23487 days ago1730823923IN
0x83FBCF46...0c1Abcb57
0 ETH0.0004666114.06478169
Sell211226272024-11-05 16:25:11487 days ago1730823911IN
0x83FBCF46...0c1Abcb57
0 ETH0.00078114.47797872
Sell211226232024-11-05 16:24:23487 days ago1730823863IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007750314.37054362
Sell211226222024-11-05 16:24:11487 days ago1730823851IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007999314.82902426
Sell211226202024-11-05 16:23:47487 days ago1730823827IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007926814.69457675
Sell211226192024-11-05 16:23:35487 days ago1730823815IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007914814.67229208
Sell211226182024-11-05 16:23:23487 days ago1730823803IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007743914.35558325
Sell211226172024-11-05 16:23:11487 days ago1730823791IN
0x83FBCF46...0c1Abcb57
0 ETH0.0004746614.3076194
Sell211226162024-11-05 16:22:59487 days ago1730823779IN
0x83FBCF46...0c1Abcb57
0 ETH0.0006945712.87576212
Sell211226142024-11-05 16:22:35487 days ago1730823755IN
0x83FBCF46...0c1Abcb57
0 ETH0.000776314.39102095
Sell211225882024-11-05 16:17:23487 days ago1730823443IN
0x83FBCF46...0c1Abcb57
0 ETH0.0008922516.54046944
Sell211225862024-11-05 16:16:59487 days ago1730823419IN
0x83FBCF46...0c1Abcb57
0 ETH0.0008858816.42234436
Sell211225842024-11-05 16:16:35487 days ago1730823395IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007928114.69696306
Sell211225832024-11-05 16:16:11487 days ago1730823371IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007971814.77798767
Sell211225802024-11-05 16:15:35487 days ago1730823335IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007823514.50317416
Sell211224512024-11-05 15:49:47487 days ago1730821787IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007146513.24818086
Sell210893312024-11-01 0:52:35492 days ago1730422355IN
0x83FBCF46...0c1Abcb57
0 ETH0.000304015.63582684
Buy210872552024-10-31 17:56:11492 days ago1730397371IN
0x83FBCF46...0c1Abcb57
0.005 ETH0.0008223912.93121574
Approve210867272024-10-31 16:10:23492 days ago1730391023IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007942616.00210057
Approve210867162024-10-31 16:08:11492 days ago1730390891IN
0x83FBCF46...0c1Abcb57
0 ETH0.0007925815.96835033
Approve210867032024-10-31 16:05:35492 days ago1730390735IN
0x83FBCF46...0c1Abcb57
0 ETH0.0008064216.24707988
Approve210866662024-10-31 15:58:11492 days ago1730390291IN
0x83FBCF46...0c1Abcb57
0 ETH0.0006203712.49870643
Approve210866562024-10-31 15:56:11492 days ago1730390171IN
0x83FBCF46...0c1Abcb57
0 ETH0.000666313.42738474
Sell210865392024-10-31 15:32:47492 days ago1730388767IN
0x83FBCF46...0c1Abcb57
0 ETH0.0010801122
Sell210865082024-10-31 15:26:35492 days ago1730388395IN
0x83FBCF46...0c1Abcb57
0 ETH0.0011857122
View all transactions

Latest 21 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer211226272024-11-05 16:25:11487 days ago1730823911
0x83FBCF46...0c1Abcb57
0.00283555 ETH
Transfer211226232024-11-05 16:24:23487 days ago1730823863
0x83FBCF46...0c1Abcb57
0.00260839 ETH
Transfer211226222024-11-05 16:24:11487 days ago1730823851
0x83FBCF46...0c1Abcb57
0.0023461 ETH
Transfer211226202024-11-05 16:23:47487 days ago1730823827
0x83FBCF46...0c1Abcb57
0.00315825 ETH
Transfer211226192024-11-05 16:23:35487 days ago1730823815
0x83FBCF46...0c1Abcb57
0.00467049 ETH
Transfer211226182024-11-05 16:23:23487 days ago1730823803
0x83FBCF46...0c1Abcb57
0.0044111 ETH
Transfer211226162024-11-05 16:22:59487 days ago1730823779
0x83FBCF46...0c1Abcb57
0.00378789 ETH
Transfer211226142024-11-05 16:22:35487 days ago1730823755
0x83FBCF46...0c1Abcb57
0.00599177 ETH
Transfer211225882024-11-05 16:17:23487 days ago1730823443
0x83FBCF46...0c1Abcb57
0.0040901 ETH
Transfer211225862024-11-05 16:16:59487 days ago1730823419
0x83FBCF46...0c1Abcb57
0.00326874 ETH
Transfer211225842024-11-05 16:16:35487 days ago1730823395
0x83FBCF46...0c1Abcb57
0.00709612 ETH
Transfer211225832024-11-05 16:16:11487 days ago1730823371
0x83FBCF46...0c1Abcb57
0.00492651 ETH
Transfer211225802024-11-05 16:15:35487 days ago1730823335
0x83FBCF46...0c1Abcb57
0.01000075 ETH
Transfer211224512024-11-05 15:49:47487 days ago1730821787
0x83FBCF46...0c1Abcb57
0.04363354 ETH
Transfer210893312024-11-01 0:52:35492 days ago1730422355
0x83FBCF46...0c1Abcb57
0.01598983 ETH
Transfer210865392024-10-31 15:32:47492 days ago1730388767
0x83FBCF46...0c1Abcb57
0.12545204 ETH
Transfer210865082024-10-31 15:26:35492 days ago1730388395
0x83FBCF46...0c1Abcb57
0.01256102 ETH
Transfer210864292024-10-31 15:10:47492 days ago1730387447
0x83FBCF46...0c1Abcb57
0.04904635 ETH
Transfer210863902024-10-31 15:02:59492 days ago1730386979
0x83FBCF46...0c1Abcb57
0.00999999 ETH
Add Liquidity210863842024-10-31 15:01:47492 days ago1730386907
0x83FBCF46...0c1Abcb57
0.03 ETH
0x60806040210863842024-10-31 15:01:47492 days ago1730386907  Contract Creation0 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Minimal Proxy Contract for 0xfe9c3de448bc3c1420e8230b2ad3fa875d49e434

Contract Name:
BlankERC314

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2024-09-29
*/

/**
 *Submitted for verification at Etherscan.io on 2024-06-04
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title ERC314
 * @dev Implementation of the ERC314 interface.
 * ERC314 is a derivative of ERC20 which aims to integrate a liquidity pool on the token in order to enable native swaps, notably to reduce gas consumption.
 */

// Events interface for ERC314
interface IEERC314 {
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event AddLiquidity(uint32 _timeTillUnlockLiquidity, uint256 value);
    event RemoveLiquidity(uint256 value);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
}

interface IFactory {
    function getOwner() external view returns (address);
}

struct Opt {
    uint32 timeTillUnlockLiquidity;
    bool tradingEnable;
    bool liquidityAdded;
    bool maxWalletEnable;
    bool feeDisable;
    bool ownerRenounced;
    bool liquidityProviderRenounced;
    bool feeCollectorRenounced;
    uint16 fee;
}

abstract contract ERC314Implementation is IEERC314 {
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;

    Opt private _opt;

    uint256 public maxWallet;

    address private _liquidityProvider;
    address private _feeCollector;

    mapping(address => uint32) public lastTransaction;
    uint256 public accruedFeeAmount;

    modifier onlyOwner() {
        require(msg.sender == this.owner(), "Ownable: caller is not the owner");
        _;
    }

    modifier onlyLiquidityProvider() {
        require(
            msg.sender == this.liquidityProvider(),
            "You are not the liquidity provider"
        );
        _;
    }

    modifier onlyFeeCollector() {
        require(msg.sender == this.feeCollector(), "You are not the fee collector");
        _;
    }

    function initialize(uint256 percentSupplyDeployer) external {
        require(_balances[address(this)] == 0);
        address _owner = this.owner();
        uint _totalSupply = this.totalSupply();
        _balances[_owner] = _totalSupply *percentSupplyDeployer/ 100;
        uint256 liquidityAmount = _totalSupply - _balances[_owner];
        _balances[address(this)] = liquidityAmount;
    }

    function factory() public view virtual returns (address) {
        assembly {
            extcodecopy(address(), sub(0x20, 0x14), 0x2d, 0x14)
            return(0x0, 0x20)
        }
    }

    function owner() public view virtual returns (address) {
        if (_opt.ownerRenounced) return address(0);
        assembly {
            extcodecopy(address(), sub(0x20, 0x14), 0x41, 0x14)
            return(0x0, 0x20)
        }
    }

    function totalSupply() public view virtual returns (uint _totalSupply) {
        assembly {
            extcodecopy(address(), 0x20, 0x55, 0x4)
            let lengths := mload(0x20)
            let offset := add(0x55, 0x4)
            let length := byte(0x0, lengths)
            extcodecopy(address(), sub(0x20, length), offset, length)
            _totalSupply := mload(0x0)
        }
        return _totalSupply - _balances[address(0)];
    }

    function fee() public view virtual returns (uint16) {
        if (_opt.feeDisable) return 0;
        if (_opt.fee != 0) return _opt.fee;
        assembly {
            extcodecopy(address(), 0x20, 0x55, 0x4)
            let lengths := mload(0x20)
            let offset := add(0x55, 0x4)
            offset := add(offset, byte(0x0, lengths))
            let length := byte(0x1, lengths)
            extcodecopy(address(), sub(0x20, length), offset, length)
            return(0x0, 0x20)
        }
    }

    function name() public view virtual returns (string memory) {
        assembly {
            extcodecopy(address(), 0x20, 0x55, 0x4)
            let lengths := mload(0x20)
            let offset := add(0x55, 0x4)
            offset := add(offset, byte(0x0, lengths))
            offset := add(offset, byte(0x1, lengths))
            let length := byte(0x2, lengths)
            mstore(0x40, 0x0)
            extcodecopy(address(), 0x40, offset, length)
            mstore(0x0, 0x20)
            mstore(0x20, length)
            return(0x0, 0x60)
        }
    }

    function symbol() public view virtual returns (string memory) {
        assembly {
            extcodecopy(address(), 0x20, 0x55, 0x4)
            let lengths := mload(0x20)
            let offset := add(0x55, 0x4)
            offset := add(offset, byte(0x0, lengths))
            offset := add(offset, byte(0x1, lengths))
            offset := add(offset, byte(0x2, lengths))
            let length := byte(0x3, lengths)
            mstore(0x40, 0x0)
            extcodecopy(address(), 0x40, offset, length)
            mstore(0x0, 0x20)
            mstore(0x20, length)
            return(0x0, 0x60)
        }
    }

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

    function WETH() public pure virtual returns (address) {
        return address(0x4200000000000000000000000000000000000006);
    }

    function token0() public pure virtual returns (address) {
        return address(0x4200000000000000000000000000000000000006);
    }

    function token1() public view virtual returns (address) {
        return address(this);
    }

    function liquidityProvider() public view virtual returns (address) {
        if (_opt.liquidityProviderRenounced) return address(0);
        if (_liquidityProvider != address(0)) return _liquidityProvider;
        return this.owner();
    }

    function feeCollector() public view virtual returns (address) {
        if (_opt.feeCollectorRenounced) return address(0);
        if (_feeCollector != address(0)) return _feeCollector;
        return this.owner();
    }

    function timeTillUnlockLiquidity() public view virtual returns (uint32) {
        return _opt.timeTillUnlockLiquidity;
    }

    function tradingEnable() public view virtual returns (bool) {
        return _opt.tradingEnable;
    }

    function liquidityAdded() public view virtual returns (bool) {
        return _opt.liquidityAdded;
    }

    function maxWalletEnable() public view virtual returns (bool) {
        return _opt.maxWalletEnable;
    }
 
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

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

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

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

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) public virtual returns (bool) {
        require(_allowances[from][msg.sender] >= value, "ERC314: transfer amount exceeds allowance");
        _transfer(from, to, value);
        _approve(from, msg.sender, _allowances[from][msg.sender] - value);
        return true;
    }

    function _approve(address _owner, address spender, uint256 value) internal virtual {
        require(_owner != address(0), "ERC314: approve from the zero address");
        require(spender != address(0), "ERC314: approve to the zero address");

        _allowances[_owner][spender] = value;
        emit Approval(_owner, spender, value);
    }

    function _transfer(
        address from,
        address to,
        uint256 value
    ) internal virtual {

        require(
            _balances[from] >= value,
            "ERC20: transfer amount exceeds balance"
        );

        unchecked {
            _balances[from] -= value;
        }

        unchecked {
            _balances[to] += value;
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Returns the amount of ETH and tokens in the contract, used for trading.
     */
    function getReserves() public view returns (uint256, uint256) {
        return (
            (address(this).balance - accruedFeeAmount),
            _balances[address(this)]
        );
    }


    /**
     *
     * @dev Sets the new fee collector
     * @param _newFeeCollector the new fee collector
     * onlyOwner modifier
     */
    function setFeeCollector(address _newFeeCollector) external onlyOwner {
        _feeCollector = _newFeeCollector;
        if (_newFeeCollector == address(0)) _opt.feeCollectorRenounced = true;
        if (_newFeeCollector != address(0)) _opt.feeCollectorRenounced = false;
    }

    /**
     * @dev Transfers the ownership of the contract to zero address
     * onlyOwner modifier
     */
    function renounceOwnership() external onlyOwner {
        if (!_opt.feeCollectorRenounced && _feeCollector == address(0)) _feeCollector = this.owner();
        if (!_opt.liquidityProviderRenounced && _liquidityProvider == address(0)) _liquidityProvider = this.owner();
        _opt.ownerRenounced = true;
    }

    /**
     *
     * @dev Sets the new liquidity provider
     * @param _newLiquidityProvider the new liquidity provider
     * onlyLiquidityProvider modifier
     */
    function setLiquidityProvider(
        address _newLiquidityProvider
    ) external onlyLiquidityProvider {
        _liquidityProvider = _newLiquidityProvider;
        if (_newLiquidityProvider == address(0)) _opt.liquidityProviderRenounced = true;
        if (_newLiquidityProvider != address(0)) _opt.liquidityProviderRenounced = false;
    }

    /**
     * @dev Adds liquidity to the contract.
     * @param _timeTillUnlockLiquidity: the block timestamp to unlock the liquidity.
     * value: the amount of ETH to add to the liquidity.
     * onlyLiquidityProvider modifier
     */
    function addLiquidity(
        uint32 _timeTillUnlockLiquidity
    ) public payable  {
        require(_opt.liquidityAdded == false, "Liquidity already added");

        _opt.liquidityAdded = true;

        require(msg.value > 0, "No ETH sent");


        _opt.timeTillUnlockLiquidity = _timeTillUnlockLiquidity;
        _opt.tradingEnable = true;

        emit AddLiquidity(_timeTillUnlockLiquidity, msg.value);
    }

    /**
     * @dev Removes liquidity from the contract.
     * onlyLiquidityProvider modifier
     */
    /**
     * @dev Estimates the amount of tokens or ETH to receive when buying or selling.
     * @param value: the amount of ETH or tokens to swap.
     * @param _buyBool: true if buying, false if selling.
     */
    function getAmountOut(
        uint256 value,
        bool _buyBool
    ) public view returns (uint256) {
        (uint256 reserveETH, uint256 reserveToken) = getReserves();

        if (_buyBool) {
            uint256 valueAfterFee = (value * (10000 - _opt.fee)) / 10000;
            return ((valueAfterFee * reserveToken)) / (reserveETH + valueAfterFee);
        } else {
            uint256 ethValue = ((value * reserveETH)) / (reserveToken + value);
            ethValue = (ethValue * (10000 - _opt.fee)) / 10000;
            return ethValue;
        }
    }

    /**
     * @dev Buys tokens with ETH.
     * internal function
     */
    function buy(uint256 amountOutMin) public payable {
        require(_opt.tradingEnable, "Trading not enable");

        uint256 feeAmount = (msg.value * _opt.fee) / 10000;

        uint256 ETHafterFee;
        unchecked {
            ETHafterFee = msg.value - feeAmount;
        }

        unchecked {
            accruedFeeAmount += feeAmount;
        }
        (uint256 reserveETH, uint256 reserveToken) = getReserves();

        uint256 tokenAmount = (ETHafterFee * reserveToken) / reserveETH;
        require(tokenAmount > 0, "Bought amount too low");

        if (_opt.maxWalletEnable) {
            require(
                tokenAmount + _balances[msg.sender] <= maxWallet,
                "Max wallet exceeded"
            );
        }

        require(tokenAmount >= amountOutMin, "slippage reached");

        _transfer(address(this), msg.sender, tokenAmount);

        emit Swap(msg.sender, msg.value, 0, 0, tokenAmount,msg.sender);
    }

    // Modify the claimFees function to distribute fees accordingly
    function claimFees() external {
        uint256 totalAccruedAmount = accruedFeeAmount;
        if (totalAccruedAmount > address(this).balance) {
            totalAccruedAmount = address(this).balance;
        }

        uint256 factoryShare = (totalAccruedAmount * 40) / 100; // 40% to factory owner
        uint256 ownerShare = totalAccruedAmount - factoryShare;

        accruedFeeAmount = 0;

        if(factoryShare > 0) {
            (bool successFactory, ) = payable(IFactory(this.factory()).getOwner()).call{value: factoryShare}("");
            require(successFactory, "Transfer of factory share failed");
        }

        (bool successOwner, ) = payable(feeCollector()).call{value: ownerShare}("");
        require(successOwner, "Transfer of owner share failed");
    }


    /**
     * @dev Sells tokens for ETH.
     * internal function
     */
    function sell(uint256 sellAmount, uint256 amountOutMin) public {
        require(_opt.tradingEnable, "Trading not enable");

        (uint256 reserveETH, uint256 reserveToken) = getReserves();

        uint256 ethAmount = (sellAmount * reserveETH) /
            (reserveToken + sellAmount);

        require(reserveETH >= ethAmount, "Insufficient ETH in reserves");

        uint256 feeAmount = (ethAmount * _opt.fee) / 10000;

        unchecked {
            ethAmount -= feeAmount;
        }
        require(ethAmount > 0, "Sell amount too low");
        require(ethAmount >= amountOutMin, "slippage reached");

        unchecked {
            accruedFeeAmount += feeAmount;
        }

        _transfer(msg.sender, address(this), sellAmount);

        (bool success, ) = payable(msg.sender).call{value: ethAmount}("");
        if (!success) {
            revert("Could not sell");
        }

        emit Swap(msg.sender, 0, sellAmount, ethAmount, 0, msg.sender);
    }

}

// free function to determine bytes needed to store some number
function bytesNeeded(uint x) pure returns (uint8) {
    for (uint i; i < 8; i++) x |= x >> (1 << i);
    unchecked { x = x 
        * 0xFF7E7D7C7B7A79787767574737271706D6C6A6968665646261605514941211 
        >> 248; }
    return uint8(bytes(
        hex'00D201EDD37F02F6EED4CAA8804403FBF7EFC2DFD5CB77BDA9918161452504FC'
        hex'F3F8BAF0E5C36FE8E0D6B2CCA0783CC6BEAEAA9A9282677262524636261605FD'
        hex'EBF4A6F9DDBB5FF1E3E69EC4987034E9DBE196D9D7B357CDB5A18979593D1DCF'
        hex'C7BF8EB7AFAB4FA39B93868B83682C7B736B635B534B473F372F271F170F06FE'
        hex'D1EC7EF5C9A743FAC1DE76BC906024F2B9E46EE7B19F3BC5AD996671513515EA'
        hex'A5DC5EE29D9733DA95D856B488581CCE8DB64EA2858A2B7A6A5A4A3E2E1E0ED0'
        hex'7DC842C0758F23B86DB03AAC655014A45D9C329455871B8C4D842A69492D0D7C'
        hex'4174226C3964135C31541A4C29480C402138123019280B2011180A10090807FF'
        )[x]) / 8 + 1; }

contract BlankERC314 is ERC314Implementation {
    constructor() {}
}

contract EVToken is ERC314Implementation {
    constructor(
        address implementation,
        address factory,
        address owner,
        uint totalSupply,
        uint fee,
        string memory name,
        string memory symbol
    ) {
        require(fee <= 500, "max 5% fee");
        require(bytes(symbol).length <= 32, "symbol too long");
        require(bytes(name).length <= 32, "name too long");

        uint sizeCursor;
        assembly { sizeCursor := mload(0x40) }
        uint byteCursor = sizeCursor;
        uint byteCursorInit = byteCursor;

        uint erc1167Left = 0x363d3d373d3d3d363d73;
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, 0xa)), erc1167Left)) }
        sizeCursor += 0xa;
        byteCursor += 0xa;
        assembly { mstore(0x40, add(mload(0x40), 0xa)) }

        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, 0x14)), implementation)) }
        sizeCursor += 0x14;
        byteCursor += 0x14;
        assembly { mstore(0x40, add(mload(0x40), 0x14)) }

        uint erc1167Right = 0x5af43d82803e903d91602b57fd5bf3;
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, 0xf)), erc1167Right)) }
        sizeCursor += 0xf;
        byteCursor += 0xf;
        assembly { mstore(0x40, add(mload(0x40), 0xf)) }
        
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, 0x14)), factory)) }
        sizeCursor += 0x14;
        byteCursor += 0x14;
        assembly { mstore(0x40, add(mload(0x40), 0x14)) }
        
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, 0x14)), owner)) }
        sizeCursor += 0x14;
        byteCursor += 0x14;
        assembly { mstore(0x40, add(mload(0x40), 0x14)) }

        byteCursor += 0x4;

        uint8 totalSupplyBytesNeeded = bytesNeeded(totalSupply);
        assembly { mstore8(sizeCursor, totalSupplyBytesNeeded) }
        sizeCursor += 0x1;
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, totalSupplyBytesNeeded)), totalSupply)) }
        byteCursor += totalSupplyBytesNeeded;
        assembly { mstore(0x40, add(mload(0x40), add(0x1, totalSupplyBytesNeeded))) }

        uint8 feeBytesNeeded = bytesNeeded(fee);
        assembly { mstore8(sizeCursor, feeBytesNeeded) }
        sizeCursor += 0x1;
        assembly { mstore(byteCursor, shl(mul(0x8, sub(0x20, feeBytesNeeded)), fee)) }
        byteCursor += feeBytesNeeded;
        assembly { mstore(0x40, add(mload(0x40), add(0x1, feeBytesNeeded))) }

        uint8 nameBytesNeeded = uint8(bytes(name).length);
        assembly { mstore8(sizeCursor, nameBytesNeeded) }
        sizeCursor += 0x1;
        assembly { mstore(byteCursor, mload(add(0x20, name))) }
        byteCursor += nameBytesNeeded;
        assembly { mstore(0x40, add(mload(0x40), add(0x1, nameBytesNeeded))) }

        uint8 symbolBytesNeeded = uint8(bytes(symbol).length);
        assembly { mstore8(sizeCursor, symbolBytesNeeded) }
        sizeCursor += 0x1;
        assembly { mstore(byteCursor, mload(add(0x20, symbol))) }
        byteCursor += symbolBytesNeeded;
        assembly { mstore(0x40, add(mload(0x40), add(0x1, symbolBytesNeeded))) }

        assembly { return(byteCursorInit, sub(byteCursor, byteCursorInit)) }
    }
}

contract ERC314Factory {
    address[] public allTokens;
    address public owner;
    uint public deployFee;
    uint16 public split;
    uint public accruedFeeAmount;
    address public evFeeCollector;
    address public dzhvFeeCollector;

    constructor(uint _deployFee, uint16 _split, address _evFeeCollector, address _dzhvFeeCollector) {
        require(_split <= 10000, "split cannot exceed 100%");
        owner = msg.sender;
        // implementation = new BlankERC314();
        deployFee = _deployFee;
        split = _split;
        evFeeCollector = _evFeeCollector;
        dzhvFeeCollector = _dzhvFeeCollector;
    }

    event TokenCreated(address tokenAddress);

    function createERC314(
        string memory name,
        string memory symbol,
        uint256 fee
    ) public payable {
        require(msg.value >= deployFee, "deployment fee not paid");
        require(msg.value < (2e18+deployFee), "buy all supply");

        accruedFeeAmount += deployFee;
        EVToken newToken = new EVToken(
            address(0xA16b6a3C251AF9c29080A04Bd20F6687d116072d),
            address(this),
            msg.sender,
            1000000000e18,
            fee,
            name,
            symbol
        );
        
        // Add liquidity with the remaining value after deployFee
        uint256 remainingValue = msg.value - deployFee;
        uint256 deployerSupplyPercentage = remainingValue*100/2e18;
        newToken.initialize(deployerSupplyPercentage);
        (bool success, ) = address(newToken).call{value: remainingValue}(
            abi.encodeWithSignature("addLiquidity(uint32)", 0)
        );

        require(success, "addLiquidity failed");
        // allTokens.push(address(newToken));
        emit TokenCreated(address(newToken));
    }

    modifier onlyOwner() {
        require(msg.sender == this.owner(), "Ownable: caller is not the owner");
        _;
    }

    function setDeployFee(uint _newDeployFee) external onlyOwner {
        deployFee = _newDeployFee;
    }

    function claimFees() external {
        uint256 totalAccruedAmount = accruedFeeAmount;
        if (totalAccruedAmount > address(this).balance) {
            totalAccruedAmount = address(this).balance;
        }

        uint256 evTeamShare = (totalAccruedAmount * split) / 10000;
        uint256 dzhvTeamShare = totalAccruedAmount - evTeamShare;

        accruedFeeAmount = 0;

        (bool successEvFeeCollect, ) = payable(evFeeCollector).call{value: evTeamShare}("");
        require(successEvFeeCollect, "Transfer of EV team share failed");

        (bool successDzhvFeeCollect, ) = payable(dzhvFeeCollector).call{value: dzhvTeamShare}("");
        require(successDzhvFeeCollect, "Transfer of DZHV team share failed");
    }

    // Add function to retrieve factory owner for fee distribution
    function getOwner() external view returns (address) {
        return owner;
    }

    function setFeesWallet(address _evWallet, address _dzhvWallet) external onlyOwner {
        evFeeCollector = _evWallet;
        dzhvFeeCollector = _dzhvWallet;
    }

}

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"_timeTillUnlockLiquidity","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"AddLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"RemoveLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1In","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0Out","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Out","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"accruedFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_timeTillUnlockLiquidity","type":"uint32"}],"name":"addLiquidity","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bool","name":"_buyBool","type":"bool"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"percentSupplyDeployer","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastTransaction","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityAdded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityProvider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWalletEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint256","name":"sellAmount","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"}],"name":"sell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFeeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newLiquidityProvider","type":"address"}],"name":"setLiquidityProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timeTillUnlockLiquidity","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.