feat(benchmark): add audit subcommand for on-chain quote validation#215
Open
kayibal wants to merge 1 commit into
Open
feat(benchmark): add audit subcommand for on-chain quote validation#215kayibal wants to merge 1 commit into
kayibal wants to merge 1 commit into
Conversation
Adds an `audit` subcommand that fetches quotes from Fynd and external aggregators (KyberSwap, Nordstern, 0x) for a configurable set of token pairs, then re-executes each quote on-chain via eth_simulateV1 to measure the real amount received. - audit.rs: simulation harness using eth_simulateV1 with state overrides for token balance and allowance; falls back to eth_call when the node does not support eth_simulateV1 - erc20.rs: storage-slot detection for standard Solidity mapping layouts (positions 0–20) and OpenZeppelin v5 namespaced storage - aggregator.rs: quote clients for KyberSwap, Nordstern, and 0x; Nordstern non-JSON pseudo-schema responses are mapped to NoRoute - pair_selector.rs: random pair selection from live Tycho pools - Native ETH output is measured by injecting a 10-byte balance-reader contract into simulation state; zeroing sender balance and setting gasPrice=0 ensures the result equals ETH received exactly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
auditsubcommand tofynd-benchmarkthat fetches quotes from Fynd and external aggregators (KyberSwap, Nordstern, 0x) for a set of token pairs, then re-executes each quote on-chain viaeth_simulateV1to measure the real amount receivedgasPrice=0ensures the result equals ETH received exactlyNoRouteinstead of propagating as errors🤖 Generated with Claude Code