WETH
Unichain ERC-20 Token0x4200000000000000000000000000000000000006
Solidity v0.8.15+commit.e14f2714
Fungible token following the ERC-20 standard.
Overview
Read Functions
Returns the amount of WETH that the spender can transfer on behalf of the owner.
Parameters
| Name | Type | Description |
|---|---|---|
| — | address | |
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The amount of WETH that the spender can transfer on behalf of the owner. |
Returns the balance of the given address.
Parameters
| Name | Type | Description |
|---|---|---|
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The balance of the given address. |
Returns the number of decimals the token uses.
Returns
| Name | Type | Description |
|---|---|---|
| — | 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.
Returns
| Name | Type | Description |
|---|---|---|
| name_ | string |
Returns the symbol of the wrapped native asset. Will be "WETH" if the native asset is Ether.
Returns
| Name | Type | Description |
|---|---|---|
| symbol_ | string |
Returns the total supply of WETH.
Returns
| Name | Type | Description |
|---|---|---|
| — | 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.
Returns
| Name | Type | Description |
|---|---|---|
| — | string | Semver contract version as a string. |
Write Functions
Approves the given address to transfer the WETH on behalf of the caller.
Parameters
| Name | Type | Description |
|---|---|---|
| guy | address | The address that is approved to transfer the WETH. |
| wad | uint256 | The amount that is approved to transfer. |
Returns
| Name | Type | Description |
|---|---|---|
| — | 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.
Parameters
| Name | Type | Description |
|---|---|---|
| dst | address | The address to transfer the WETH to. |
| wad | uint256 | The amount of WETH to transfer. |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool | True if the transfer was successful. |
Transfers the given amount of WETH from the given address to the given address.
Parameters
| Name | Type | Description |
|---|---|---|
| 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. |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool | True if the transfer was successful. |
Withdraws an amount of ETH.
Parameters
| Name | Type | Description |
|---|---|---|
| wad | uint256 | The amount of ETH to withdraw. |
Events
Emitted when an approval is made.
| Name | Type | Indexed | Description |
|---|---|---|---|
| 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.
| Name | Type | Indexed | Description |
|---|---|---|---|
| dst | address | ✓ | The address that deposited the WETH. |
| wad | uint256 | The amount of WETH that was deposited. |
Emitted when a transfer is made.
| Name | Type | Indexed | Description |
|---|---|---|---|
| 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.
| Name | Type | Indexed | Description |
|---|---|---|---|
| src | address | ✓ | The address that withdrew the WETH. |
| wad | uint256 | The amount of WETH that was withdrawn. |