[ETHEREUM-CONTRACTS] proposed changes for the macro forwarder #1828
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.
Proposed changes:
TrustedMacrosVanilla
toMacroForwarder
. Reasoning: trusted is a property not inherent to the contract, but coming into effect by registering it as trusted by gov. Vanilla isn't self-explanatory, I find it unnecessary. If we add a 712 variant, we can simply add 712 to the name. Plural -> singular because the use of a variabletrustedMacros
for an instance in the test seemed odd.simulateMacro: Initially I tried to find a better name (_simulate_ to me suggests that it would simulate the actual execution, not just retrieve the operations), but I came to the conclusion that it's more confusing than helpful and should instead be removed. It doesn't really add anything, because it just delegates to
macro.buildBatchOperations()`StatefulMacro
: [ETHEREUM-CONTRACTS] TrustedMacros: A TrustedForwarder that rules them all #1782 states: A user-defined macro is stateless ... - I think that's a mistake. The macro may very well have state if that helps to reduce the calldata size of the macro call. It just can't modify state inbuildBatchOperations()
. This test case exemplifies that, reducing the calldata to the minimum, which currently is the macro address.