OP

Optimism ERC-20 Token

0x4200000000000000000000000000000000000042

Solidity v0.8.12+commit.f00d7308

Fungible token following the ERC-20 standard.

🤖
透過你的 AI 查詢此合約
參考: op-optimism 0x4200000000000000000000000000000000000042
範例提示詞: "Tell me the current state of op-optimism"
還沒有接入 AI?→ mcp.smarts.md

管理與風險

誰能修改規則?

Block #152,088,272

Detected mintable and ownable controls from the verified ABI.

Mintable Ownable

當前控制

Owner
0x5c4e7ba1e219e47948e6e3f55019a647ba501005 ↗ Etherscan → smarts

近期治理

1342 privileged events loaded. 最新: DelegateVotesChanged at block #152,087,911.

概覽

讀取函式
15
寫入函式
13
事件
5

讀取函式

Block #152,088,272 · just now
DOMAIN_SEPARATOR() view → 0xd423c9c6b838296762a6bbf9663d4609148ea6bc83b5e94ce2c05615edc69072

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

回傳值

名稱 類型 描述
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

開發者: 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.

參數

名稱 類型 描述
owner address Address of the token owner.✨ AI
spender address Address authorized to spend the owner's tokens.✨ AI

回傳值

名稱 類型 描述
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

開發者: Returns the amount of tokens owned by `account`.

參數

名稱 類型 描述
account address The address whose token balance will be returned.✨ AI

回傳值

名稱 類型 描述
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

開發者: Get the `pos`-th checkpoint for `account`.

參數

名稱 類型 描述
account address Account whose checkpoint to fetch.✨ AI
pos uint32 Index of the checkpoint to return (0-based).✨ AI

回傳值

名稱 類型 描述
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

開發者: Returns the decimals places of the token.

回傳值

名稱 類型 描述
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

開發者: Returns the delegate that `account` has chosen.

參數

名稱 類型 描述
account address The account whose delegate address is being queried.✨ AI

回傳值

名稱 類型 描述
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

開發者: 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.

參數

名稱 類型 描述
blockNumber uint256 Block number to query the total supply at; must be less than the current block.✨ AI

回傳值

名稱 類型 描述
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

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

參數

名稱 類型 描述
account address Address to query past voting power for.✨ AI
blockNumber uint256 Block number to read the historical vote balance at.✨ AI

回傳值

名稱 類型 描述
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

開發者: Returns the current amount of votes that `account` has.

參數

名稱 類型 描述
account address Address whose voting balance is returned.✨ AI

回傳值

名稱 類型 描述
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

開發者: Returns the name of the token.

回傳值

名稱 類型 描述
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

開發者: 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.

參數

名稱 類型 描述
owner address Address to query the permit nonce for.✨ AI

回傳值

名稱 類型 描述
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

開發者: Get number of checkpoints for `account`.

參數

名稱 類型 描述
account address Address whose checkpoint count to query.✨ AI

回傳值

名稱 類型 描述
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

開發者: Returns the address of the current owner.

回傳值

名稱 類型 描述
address The address of the contract owner.✨ AI
symbol() view → OP

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

開發者: Returns the symbol of the token.

回傳值

名稱 類型 描述
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

開發者: Returns the amount of tokens in existence.

回傳值

名稱 類型 描述
uint256 The total token supply as a uint256 (includes all tokens minted minus tokens burned).✨ AI

寫入函式

approve(spender: address, amount: uint256) nonpayable

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

開發者: 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.

參數

名稱 類型 描述
spender address Address allowed to transfer tokens.✨ AI
amount uint256 Maximum number of tokens the spender may transfer.✨ AI

回傳值

名稱 類型 描述
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

開發者: Destroys `amount` tokens from the caller. See {ERC20-_burn}.

參數

名稱 類型 描述
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

開發者: 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`.

參數

名稱 類型 描述
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

開發者: 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`.

參數

名稱 類型 描述
spender address The account whose allowance will be decreased.✨ AI
subtractedValue uint256 The amount to subtract from the current allowance.✨ AI

回傳值

名稱 類型 描述
bool True if the allowance was decreased successfully.✨ AI
delegate(delegatee: address) nonpayable

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

開發者: Delegates votes from the sender to `delegatee`.

參數

名稱 類型 描述
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

開發者: Delegates votes from signer to `delegatee`.

參數

名稱 類型 描述
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

開發者: 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.

參數

名稱 類型 描述
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

回傳值

名稱 類型 描述
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

參數

名稱 類型 描述
_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

開發者: 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].

參數

名稱 類型 描述
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

開發者: 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

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

參數

名稱 類型 描述
to address Recipient address to receive the tokens.✨ AI
amount uint256 Amount of tokens to transfer, expressed in the token's smallest unit.✨ AI

回傳值

名稱 類型 描述
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

開發者: 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.

參數

名稱 類型 描述
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

回傳值

名稱 類型 描述
bool true if the transfer succeeded.✨ AI
transferOwnership(newOwner: address) nonpayable

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

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

參數

名稱 類型 描述
newOwner address Address that will become the new owner of the contract.✨ AI

事件

Approval(owner: address, spender: address, value: uint256)
名稱 類型 已索引 描述
owner address
spender address
value uint256
DelegateChanged(delegator: address, fromDelegate: address, toDelegate: address)
名稱 類型 已索引 描述
delegator address
fromDelegate address
toDelegate address
DelegateVotesChanged(delegate: address, previousBalance: uint256, newBalance: uint256)
名稱 類型 已索引 描述
delegate address
previousBalance uint256
newBalance uint256
OwnershipTransferred(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
Transfer(from: address, to: address, value: uint256)
名稱 類型 已索引 描述
from address
to address
value uint256