WrappedSonic

Sonic ERC-20 Token

0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38

Solidity v0.8.28+commit.7893614a

Fungible token following the ERC-20 standard.

🤖
通过你的 AI 查询此合约
引用: 0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38
示例提示词: "Tell me the current state of sonic/0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"
还没有接入 AI?→ mcp.smarts.md
Sonic 在 Smarts 上是仅文档链:源代码和 ABI 已索引,但当前不提供实时链上数据(状态、最新事件、管理员画像)。AI 代理仍可通过 MCP 调用 get_contract_info 和 get_contract_source。

概览

读取函数
6
写入函数
7
事件
4

读取函数

allowance(owner: address, spender: address) view

Returns the remaining number of tokens that spender is allowed to transfer from owner.✨ AI

开发者: See {IERC20-allowance}.

参数

名称 类型 描述
owner address Address of the token owner whose allowance is being queried.✨ AI
spender address Address authorized to spend tokens on behalf of the owner.✨ AI

返回值

名称 类型 描述
uint256 Remaining allowance as a uint256 in the token's smallest unit that spender may transfer from owner.✨ AI
balanceOf(account: address) view

Returns the WrappedSonic token balance for the specified account.✨ AI

开发者: See {IERC20-balanceOf}.

参数

名称 类型 描述
account address Address whose WrappedSonic token balance will be returned.✨ AI

返回值

名称 类型 描述
uint256 The account's token balance as a uint256 value.✨ AI
decimals() view

Returns the token's number of decimal places.✨ AI

开发者: Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.

返回值

名称 类型 描述
uint8 The number of decimals used for token balances (uint8), e.g. 18 for typical ERC-20 tokens.✨ AI
name() view

Returns the token's name used by wallets and user interfaces.✨ AI

开发者: Returns the name of the token.

返回值

名称 类型 描述
string The token name string shown to wallets and interfaces.✨ AI
symbol() view

Returns this token's symbol string used by wallets and user interfaces.✨ AI

开发者: Returns the symbol of the token, usually a shorter version of the name.

返回值

名称 类型 描述
string The token symbol string (e.g., "WSONIC") that represents the asset's short identifier.✨ AI
totalSupply() view

Return the total number of WrappedSonic tokens in circulation.✨ AI

开发者: See {IERC20-totalSupply}.

返回值

名称 类型 描述
uint256 Total token supply as a uint256 representing all existing WrappedSonic tokens.✨ AI

写入函数

approve(spender: address, value: uint256) nonpayable

Approve a spender to transfer up to a specified number of tokens from your account.✨ AI

开发者: See {IERC20-approve}. NOTE: If `value` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.

参数

名称 类型 描述
spender address Address allowed to spend tokens on behalf of the caller.✨ AI
value uint256 Maximum number of tokens the spender is allowed to transfer.✨ AI

返回值

名称 类型 描述
bool True if the approval was successful.✨ AI
deposit() payable

Deposit Ether to mint an equal amount of WrappedSonic tokens to your account.✨ AI

开发者: Allow to deposit native tokens and mint the corresponding number of wrapped tokens to self account.
depositFor(account: address) payable

Deposit native tokens and mint WrappedSonic tokens credited to the specified account.✨ AI

开发者: Allow a user to deposit native tokens and mint the corresponding number of wrapped tokens.

参数

名称 类型 描述
account address The address to receive the minted wrapped tokens.

返回值

名称 类型 描述
bool True if the deposit and mint operation succeeded.✨ AI
transfer(to: address, value: uint256) nonpayable

Transfer tokens from the caller's account to the specified address.✨ AI

开发者: See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.

参数

名称 类型 描述
to address Recipient address that will receive the tokens.✨ AI
value uint256 Amount of tokens to transfer, expressed in the token's smallest unit.✨ AI

返回值

名称 类型 描述
bool True if the transfer succeeds.✨ AI
transferFrom(from: address, to: address, value: uint256) nonpayable

Transfers tokens from one address to another using an approved allowance and returns true on success.✨ AI

开发者: See {IERC20-transferFrom}. Skips emitting an {Approval} event indicating an allowance update. This is not required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve]. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `value`. - the caller must have allowance for ``from``'s tokens of at least `value`.

参数

名称 类型 描述
from address Address to transfer tokens from.✨ AI
to address Recipient address.✨ AI
value uint256 Amount of tokens to transfer, specified in the token's smallest units.✨ AI

返回值

名称 类型 描述
bool True if the transfer succeeded.✨ AI
withdraw(value: uint256) nonpayable

Burns the caller's wrapped SONIC tokens and transfers the corresponding underlying SONIC tokens to the caller.✨ AI

开发者: Allow withdraw by burning own wrapped tokens, the corresponding amount of native tokens are released.

参数

名称 类型 描述
value uint256 Amount to be withdrawn.
withdrawTo(account: address, value: uint256) nonpayable

Burn wrapped tokens and transfer the underlying Sonic to the specified account.✨ AI

开发者: Allow a user to burn a number of wrapped tokens and withdraw the corresponding number of native tokens.

参数

名称 类型 描述
account address The recipient of the native tokens.
value uint256 The amount of wrapped tokens to be burned.

返回值

名称 类型 描述
bool True if the burn and transfer succeeded.✨ AI

事件

Approval(owner: address, spender: address, value: uint256)
名称 类型 已索引 描述
owner address
spender address
value uint256
Deposit(account: address, value: uint256)
名称 类型 已索引 描述
account address Account address which receive the minted ERC20 token.
value uint256 The amount of ERC20 tokens deposited.
Transfer(from: address, to: address, value: uint256)
名称 类型 已索引 描述
from address
to address
value uint256
Withdrawal(account: address, value: uint256)
名称 类型 已索引 描述
account address Account address which receive the withdrawn native token.
value uint256 The amount of native tokens withdrawn.