-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/advanced create2 testing #1922
base: arith-dev
Are you sure you want to change the base?
Conversation
…empty bytecode depl
ebd26fc
to
3d8d8de
Compare
@@ -34,7 +34,7 @@ public static class ToyMultiTransactionBuilder { | |||
* @return an instance of {@link List<Transaction>} | |||
*/ | |||
public List<Transaction> build( | |||
ToyTransactionBuilder[] toyTxBuilders, ToyAccount senderAccount) { | |||
List<ToyTransactionBuilder> toyTxBuilders, ToyAccount senderAccount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the type from array to list for the builder parameters when creating multiple transactions for the same account, for it to be easier to add builders during testing
transactionBuilderLeadingDelegateCallerToCreateAnAccount, | ||
transactionBuilderLeadingDelegateCallerToSelfDestruct, | ||
transactionBuilderDeployingDelegateCallerAgain, | ||
transactionBuilderLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment for changing the method's signature in ToyMultiTransaction
@@ -61,7 +61,7 @@ void testBlockwiseDeplNo() { | |||
// Block 1 | |||
.addBlock( | |||
List.of( | |||
tc.deployWithCreate2( | |||
tc.deployWithCreate2_withRevertTrigger( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep TestingBase
as it was for deployWithCreate2
and create new function to have it revertable
This suite aims at testing advanced CREATE2 scenarii using smart contracts.
It tests 5 deployment scenarii with the same init code through a smart contract piloting the deployment.
SmartContractTestValidator
is a generic TransactionProcessingValidator to validate log presence and data produced by the tests.Test coverage :
CustomCreate2 is the smart contract used to pilot the deployment of a complex initCodeC
CustomCreate2 stores an initCodeC and a salt used for subsequent deployments
CustomCreate2 has different create2 methods to have deployment scenarii within the same transaction
CustomCreate2 can CALL/STATICCALL itself and contractC
initCodeC can be piloted by CustomCreate2 via the value passed in the transaction
value 1 Wei enables a storage modification in ContractC
value 2 Wei calls CustomCreate2 back to trigger an immediate redeployment of ContractC
value 3 Wei triggers a self-destruct of ContractC
value 4 Wei triggers a revert on demand
ContractC can modify storage, revert on demand, self-destruct on demand, and call back
CustomCreate2 to trigger a redeployment of ContractC
SCENARIO 1 - Deploy ContractC through CustomCreate2, modify storage, self-destruct ContractC
SCENARIO 2 - Deploy ContractC and attempt redeployment after in same transaction
SCENARIO 3 - Deploy ContractC and the deployment attempts redeployment, empty bytecode is deployed, call ContractC to modify storage, revert on demand
SCENARIO 4 - Attempt ContractC deployment with a staticCall
SCENARIO 5 - Four ContractC deployment attempts : (1) with max value, (2) acceptable value, (3) max value and (4) acceptable value