Include sections for Safeharbor/BugBounties updates#47
Conversation
b336b8f
| * [ ] Update safeharbor script | ||
| ```bash | ||
| cd scripts/safeharbor | ||
| npm install | ||
| ``` | ||
| * [ ] Run `npm run generate` command in the `spells-mainnet` repo to check for bug bounty updates | ||
| * [ ] IF the command outputs hex encoded call: |
There was a problem hiding this comment.
Shouldn't make all that available from the main Makefile?
Check the cast-on-tenderly entry there for reference.
| * [ ] Run `npm run generate` command in the `spells-mainnet` repo to check for bug bounty updates | ||
| * [ ] IF the command outputs hex encoded call: | ||
| * [ ] Add ALL output call to the spell using low-level Solidity call. | ||
| * [ ] The call MUST use the pattern: `(bool succ, bytes memory err) = AGREEMENT.call(<encodedDATA>);` |
There was a problem hiding this comment.
Aren't we using multicall now?
This way we can just pass the data and make a higher level call, which won't require us to check the success status.
There was a problem hiding this comment.
The issue is that the multicall accepts:
struct Call {
address target;
bytes callData;
}
function aggregate(Call[] memory calls);
Therefore, if there are multiple calls, we would need to use the annoying syntax of:
Call memory calls = new Call[](x);
calls[0] = { ... };
...
calls[x] = { ...};
multicall.aggregate(calls);
Which I personally think it's much worse in terms of clutter and amount of outputs.
There was a problem hiding this comment.
I see, makes sense.
However there's another point, the script already provides the raw data for a low-level call to MULTICALL, so the checklist should reference this contract, not the agreement:
| * [ ] The call MUST use the pattern: `(bool succ, bytes memory err) = AGREEMENT.call(<encodedDATA>);` | |
| * [ ] The call MUST use the pattern: `(bool succ, bytes memory err) = MULTICALL.call(<encodedDATA>);` |
| * [ ] All actions are executed in the transaction trace | ||
| * [ ] No reverts are present that block execution | ||
| * [ ] No out-of-gas errors are present | ||
| * [ ] Confirm `make update-bug-bounty` returns empty |
There was a problem hiding this comment.
| * [ ] Confirm `make update-bug-bounty` returns empty | |
| * [ ] Confirm `make safeharbor-generate` returns empty |
| * [ ] End-to-end "happy path" interaction with the module | ||
| * IF bug bounty updates are present | ||
| * [ ] Test that all bug bounty registry calls execute successfully | ||
| * [ ] Verify `make update-bug-bounty` returns empty diff in test environment after spell execution |
There was a problem hiding this comment.
| * [ ] Verify `make update-bug-bounty` returns empty diff in test environment after spell execution | |
| * [ ] Verify `make safeharbor-generate` returns empty diff in test environment after spell execution |
| * [ ] End-to-end "happy path" interaction with the module | ||
| * IF bug bounty updates are present | ||
| * [ ] Test that all bug bounty registry calls execute successfully | ||
| * [ ] Verify `make update-bug-bounty` returns empty diff in test environment after spell execution |
There was a problem hiding this comment.
This specific step should probably be in the checklist right after "cast on tenderly".
| * [ ] Target Contract is included in the ChainLog | ||
| * [ ] Test Coverage is comprehensive | ||
| * IF bug bounty registry updates are present | ||
| * [ ] Run `make safeharbor-verify calldata=0xhexEncodedData` command in the `spells-mainnet` repo, passing the calldata in the spell to check for it's validity. |
There was a problem hiding this comment.
You don't need to explicitly mention the spells-mainnet repo, as it's implied. All other actions in the checklist happen there.
| * [ ] Run `make safeharbor-verify calldata=0xhexEncodedData` command in the `spells-mainnet` repo, passing the calldata in the spell to check for it's validity. | |
| * [ ] Run `make safeharbor-verify calldata=<encodedDATA>` command, passing the calldata in the spell to check for it's validity. |
| * [ ] Test Coverage is comprehensive | ||
| * IF bug bounty registry updates are present | ||
| * [ ] Run `make safeharbor-verify calldata=0xhexEncodedData` command in the `spells-mainnet` repo, passing the calldata in the spell to check for it's validity. | ||
| * [ ] Verify the call uses the correct pattern: `(bool succ, bytes memory err) = AGREEMENT.call(<encodedDATA>);` |
There was a problem hiding this comment.
| * [ ] Verify the call uses the correct pattern: `(bool succ, bytes memory err) = AGREEMENT.call(<encodedDATA>);` | |
| * [ ] Verify the call uses the correct pattern: `(bool succ, bytes memory err) = MULTICALL.call(<encodedDATA>);` |
| * IF bug bounty registry updates are present | ||
| * [ ] Run `make safeharbor-verify calldata=<encodedDATA>` command passing the calldata in the spell to check for it's validity. | ||
| * [ ] Verify the call uses the correct pattern: `(bool succ, bytes memory err) = MULTICALL.call(<encodedDATA>);` | ||
| * [ ] Confirm proper error handling is implemented for each call |
There was a problem hiding this comment.
There will be only one call. Using "for each" here might be confusing.
| * [ ] Confirm proper error handling is implemented for each call | |
| * [ ] Confirm proper error handling is implemented for the call |
| * [ ] Run `make safeharbor-verify calldata=<encodedDATA>` command passing the calldata in the spell to check for it's validity. | ||
| * [ ] Verify the call uses the correct pattern: `(bool succ, bytes memory err) = MULTICALL.call(<encodedDATA>);` | ||
| * [ ] Confirm proper error handling is implemented for each call | ||
| * [ ] Verify the bug bounty section has appropriate comments/documentation |
There was a problem hiding this comment.
"Appropriate" here is too subjective.
It's probably worth expanding which are the exact comments/documentation expectations.
Probably we should take the more detailed crafter check items and adapt them here.
fa99756 to
10ee338
Compare
| * [ ] If not already present, add the helper function to perform the call: | ||
| ```solidity | ||
| function _updateSafeHarbor(bytes[] memory calldatas) public { | ||
| for (uint256 i = 0; i < calldatas.length; i++) { | ||
| (bool success, ) = address(AGREEMENT_ADDRESS).call(calldatas[i]); | ||
| require(success, "SaferHarbor call failed"); | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Hmm, not sure we want to have the function in the checklist. Maybe we just reference the archive:
| * [ ] If not already present, add the helper function to perform the call: | |
| ```solidity | |
| function _updateSafeHarbor(bytes[] memory calldatas) public { | |
| for (uint256 i = 0; i < calldatas.length; i++) { | |
| (bool success, ) = address(AGREEMENT_ADDRESS).call(calldatas[i]); | |
| require(success, "SaferHarbor call failed"); | |
| } | |
| } | |
| ``` | |
| * [ ] If not already present, add the helper function to perform the call, using the established archive pattern. |
SidestreamBurningBanana
left a comment
There was a problem hiding this comment.
Approving with 2 nits present, will give re-approval if they are resolved
No description provided.