-
Notifications
You must be signed in to change notification settings - Fork 2
Fix signatures and add latestTask details #30
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
base: main
Are you sure you want to change the base?
Conversation
7e856eb to
d8c69ea
Compare
| allTaskHashes[latestTaskNum] = taskHash; | ||
| allTaskHashes[nextTaskNumber] = taskHash; | ||
| latestTaskNum = nextTaskNumber; | ||
| nextTaskNumber = nextTaskNumber + 1; |
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.
this could probably use ++ but that's ok for the example
| mapping(uint32 => bytes32) public allTaskHashes; | ||
| mapping(address => mapping(uint32 => bytes)) public allTaskResponses; | ||
| uint32 public latestTaskNum; | ||
| uint32 public latestTaskNum; // Tracks the current task |
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.
I would consider removing comments cause they are redundant. But it's ok.
| bytes[] calldata signatures, | ||
| address[] calldata signers, | ||
| uint32 strategyId | ||
| uint32[] calldata strategyIds |
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.
For the future these 3 params could go in a struct and then you would pass an array of these structs. So you don't have to check the length.
| revert InvalidSigner(); | ||
| } | ||
| } else { | ||
| // if strategy has no signer set, check the signer is the owner of the strategy |
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.
what happens here in the else if if (strategySignerAddress != signers[i])?
This let's the contract work with multiple signatures and gives more details to the user on the contract.