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

[🔥A1] Modifier.sol Transactions with EIP-712 and EIP-1271 Signature Authentication #137

Merged
merged 41 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5d288d7
First crack at the base class that does the EIP712 appended signature…
cristovaoth Sep 27, 2023
868ce59
Include EIP712 signature auth logic into Modifier.sol,
cristovaoth Sep 28, 2023
e975b8d
Add tests ensuring Modifier is managing nonce correctly
cristovaoth Sep 28, 2023
df35063
Naming improvements
cristovaoth Sep 28, 2023
3f71d04
Use block.chainid instead of opening an assembley block
cristovaoth Sep 28, 2023
4ac7bd7
Move moduleOnly only to more straigthforward shape
cristovaoth Sep 28, 2023
f45187e
Signer should not define the relayer's message value.
cristovaoth Sep 28, 2023
f6d7d08
Rename root type for EIP712 data structure
cristovaoth Sep 28, 2023
2b30406
Add natspec
cristovaoth Sep 28, 2023
72b4f25
Extract badSignature checks to their own test cases, instead of mixed…
cristovaoth Sep 28, 2023
12b96e5
Rename helper function
cristovaoth Sep 28, 2023
cd85276
Renames in preparation for eip-1271 signatures
cristovaoth Sep 29, 2023
148fb8a
Add eip-1271 support
cristovaoth Sep 30, 2023
300c80a
Rename helper function
cristovaoth Sep 30, 2023
557e372
Change visibility of moduleTxHash. Comments
cristovaoth Oct 1, 2023
09cdbb2
Update comments. Use v,s,r order. Add test cases
cristovaoth Oct 1, 2023
e10e352
Adjust comments
cristovaoth Oct 1, 2023
d05f894
Adjust comments
cristovaoth Oct 2, 2023
7c6c8ef
Introduce GuardableModule and GuardableModifier - this makes Module a…
cristovaoth Oct 4, 2023
446cd08
GuardableModifier tests
cristovaoth Oct 7, 2023
cc0e322
Bumping OpenZeppeling for bytecode optimized base classes
cristovaoth Oct 7, 2023
f098f7d
remove import
cristovaoth Oct 7, 2023
2cf6cda
Mark exec functions as virtual for Guardable*
cristovaoth Oct 8, 2023
d2a122d
Prettier
cristovaoth Oct 8, 2023
022394c
Make execTransactionFromModule virtual
cristovaoth Oct 9, 2023
fc032b7
Add comment to Modifier.sol
cristovaoth Oct 9, 2023
7960593
Break down Modifier authorization logic in reusable parts
cristovaoth Oct 12, 2023
9093ce3
Add failing tests
cristovaoth Oct 12, 2023
9aaae1b
Changing the base SignatureChecker to work with user proposed salt, i…
cristovaoth Oct 12, 2023
ea645eb
Introduce execution tracking into Modifier.sol based on executed and …
cristovaoth Oct 12, 2023
dd9e84c
Rename auxiliary function
cristovaoth Oct 12, 2023
908adeb
Moving the newly introducedd errors into ExecutionTracker
cristovaoth Oct 12, 2023
cd40d32
Fully cover guard with tests
cristovaoth Oct 12, 2023
91d32ee
Make sentOrSigned by an internal helper function for Modifiers
cristovaoth Oct 13, 2023
c4211a4
Make moduleTxSignedBy return always the hash, even when no signer fou…
cristovaoth Oct 18, 2023
41f16eb
Consolidate hash tracking into one mapping
cristovaoth Oct 18, 2023
9c1306e
Ensure contract specific signature is sliced correctly
cristovaoth Oct 19, 2023
637dcf1
Simplify splitSignature, and pull up logic that assembles the isValid…
cristovaoth Oct 25, 2023
64971c5
Add test for contract specific signature empty
cristovaoth Oct 25, 2023
9f65e4d
Remove aux variable
cristovaoth Oct 25, 2023
267725a
Consistently return hash from moduleTxSignedBy()
cristovaoth Oct 26, 2023
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
Prev Previous commit
Next Next commit
Moving the newly introducedd errors into ExecutionTracker
  • Loading branch information
cristovaoth committed Oct 26, 2023
commit 908adebb86d5ec1fbfe837ddf5a961327dc62bc7
2 changes: 1 addition & 1 deletion contracts/core/GuardableModifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ abstract contract GuardableModifier is Module, Guardable, Modifier {
}
}

function sentOrSignedBy() private returns (address) {
function sentOrSignedBy() private view returns (address) {
if (modules[msg.sender] != address(0)) {
return msg.sender;
}
Expand Down
6 changes: 0 additions & 6 deletions contracts/core/Modifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ abstract contract Modifier is
/// @param sender The address of the sender.
error NotAuthorized(address sender);

/// @param hash already executed.
error HashAlreadyExecuted(bytes32 hash);

/// @param hash already executed.
error HashInvalidated(bytes32 hash);

/// `module` is invalid.
error InvalidModule(address module);

Expand Down
3 changes: 3 additions & 0 deletions contracts/signature/ExecutionTracker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ pragma solidity >=0.8.0 <0.9.0;

/// @title ExecutionTracker - A contract that keeps track of executed and invalidated hashes
contract ExecutionTracker {
error HashAlreadyExecuted(bytes32);
error HashInvalidated(bytes32);

mapping(address => mapping(bytes32 => bool)) public executed;
mapping(address => mapping(bytes32 => bool)) public invalidated;

Expand Down