SavingsXDai

Gnosis ERC-20 Token

0xaf204776c7245bf4147c2612bf6e5972ee483701

Solidity v0.8.21+commit.d9974bed

Fungible token following the ERC-20 standard.

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

概览

读取函数
25
写入函数
11
事件
5

读取函数

DOMAIN_SEPARATOR() view

Returns the contract's EIP-712 DOMAIN_SEPARATOR used when signing and verifying typed data.✨ AI

返回值

名称 类型 描述
bytes32 A bytes32 EIP-712 domain separator used for constructing and verifying off-chain signatures.✨ AI
PERMIT_TYPEHASH() view

Return the EIP-2612 permit type hash used to verify off-chain approvals.✨ AI

返回值

名称 类型 描述
bytes32 Permit type hash (bytes32) used to construct and verify EIP-2612 permit signatures.✨ AI
VERSION() view

Returns the contract's version string.✨ AI

返回值

名称 类型 描述
string The contract version string (human-readable identifier).✨ AI
allowance(owner: address, spender: address) view

Returns the remaining token allowance that owner granted to spender.✨ AI

开发者: See {IERC20-allowance}.

参数

名称 类型 描述
owner address Address that granted the allowance.✨ AI
spender address Address allowed to spend tokens on owner's behalf.✨ AI

返回值

名称 类型 描述
uint256 Remaining number of tokens spender is allowed to transfer from owner, expressed as a uint256.✨ AI
asset() view

Returns the ERC-20 token address used as the contract's underlying asset.✨ AI

开发者: See {IERC4626-asset}.

返回值

名称 类型 描述
address The address of the underlying ERC-20 asset token contract.✨ AI
balanceOf(account: address) view

Returns the token balance for the given account.✨ AI

开发者: See {IERC20-balanceOf}.

参数

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

返回值

名称 类型 描述
uint256 The account's token balance represented as a uint256.✨ AI
convertToAssets(shares: uint256) view

Convert a share amount to the equivalent amount of underlying assets.✨ AI

开发者: See {IERC4626-convertToAssets}.

参数

名称 类型 描述
shares uint256 Number of vault shares to convert to assets.✨ AI

返回值

名称 类型 描述
uint256 Equivalent amount of underlying assets for the provided shares.✨ AI
convertToShares(assets: uint256) view

Convert a given amount of underlying assets into the equivalent number of vault shares.✨ AI

开发者: See {IERC4626-convertToShares}.

参数

名称 类型 描述
assets uint256 Amount of underlying asset tokens to convert into shares.✨ AI

返回值

名称 类型 描述
uint256 Number of shares corresponding to the provided assets at the current conversion rate.✨ AI
decimals() view

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

开发者: Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This "original" value is cached during construction of the vault contract. If this read operation fails (e.g., the asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals. See {IERC20Metadata-decimals}.

返回值

名称 类型 描述
uint8 Number of decimals used by the token (uint8).✨ AI
deploymentChainId() view

Return the chain ID where the contract was deployed.✨ AI

返回值

名称 类型 描述
uint256 The chain ID (uint256) of the network where the contract was deployed.✨ AI
eip712Domain() view

Returns the contract's EIP-712 domain fields used to create typed-data signatures.✨ AI

开发者: See {IERC-5267}.

返回值

名称 类型 描述
fields bytes1 Leading EIP-712 domain prefix byte (commonly 0x19 or 0x01).✨ AI
name string Human-readable domain name used for EIP-712 signing (usually the token or protocol name).✨ AI
version string Domain version string used for EIP-712 domain separation.✨ AI
chainId uint256 Chain ID (EIP-155 style) that the domain binds signatures to.✨ AI
verifyingContract address Address of the verifying contract included in the domain.✨ AI
salt bytes32 32-byte salt used as an additional domain separator value.✨ AI
extensions uint256[] Array of uint256 extension values included in the domain for protocol-specific data.✨ AI
maxDeposit(address) view

Returns the maximum amount of tokens the specified address can deposit into the contract.✨ AI

开发者: See {IERC4626-maxDeposit}.

参数

名称 类型 描述
address

返回值

名称 类型 描述
uint256 Maximum deposit amount the account may provide, expressed in the token's smallest unit (uint256).✨ AI
maxMint(address) view

Return the maximum amount of tokens the given address can mint right now.✨ AI

开发者: See {IERC4626-maxMint}.

参数

名称 类型 描述
address

返回值

名称 类型 描述
uint256 Maximum amount of tokens the address may mint under the current contract state, in the token's smallest unit.✨ AI
maxRedeem(owner: address) view

Return the maximum amount of tokens the owner can redeem.✨ AI

开发者: See {IERC4626-maxRedeem}.

参数

名称 类型 描述
owner address Address to query for the owner's maximum redeemable token amount.✨ AI

返回值

名称 类型 描述
uint256 Maximum redeemable token amount for the specified owner, in token units (uint256).✨ AI
maxWithdraw(owner: address) view

Returns the maximum amount of tokens the given owner can withdraw.✨ AI

开发者: See {IERC4626-maxWithdraw}.

参数

名称 类型 描述
owner address Address whose maximum withdrawable token amount is queried.✨ AI

返回值

名称 类型 描述
uint256 Maximum withdrawable token amount for the owner, expressed in token units.✨ AI
name() view

Returns the token's name.✨ AI

开发者: Returns the name of the token.

返回值

名称 类型 描述
string The token name as a human-readable string defined in the contract.✨ AI
nonces(owner: address) view

Returns the current permit nonce for a given token holder address.✨ AI

开发者: See {IERC20Permit-nonces}.

参数

名称 类型 描述
owner address Address of the token holder whose nonce is queried.✨ AI

返回值

名称 类型 描述
uint256 Current nonce uint256 for the owner; increments with each permit and prevents signature replay.✨ AI
previewDeposit(assets: uint256) view

Return the number of vault shares you would receive for depositing a given amount of assets.✨ AI

开发者: See {IERC4626-previewDeposit}.

参数

名称 类型 描述
assets uint256 Amount of underlying assets to deposit.✨ AI

返回值

名称 类型 描述
uint256 Number of shares that would be minted for the provided assets, without changing contract state.✨ AI
previewMint(shares: uint256) view

Preview the amount of underlying assets required to mint a specified number of vault shares.✨ AI

开发者: See {IERC4626-previewMint}.

参数

名称 类型 描述
shares uint256 Number of vault shares the caller intends to mint.✨ AI

返回值

名称 类型 描述
uint256 Amount of underlying assets required to mint the specified shares, denominated in the asset token.✨ AI
previewRedeem(shares: uint256) view

Estimate how much underlying token you will receive if you redeem a given number of shares.✨ AI

开发者: See {IERC4626-previewRedeem}.

参数

名称 类型 描述
shares uint256 Number of vault shares to redeem.✨ AI

返回值

名称 类型 描述
uint256 Estimated amount of underlying tokens receivable for the specified shares.✨ AI
previewWithdraw(assets: uint256) view

Estimate the number of shares to burn to withdraw a specified amount of assets.✨ AI

开发者: See {IERC4626-previewWithdraw}.

参数

名称 类型 描述
assets uint256 Amount of underlying assets the user wants to withdraw.✨ AI

返回值

名称 类型 描述
uint256 Number of shares that would be burned to fulfill the requested asset withdrawal.✨ AI
symbol() view

Returns the token symbol users see for the SavingsXDai ERC-20 token.✨ AI

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

返回值

名称 类型 描述
string The token's short symbol string used to identify the token (e.g., "xDAI").✨ AI
totalAssets() view

Returns the total amount of underlying assets currently held by the contract.✨ AI

开发者: See {IERC4626-totalAssets}.

返回值

名称 类型 描述
uint256 Total amount of underlying assets the contract manages, expressed as a uint256 in the token's smallest units.✨ AI
totalSupply() view

Returns the total token supply of the SavingsXDai token.✨ AI

开发者: See {IERC20-totalSupply}.

返回值

名称 类型 描述
uint256 uint256 total number of tokens in existence (minted minus burned), expressed in the token's smallest unit.✨ AI
wxdai() view

Return the wrapped xDai (wXDAI) token contract address.✨ AI

返回值

名称 类型 描述
address The address of the wrapped xDai (wXDAI) ERC-20 token contract.✨ AI

写入函数

approve(spender: address, value: uint256) nonpayable

Approve a spender to transfer up to a specified number of your tokens.✨ 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 authorized to spend tokens from the caller's balance.✨ AI
value uint256 Maximum token amount the spender is allowed to transfer.✨ AI

返回值

名称 类型 描述
bool True if the approval operation succeeded, otherwise false.✨ AI
decreaseAllowance(spender: address, requestedDecrease: uint256) nonpayable

Decreases the caller's token allowance for spender by requestedDecrease and emits an Approval event.✨ AI

开发者: Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `requestedDecrease`. NOTE: Although this function is designed to avoid double spending with {approval}, it can still be frontrunned, preventing any attempt of allowance reduction.

参数

名称 类型 描述
spender address Address allowed to spend tokens on behalf of the caller.✨ AI
requestedDecrease uint256 Amount to subtract from the current allowance for spender.✨ AI

返回值

名称 类型 描述
bool True if the allowance was successfully decreased.✨ AI
deposit(assets: uint256, receiver: address) nonpayable

Deposit assets into the vault and mint corresponding shares to the receiver.✨ AI

开发者: See {IERC4626-deposit}.

参数

名称 类型 描述
assets uint256 Amount of underlying assets to deposit (in token base units).✨ AI
receiver address Address that will receive the minted shares.✨ AI

返回值

名称 类型 描述
uint256 Amount of shares minted to the receiver.✨ AI
increaseAllowance(spender: address, addedValue: uint256) nonpayable

Increase the caller's token allowance for spender by addedValue.✨ AI

开发者: Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.

参数

名称 类型 描述
spender address Address approved to spend the caller's tokens.✨ AI
addedValue uint256 Amount of tokens to add to the existing allowance.✨ AI

返回值

名称 类型 描述
bool True if the allowance was successfully increased.✨ AI
mint(shares: uint256, receiver: address) nonpayable

Mint a specified number of vault shares to the receiver by providing the required underlying assets.✨ AI

开发者: See {IERC4626-mint}. As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero. In this case, the shares will be minted without requiring any assets to be deposited.

参数

名称 类型 描述
shares uint256 Number of vault shares to mint.✨ AI
receiver address Address that will receive the minted shares.✨ AI

返回值

名称 类型 描述
uint256 Amount of underlying assets deposited to mint the requested shares.✨ AI
permit(owner: address, spender: address, value: uint256, deadline: uint256, signature: bytes) nonpayable
开发者: Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].

参数

名称 类型 描述
owner address
spender address
value uint256
deadline uint256
signature bytes
permit(owner: address, spender: address, value: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) nonpayable
开发者: Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section].

参数

名称 类型 描述
owner address
spender address
value uint256
deadline uint256
v uint8
r bytes32
s bytes32
redeem(shares: uint256, receiver: address, owner: address) nonpayable
开发者: See {IERC4626-redeem}.

参数

名称 类型 描述
shares uint256
receiver address
owner address

返回值

名称 类型 描述
uint256
transfer(to: address, value: uint256) nonpayable
开发者: See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `value`.

参数

名称 类型 描述
to address
value uint256

返回值

名称 类型 描述
bool
transferFrom(from: address, to: address, value: uint256) nonpayable
开发者: See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. 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
to address
value uint256

返回值

名称 类型 描述
bool
withdraw(assets: uint256, receiver: address, owner: address) nonpayable
开发者: See {IERC4626-withdraw}.

参数

名称 类型 描述
assets uint256
receiver address
owner address

返回值

名称 类型 描述
uint256

事件

Approval(owner: address, spender: address, value: uint256)
名称 类型 已索引 描述
owner address
spender address
value uint256
Deposit(sender: address, owner: address, assets: uint256, shares: uint256)
名称 类型 已索引 描述
sender address
owner address
assets uint256
shares uint256
EIP712DomainChanged()
Transfer(from: address, to: address, value: uint256)
名称 类型 已索引 描述
from address
to address
value uint256
Withdraw(sender: address, receiver: address, owner: address, assets: uint256, shares: uint256)
名称 类型 已索引 描述
sender address
receiver address
owner address
assets uint256
shares uint256