feat(calltx): support CREATE2 receiver address list as call data source - #290
Draft
LouisTsai-Csie wants to merge 1 commit into
Draft
LouisTsai-Csie wants to merge 1 commit into
LouisTsai-Csie wants to merge 1 commit into
Conversation
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
Let
calltxtake a CREATE2 receiver address list. The addresses are never enumerated: the list carries the three CREATE2 inputs: (factory, initcode hash, salt range), calltx encodes them asso the contract under test derives the addresses on-chain and walks the salt upwards from
startSalt. This keeps a list of tens of thousands of targets down to a few lines of config.Configuration
New options (
--targets-file, or an inlinetargets:block for config files and daemon mode - the two are mutually exclusive):--targets-file--call-value--gas-buffer--salt-strideDetails:
targetsblock ofeoatx, so one file can be pointed at either scenario.factoryaccepts the existing{factory_address}placeholder, which expands to the CREATE2 factory offactorydeploytx.initcode,initcode_fileorinitcode_hashper pattern. Relativeinitcode_filepaths resolve relative to the targets file, andstart_saltuses the same uint64 big-endian bytes32 encoding asfactorydeploytx.--salt-stridedecides how farstart_saltmoves between consecutive txs of a pattern.--call-data,--call-abi,--call-abi-file,--call-fn-name,--call-fn-sigand--call-args, since calltx encodes the call data itself.Follow-up
The contract implementing
callAttack: a port of theopcode = CALL, overhead_baseline = Falsearm oftest_account_accessfrom execution-specs - is not part of this PR and will come separately.