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.