Skip to content
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

Use Slightly More Gas For 4337 Test #465

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/4337/certora/harnesses/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract Account is Safe {
* The canonical format ensures the signatures are tightly packed one after the other in order.
*
* For more details on signature encoding: https://docs.safe.global/advanced/smart-account-signatures
*/
*/
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated formatting changes from running prettier on the project.

function canonicalSignature(bytes calldata signatures, uint256 safeThreshold) public pure returns (bytes memory canonical) {
uint256 dynamicOffset = safeThreshold * 0x41;
bytes memory staticPart = signatures[:dynamicOffset];
Expand All @@ -75,7 +75,7 @@ contract Account is Safe {
uint256 signatureOffset = uint256(bytes32(signatures[ptr + 0x20:]));

uint256 signatureLength = uint256(bytes32(signatures[signatureOffset:]));
bytes memory signature = signatures[signatureOffset+0x20:][:signatureLength];
bytes memory signature = signatures[signatureOffset + 0x20:][:signatureLength];

// Make sure to update the static part so that the smart contract signature
// points to the "canonical" signature offset (i.e. that all contract
Expand All @@ -91,7 +91,7 @@ contract Account is Safe {
}
}
canonical = abi.encodePacked(staticPart, dynamicPart);
}
}
}

// @notice This is a harness contract for the rule that verfies the validation data
Expand Down
2 changes: 1 addition & 1 deletion modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@
"@account-abstraction/contracts": "0.7.0",
"@safe-global/safe-contracts": "1.4.1-build.0"
}
}
}
5 changes: 4 additions & 1 deletion modules/4337/test/e2e/SingletonSigners.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ describe('Singleton Signers [@4337]', () => {
await entryPoint.getAddress(),
false,
false,
{ initCode },
{
initCode,
verificationGasLimit: 600000,
},
)
const opHash = await validator.getOperationHash(
buildPackedUserOperationFromSafeUserOperation({
Expand Down
Loading