WETH

Unichain ERC-20 Token

0x4200000000000000000000000000000000000006

Solidity v0.8.15+commit.e14f2714

Fungible token following the ERC-20 standard.

🤖
透過你的 AI 查詢此合約
參考: 0x4200000000000000000000000000000000000006
範例提示詞: "Tell me the current state of unichain/0x4200000000000000000000000000000000000006"
還沒有接入 AI?→ mcp.smarts.md
Unichain 在 Smarts 上是僅文件鏈:原始碼和 ABI 已索引,但目前不提供即時鏈上資料(狀態、最新事件、管理員概覽)。AI 代理仍可透過 MCP 呼叫 get_contract_info 和 get_contract_source。

概覽

讀取函式
7
寫入函式
5
事件
4

讀取函式

allowance(address, address) view

Returns the amount of WETH that the spender can transfer on behalf of the owner.

參數

名稱 類型 描述
address
address

回傳值

名稱 類型 描述
uint256 The amount of WETH that the spender can transfer on behalf of the owner.
balanceOf(address) view

Returns the balance of the given address.

參數

名稱 類型 描述
address

回傳值

名稱 類型 描述
uint256 The balance of the given address.
decimals() view

Returns the number of decimals the token uses.

回傳值

名稱 類型 描述
uint8 The number of decimals the token uses.
name() view

Returns the name of the wrapped native asset. Will be "Wrapped Ether" if the native asset is Ether.

回傳值

名稱 類型 描述
name_ string
symbol() view

Returns the symbol of the wrapped native asset. Will be "WETH" if the native asset is Ether.

回傳值

名稱 類型 描述
symbol_ string
totalSupply() view

Returns the total supply of WETH.

回傳值

名稱 類型 描述
uint256 The total supply of WETH.
version() view

Getter for the semantic version of the contract. This is not meant to be used onchain but instead meant to be used by offchain tooling.

回傳值

名稱 類型 描述
string Semver contract version as a string.

寫入函式

approve(guy: address, wad: uint256) nonpayable

Approves the given address to transfer the WETH on behalf of the caller.

參數

名稱 類型 描述
guy address The address that is approved to transfer the WETH.
wad uint256 The amount that is approved to transfer.

回傳值

名稱 類型 描述
bool True if the approval was successful.
deposit() payable

Allows WETH to be deposited by sending ether to the contract.

transfer(dst: address, wad: uint256) nonpayable

Transfers the given amount of WETH to the given address.

參數

名稱 類型 描述
dst address The address to transfer the WETH to.
wad uint256 The amount of WETH to transfer.

回傳值

名稱 類型 描述
bool True if the transfer was successful.
transferFrom(src: address, dst: address, wad: uint256) nonpayable

Transfers the given amount of WETH from the given address to the given address.

參數

名稱 類型 描述
src address The address to transfer the WETH from.
dst address The address to transfer the WETH to.
wad uint256 The amount of WETH to transfer.

回傳值

名稱 類型 描述
bool True if the transfer was successful.
withdraw(wad: uint256) nonpayable

Withdraws an amount of ETH.

參數

名稱 類型 描述
wad uint256 The amount of ETH to withdraw.

事件

Approval(src: address, guy: address, wad: uint256)

Emitted when an approval is made.

名稱 類型 已索引 描述
src address The address that approved the transfer.
guy address The address that was approved to transfer.
wad uint256 The amount that was approved to transfer.
Deposit(dst: address, wad: uint256)

Emitted when a deposit is made.

名稱 類型 已索引 描述
dst address The address that deposited the WETH.
wad uint256 The amount of WETH that was deposited.
Transfer(src: address, dst: address, wad: uint256)

Emitted when a transfer is made.

名稱 類型 已索引 描述
src address The address that transferred the WETH.
dst address The address that received the WETH.
wad uint256 The amount of WETH that was transferred.
Withdrawal(src: address, wad: uint256)

Emitted when a withdrawal is made.

名稱 類型 已索引 描述
src address The address that withdrew the WETH.
wad uint256 The amount of WETH that was withdrawn.