OP

Optimism ERC-20 Token Browse chains

0x4200000000000000000000000000000000000042

Solidity v0.8.12+commit.f00d7308

Fungible token following the ERC-20 standard.

🤖
Query this contract from your AI
Reference: op-optimism 0x4200000000000000000000000000000000000042
Sample prompt: "Tell me the current state of op-optimism"
No AI wired up yet? → mcp.smarts.md · Browse chains

Admin & Risk

Who can change the rules?

Block #152,748,533

Detected mintable and ownable controls from the verified ABI.

Mintable Ownable

Current controls

Owner
0x5c4e7ba1e219e47948e6e3f55019a647ba501005 ↗ Etherscan → smarts

Recent governance

31749 privileged events loaded. Latest: DelegateVotesChanged at block #152,747,912.

Overview

Read Functions
15
Write Functions
13
Events
5

Read Functions

Block #152,748,533 · just now
DOMAIN_SEPARATOR() view → 0xd423c9c6b838296762a6bbf9663d4609148ea6bc83b5e94ce2c05615edc69072

Returns the EIP-712 domain separator used for signing typed data with this token.✨ AI

Returns

Name Type Description
bytes32 The EIP-712 domain separator as a bytes32 value used for typed-data signatures.✨ AI
allowance(owner: address, spender: address) view

Returns the remaining number of tokens that spender is allowed to spend on behalf of owner.✨ AI

dev: Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.

Parameters

Name Type Description
owner address Address of the token owner.✨ AI
spender address Address authorized to spend the owner's tokens.✨ AI

Returns

Name Type Description
uint256 Remaining allowance as a uint256 representing how many tokens the spender may transfer from owner.✨ AI
balanceOf(account: address) view

Returns the token balance of the specified account.✨ AI

dev: Returns the amount of tokens owned by `account`.

Parameters

Name Type Description
account address The address whose token balance will be returned.✨ AI

Returns

Name Type Description
uint256 The account's token balance as a uint256, expressed in the token's smallest unit.✨ AI
checkpoints(account: address, pos: uint32) view

Retrieve the historical checkpoint for an account at a given index.✨ AI

dev: Get the `pos`-th checkpoint for `account`.

Parameters

Name Type Description
account address Account whose checkpoint to fetch.✨ AI
pos uint32 Index of the checkpoint to return (0-based).✨ AI

Returns

Name Type Description
tuple Block number when the checkpoint was created.✨ AI
decimals() view → 18

Return the token's number of decimal places used for display and calculations.✨ AI

dev: Returns the decimals places of the token.

Returns

Name Type Description
uint8 The token's decimals as a uint8 representing how many decimal places to display.✨ AI
delegates(account: address) view

Returns the address to which the specified account has delegated its voting power.✨ AI

dev: Returns the delegate that `account` has chosen.

Parameters

Name Type Description
account address The account whose delegate address is being queried.✨ AI

Returns

Name Type Description
address The delegate address that receives the account's voting power, or the zero address if none.✨ AI
getPastTotalSupply(blockNumber: uint256) view

Get the total token supply as of the given past block.✨ AI

dev: Returns the total supply of votes available at the end of a past block (`blockNumber`). NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote.

Parameters

Name Type Description
blockNumber uint256 Block number to query the total supply at; must be less than the current block.✨ AI

Returns

Name Type Description
uint256 Total token supply at the specified block.✨ AI
getPastVotes(account: address, blockNumber: uint256) view

Return the number of votes held by account at the end of blockNumber.✨ AI

dev: Returns the amount of votes that `account` had at the end of a past block (`blockNumber`).

Parameters

Name Type Description
account address Address to query past voting power for.✨ AI
blockNumber uint256 Block number to read the historical vote balance at.✨ AI

Returns

Name Type Description
uint256 The vote count (uint256) that account had at the end of the given blockNumber.✨ AI
getVotes(account: address) view

Returns the current voting power for the specified account.✨ AI

dev: Returns the current amount of votes that `account` has.

Parameters

Name Type Description
account address Address whose voting balance is returned.✨ AI

Returns

Name Type Description
uint256 The account's current voting power as a uint256.✨ AI
name() view → Optimism

Returns the token's name as a human-readable string.✨ AI

dev: Returns the name of the token.

Returns

Name Type Description
string The token name (e.g., "GovernanceToken"), used for display and identification.✨ AI
nonces(owner: address) view

Returns the current permit nonce for owner, used to authorize permit signatures.✨ AI

dev: Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.

Parameters

Name Type Description
owner address Address to query the permit nonce for.✨ AI

Returns

Name Type Description
uint256 The current uint256 nonce for the address; increments to prevent replay of permit signatures.✨ AI
numCheckpoints(account: address) view

Get the number of checkpoints recorded for an account's voting history.✨ AI

dev: Get number of checkpoints for `account`.

Parameters

Name Type Description
account address Address whose checkpoint count to query.✨ AI

Returns

Name Type Description
uint32 The number of checkpoints (uint32) stored for the account, representing historical voting snapshots.✨ AI
owner() view → 0x5c4e7ba1e219e47948e6e3f55019a647ba501005

Returns the address of the current contract owner.✨ AI

dev: Returns the address of the current owner.

Returns

Name Type Description
address The address of the contract owner.✨ AI
symbol() view → OP

Returns the token's symbol as a short, human-readable identifier.✨ AI

dev: Returns the symbol of the token.

Returns

Name Type Description
string The token's symbol, a short human-readable string identifier (e.g., 'GOV').✨ AI
totalSupply() view → 4,294,963,292.49 OP

Returns the total number of GovernanceToken tokens in existence.✨ AI

dev: Returns the amount of tokens in existence.

Returns

Name Type Description
uint256 The total token supply as a uint256 (includes all tokens minted minus tokens burned).✨ AI

Write Functions

approve(spender: address, amount: uint256) nonpayable

Approve a spender to transfer up to amount of your tokens on your behalf.✨ AI

dev: Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.

Parameters

Name Type Description
spender address Address allowed to transfer tokens.✨ AI
amount uint256 Maximum number of tokens the spender may transfer.✨ AI

Returns

Name Type Description
bool True if the allowance was set successfully.✨ AI
burn(amount: uint256) nonpayable

Permanently destroys a specified amount of tokens from the caller's balance, reducing total supply.✨ AI

dev: Destroys `amount` tokens from the caller. See {ERC20-_burn}.

Parameters

Name Type Description
amount uint256 The number of tokens to burn, specified in the token's smallest unit.✨ AI
burnFrom(account: address, amount: uint256) nonpayable

Burn tokens from an account using the caller's allowance.✨ AI

dev: Destroys `amount` tokens from `account`, deducting from the caller's allowance. See {ERC20-_burn} and {ERC20-allowance}. Requirements: - the caller must have allowance for ``accounts``'s tokens of at least `amount`.

Parameters

Name Type Description
account address Address whose tokens will be burned.✨ AI
amount uint256 Amount of tokens to burn (in the token's smallest unit).✨ AI
decreaseAllowance(spender: address, subtractedValue: uint256) nonpayable

Decrease the allowance an approved spender can use by a specified amount.✨ AI

dev: Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.

Parameters

Name Type Description
spender address The account whose allowance will be decreased.✨ AI
subtractedValue uint256 The amount to subtract from the current allowance.✨ AI

Returns

Name Type Description
bool True if the allowance was decreased successfully.✨ AI
delegate(delegatee: address) nonpayable

Delegate this account's voting power to the specified address.✨ AI

dev: Delegates votes from the sender to `delegatee`.

Parameters

Name Type Description
delegatee address Address that will receive this account's voting power.✨ AI
delegateBySig(delegatee: address, nonce: uint256, expiry: uint256, v: uint8, r: bytes32, s: bytes32) nonpayable

Delegate your voting power to a delegatee using an off-chain signature.✨ AI

dev: Delegates votes from signer to `delegatee`.

Parameters

Name Type Description
delegatee address Address receiving delegated voting power.✨ AI
nonce uint256 Signer’s current nonce to prevent replay.✨ AI
expiry uint256 Timestamp after which the signature becomes invalid.✨ AI
v uint8 Signature recovery byte.✨ AI
r bytes32 First 32 bytes of the signature.✨ AI
s bytes32 Second 32 bytes of the signature.✨ AI
increaseAllowance(spender: address, addedValue: uint256) nonpayable

Increase the allowance the caller has granted to spender by addedValue.✨ AI

dev: Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.

Parameters

Name Type Description
spender address Address that will be permitted to spend the caller's tokens.✨ AI
addedValue uint256 Number of tokens to add to the spender's existing allowance.✨ AI

Returns

Name Type Description
bool True if the allowance was successfully increased.✨ AI
mint(_account: address, _amount: uint256) nonpayable

Mints new tokens to a specified account, increasing the total supply and that account's balance.✨ AI

Parameters

Name Type Description
_account address Address that will receive the newly minted tokens.✨ AI
_amount uint256 Amount of tokens to mint, expressed in the token's smallest unit.✨ AI
permit(owner: address, spender: address, value: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) nonpayable

Permit a spender to transfer the owner's tokens using an off-chain signature, setting allowance without a separate approval tx.✨ AI

dev: Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].

Parameters

Name Type Description
owner address Token holder whose signature authorizes the allowance.✨ AI
spender address Account approved to spend the owner's tokens.✨ AI
value uint256 Amount of tokens the spender is allowed to transfer.✨ AI
deadline uint256 Unix timestamp after which the signature is invalid.✨ AI
v uint8 Recovery byte of the owner's ECDSA signature.✨ AI
r bytes32 First 32 bytes of the owner's ECDSA signature.✨ AI
s bytes32 Second 32 bytes of the owner's ECDSA signature.✨ AI
renounceOwnership() nonpayable

Permanently renounces ownership of the contract, leaving no owner and disabling owner-only actions.✨ AI

dev: Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
transfer(to: address, amount: uint256) nonpayable

Transfer tokens from the caller to the specified recipient address.✨ AI

dev: Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.

Parameters

Name Type Description
to address Recipient address to receive the tokens.✨ AI
amount uint256 Amount of tokens to transfer, expressed in the token's smallest unit.✨ AI

Returns

Name Type Description
bool True if the transfer succeeded, otherwise false.✨ AI
transferFrom(from: address, to: address, amount: uint256) nonpayable

Transfers tokens from one address to another using the caller's allowance.✨ AI

dev: Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.

Parameters

Name Type Description
from address Address to debit tokens from (must have approved the caller).✨ AI
to address Address to credit tokens to.✨ AI
amount uint256 Amount of tokens to transfer, in the token's smallest unit.✨ AI

Returns

Name Type Description
bool true if the transfer succeeded.✨ AI
transferOwnership(newOwner: address) nonpayable

Transfer ownership of the contract to a new owner address.✨ AI

dev: Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.

Parameters

Name Type Description
newOwner address Address that will become the new owner of the contract.✨ AI

Events

Approval(owner: address, spender: address, value: uint256)
Name Type Indexed Description
owner address
spender address
value uint256
DelegateChanged(delegator: address, fromDelegate: address, toDelegate: address)
Name Type Indexed Description
delegator address
fromDelegate address
toDelegate address
DelegateVotesChanged(delegate: address, previousBalance: uint256, newBalance: uint256)
Name Type Indexed Description
delegate address
previousBalance uint256
newBalance uint256
OwnershipTransferred(previousOwner: address, newOwner: address)
Name Type Indexed Description
previousOwner address
newOwner address
Transfer(from: address, to: address, value: uint256)
Name Type Indexed Description
from address
to address
value uint256