ERC-20
Governance
Overview
Max Total Supply
10,000,000 AGT
Holders
71 (0.00%)
Market
Price
$0.02 @ 0.000005 ETH
Onchain Market Cap
$176,197.10
Circulating Supply Market Cap
$0.00
Other Info
Token Contract (WITH 18 Decimals)
Balance
206.612206511032070212 AGTValue
$3.64 ( ~0.0010913145491719 Eth) [0.0021%]Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AntfarmGovernanceToken
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.10; import "@rari-capital/solmate/src/tokens/ERC20.sol"; contract AntfarmGovernanceToken is ERC20 { constructor() ERC20("Antfarm Governance Token", "AGT", 18) { _mint(msg.sender, 10_000_000 ether); } }
// 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); } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","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":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","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":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b50604080518082018252601881527f416e746661726d20476f7665726e616e636520546f6b656e00000000000000006020808301918252835180850190945260038452621051d560ea1b908401528151919291601291620000769160009190620001d0565b5081516200008c906001906020850190620001d0565b5060ff81166080524660a052620000a2620000c7565b60c05250620000c191503390506a084595161401484a00000062000163565b6200037e565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6000604051620000fb9190620002b3565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b806002600082825462000177919062000357565b90915550506001600160a01b0382166000818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b828054620001de9062000276565b90600052602060002090601f0160209004810192826200020257600085556200024d565b82601f106200021d57805160ff19168380011785556200024d565b828001600101855582156200024d579182015b828111156200024d57825182559160200191906001019062000230565b506200025b9291506200025f565b5090565b5b808211156200025b576000815560010162000260565b600181811c908216806200028b57607f821691505b60208210811415620002ad57634e487b7160e01b600052602260045260246000fd5b50919050565b600080835481600182811c915080831680620002d057607f831692505b6020808410821415620002f157634e487b7160e01b86526022600452602486fd5b8180156200030857600181146200031a5762000349565b60ff1986168952848901965062000349565b60008a81526020902060005b86811015620003415781548b82015290850190830162000326565b505084890196505b509498975050505050505050565b600082198211156200037957634e487b7160e01b600052601160045260246000fd5b500190565b60805160a05160c051610aca620003ae600039600061044501526000610410015260006101490152610aca6000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107f9565b60405180910390f35b61010a61010536600461086a565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610894565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108d0565b60036020526000908152604090205481565b6101236101b33660046108d0565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461086a565b610474565b6101f36101ee3660046108f2565b6104ec565b005b610123610203366004610965565b600460209081526000928352604080842090915290825290205481565b6000805461022d90610998565b80601f016020809104026020016040519081016040528092919081815260200182805461025990610998565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109d3565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109d3565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000046146104425761043d61075f565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461022d90610998565b336000908152600360205260408120805483919083906104959084906109d3565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e0830190915280519201919091207f19010000000000000000000000000000000000000000000000000000000000006101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610674573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106aa5750876001600160a01b0316816001600160a01b0316145b6106f65760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610538565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600060405161079191906109f8565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060208083528351808285015260005b818110156108265785810183015185820160400152820161080a565b81811115610838576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461086557600080fd5b919050565b6000806040838503121561087d57600080fd5b6108868361084e565b946020939093013593505050565b6000806000606084860312156108a957600080fd5b6108b28461084e565b92506108c06020850161084e565b9150604084013590509250925092565b6000602082840312156108e257600080fd5b6108eb8261084e565b9392505050565b600080600080600080600060e0888a03121561090d57600080fd5b6109168861084e565b96506109246020890161084e565b95506040880135945060608801359350608088013560ff8116811461094857600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561097857600080fd5b6109818361084e565b915061098f6020840161084e565b90509250929050565b600181811c908216806109ac57607f821691505b602082108114156109cd57634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156109f357634e487b7160e01b600052601160045260246000fd5b500390565b600080835481600182811c915080831680610a1457607f831692505b6020808410821415610a3457634e487b7160e01b86526022600452602486fd5b818015610a485760018114610a5957610a86565b60ff19861689528489019650610a86565b60008a81526020902060005b86811015610a7e5781548b820152908501908301610a65565b505084890196505b50949897505050505050505056fea2646970667358221220c222ccc8ab6373d362f00d078757552be40e7148b2dd37ededf9c9d4d495cc1d64736f6c634300080a0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806370a0823111610081578063a9059cbb1161005b578063a9059cbb146101cd578063d505accf146101e0578063dd62ed3e146101f557600080fd5b806370a08231146101855780637ecebe00146101a557806395d89b41146101c557600080fd5b806323b872dd116100b257806323b872dd14610131578063313ce567146101445780633644e5151461017d57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610220565b6040516100ee91906107f9565b60405180910390f35b61010a61010536600461086a565b6102ae565b60405190151581526020016100ee565b61012360025481565b6040519081526020016100ee565b61010a61013f366004610894565b61031a565b61016b7f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff90911681526020016100ee565b61012361040c565b6101236101933660046108d0565b60036020526000908152604090205481565b6101236101b33660046108d0565b60056020526000908152604090205481565b6100e1610467565b61010a6101db36600461086a565b610474565b6101f36101ee3660046108f2565b6104ec565b005b610123610203366004610965565b600460209081526000928352604080842090915290825290205481565b6000805461022d90610998565b80601f016020809104026020016040519081016040528092919081815260200182805461025990610998565b80156102a65780601f1061027b576101008083540402835291602001916102a6565b820191906000526020600020905b81548152906001019060200180831161028957829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103099086815260200190565b60405180910390a350600192915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146103765761035183826109d3565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061039e9084906109d3565b90915550506001600160a01b03808516600081815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103f99087815260200190565b60405180910390a3506001949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000146146104425761043d61075f565b905090565b507fddc4db474909b2792c0ec01bc0b87d624600ffc5ec9b2d35cf5a3de5279d2e9690565b6001805461022d90610998565b336000908152600360205260408120805483919083906104959084906109d3565b90915550506001600160a01b038316600081815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103099086815260200190565b428410156105415760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b6000600161054d61040c565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e0830190915280519201919091207f19010000000000000000000000000000000000000000000000000000000000006101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610674573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906106aa5750876001600160a01b0316816001600160a01b0316145b6106f65760405162461bcd60e51b815260206004820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152606401610538565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f600060405161079191906109f8565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060208083528351808285015260005b818110156108265785810183015185820160400152820161080a565b81811115610838576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461086557600080fd5b919050565b6000806040838503121561087d57600080fd5b6108868361084e565b946020939093013593505050565b6000806000606084860312156108a957600080fd5b6108b28461084e565b92506108c06020850161084e565b9150604084013590509250925092565b6000602082840312156108e257600080fd5b6108eb8261084e565b9392505050565b600080600080600080600060e0888a03121561090d57600080fd5b6109168861084e565b96506109246020890161084e565b95506040880135945060608801359350608088013560ff8116811461094857600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561097857600080fd5b6109818361084e565b915061098f6020840161084e565b90509250929050565b600181811c908216806109ac57607f821691505b602082108114156109cd57634e487b7160e01b600052602260045260246000fd5b50919050565b6000828210156109f357634e487b7160e01b600052601160045260246000fd5b500390565b600080835481600182811c915080831680610a1457607f831692505b6020808410821415610a3457634e487b7160e01b86526022600452602486fd5b818015610a485760018114610a5957610a86565b60ff19861689528489019650610a86565b60008a81526020902060005b86811015610a7e5781548b820152908501908301610a65565b505084890196505b50949897505050505050505056fea2646970667358221220c222ccc8ab6373d362f00d078757552be40e7148b2dd37ededf9c9d4d495cc1d64736f6c634300080a0033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.