WETH
Unichain ERC-20 Token0x4200000000000000000000000000000000000006
Solidity v0.8.15+commit.e14f2714
Fungible token following the ERC-20 standard.
概览
读取函数
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. |
Returns the balance of the given address.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The balance of the given address. |
Returns the number of decimals the token uses.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint8 | The number of decimals the token uses. |
Returns the name of the wrapped native asset. Will be "Wrapped Ether" if the native asset is Ether.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| name_ | string |
Returns the symbol of the wrapped native asset. Will be "WETH" if the native asset is Ether.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| symbol_ | string |
Returns the total supply of WETH.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The total supply of WETH. |
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. |
写入函数
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. |
Allows WETH to be deposited by sending ether to the contract.
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. |
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. |
Withdraws an amount of ETH.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| wad | uint256 | The amount of ETH to withdraw. |
事件
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. |
Emitted when a deposit is made.
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| dst | address | ✓ | The address that deposited the WETH. |
| wad | uint256 | The amount of WETH that was deposited. |
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. |
Emitted when a withdrawal is made.
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| src | address | ✓ | The address that withdrew the WETH. |
| wad | uint256 | The amount of WETH that was withdrawn. |