ERC-4626 Vault Share Math
Recomputes ERC-4626 tokenized-vault share and asset conversions from caller-declared vault state, applying the rounding direction the standard mandates for each function and reporting which direction produced each result alongside what the opposite direction would have produced. ERC-4626 fixes those directions per function: convertToShares and convertToAssets round down towards 0, previewDeposit and previewRedeem round down, previewMint and previewWithdraw round up. Also computes a deposit-then-redeem round-trip loss bound against the post-deposit state, a signed exchange-rate drift between two declared snapshots, and a declared fee application. All arithmetic is exact uint256 integer math with no floating point. Never reads any chain: it cannot know whether the declared totals match a deployed vault, whether that vault applies these directions, or whether a rate change came from yield, loss, a donation, or an attack.
Tool URL: https://ainumbers.co/chaingraph/art-610-erc4626-vault-share-math.html
Request
- Base URL: https://ainumbers.co
- URL: https://ainumbers.co/v1/tools/recompute_erc4626_vault_share_math
- Auth: none declared
Request body
Response
Successful tool execution result
Changes
No recorded changes to this operation across all 1 revision of this API.