Skip to content

Commit ce8c271

Browse files
author
Nat Chin
committed
Run linter
1 parent 7f66b9e commit ce8c271

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
# Security Review Preparation Checklist
22

3-
So, you're getting a security review!
3+
So, you're getting a security review!
44

55
Ensure the security review proceeds smoothly by taking prior action with the following informative items.
66

7-
## Essential Items
7+
## Essential Items
8+
89
The items below guide us in focusing effectively on the pertinent parts of your code, maximizing our utilization of time and resources.
910

1011
- [ ] **Provide build instructions** – share how to build and test your code using a fresh clone of your repository. It gives us direct insight into your setup.
11-
- [ ] **List exact files in scope for the review** list out the exact files to be reviewed to focus on key areas of your codebase.
12-
- [ ] **Freeze and share your hash/branch/release before the review starts** – a stable commit allows us to start digging into your codebase and learning how it works. Tell your security review team what commit to review, and try to ensure that this commit is frozen before the review commences.
13-
- [ ] **Add inline comments** utilise comments on complex areas of the codebase. Document why something was done, its purpose and goal.
12+
- [ ] **List exact files in scope for the review** – list out the exact files to be reviewed to focus on key areas of your codebase.
13+
- [ ] **Freeze and share your hash/branch/release before the review starts** – a stable commit allows us to start digging into your codebase and learning how it works. Tell your security review team what commit to review, and try to ensure that this commit is frozen before the review commences.
14+
- [ ] **Add inline comments** – utilise comments on complex areas of the codebase. Document why something was done, its purpose and goal.
1415
- [ ] **Provide Natspec documentation** – ensure all functions have NatSpec descriptions for function's purpose, parameters, and return values.
1516
- [ ] **Provide test coverage report** – provide a report outlining tested and untested code areas.
16-
- [ ] **Share your unit tests** – share your unit tests with us! We may use it to understand the system flow, can provide feedback on its setup, and can use it to test proof of concepts.
17+
- [ ] **Share your unit tests** – share your unit tests with us! We may use it to understand the system flow, can provide feedback on its setup, and can use it to test proof of concepts.
1718
- [ ] **List external dependencies you're using and their purpose** – list used libraries and external dependencies along with their purposes.
1819
- [ ] **Create user flow diagrams** – outline the entrypoint functions, subsequent callstacks, and expected system interactions for users.
1920
- [ ] **Design an architecture diagram** – illustrate the interactions among contracts.
2021
- [ ] **Let us know what you're worried about** – reveal parts of the code or exploit paths that cause concern.This helps us target our review and make sure that we prioritize the areas of the codebase you're worried about.
21-
- [ ] **Document the impossible** – know when you are making assumptions on types and their values into the codebase, and document all these instances.
22+
- [ ] **Document the impossible** – know when you are making assumptions on types and their values into the codebase, and document all these instances.
23+
24+
### Defi-Specific Additions
2225

23-
### Defi-Specific Additions
2426
- [ ] **Share economic analysis performed on the codebase** – sharing results of economic analysis will help us to understand the boundaries of inputs and ranges of outputs.
2527
- [ ] **List system invariants** – define your assumptions about system operations and function behaviors.
26-
- [ ] **Provide documentation for arithmetic formulas used with code references** – all formulas you implement should be referenced in this document, with a link to the function in your code that implements it. If the representation in your code differs from the formula, provide the derivation that maps the formula used in the code and the formula you intend to implement.
28+
- [ ] **Provide documentation for arithmetic formulas used with code references** – all formulas you implement should be referenced in this document, with a link to the function in your code that implements it. If the representation in your code differs from the formula, provide the derivation that maps the formula used in the code and the formula you intend to implement.
2729
- [ ] **Create a glossary for your system** – consistently used terminology should be documented and made accessible.
28-
- [ ] **Validation of rounding directions** – share all analysis you have done on checking the correct rounding direction for your system.
30+
- [ ] **Validation of rounding directions** – share all analysis you have done on checking the correct rounding direction for your system.
2931

3032
### Bridge-Specific Additions
33+
3134
- [ ] **Document off-chain checks** – provide details about validations performed by off-chain components like relayers or bots.
32-
- [ ] **Checks performed by off-chain components such as relayers or bots** tell us what data validation takes place off-chain so we can better understand what data is sent to smart contracts
33-
- [ ] **Transition of value-passing on source and destination chains** – show us how the chains share data, and what return values/emissions from a source chain maps to a destination chain
35+
- [ ] **Checks performed by off-chain components such as relayers or bots** tell us what data validation takes place off-chain so we can better understand what data is sent to smart contracts
36+
- [ ] **Transition of value-passing on source and destination chains** – show us how the chains share data, and what return values/emissions from a source chain maps to a destination chain
3437

3538
## Beneficial Additions
3639

3740
Providing the following items can bolster the efficiency of our review, allowing for a deeper and more thorough examination of your codebase.
3841

39-
- [ ] **Ranges of all system parameters used in the system** – explicitly outline the minimum and maximum bound of configuration values in your codebase
40-
- [ ] **Document all design decisions** – decision-making processes engineering tradeoffs, and discarded alternatives related to the system and codebase setup provides valuable context that greatly enhances our review efficiency, affording a more comprehensive and nuanced understanding of the entire system.
42+
- [ ] **Ranges of all system parameters used in the system** – explicitly outline the minimum and maximum bound of configuration values in your codebase
43+
- [ ] **Document all design decisions** – decision-making processes engineering tradeoffs, and discarded alternatives related to the system and codebase setup provides valuable context that greatly enhances our review efficiency, affording a more comprehensive and nuanced understanding of the entire system.
4144
- [ ] **Provide results of fuzz and differential testing** – especially vital if your code involves lower-level assembly or math-related libraries. This aids us in employing tooling to spot deviations and edge cases.
4245
- [ ] **Perform and report on stateful invariant testing** – such testing enables us to pinpoint edge cases that might occur during end-to-end operations.
4346
- [ ] **Provide videos of complex workflows** – visual aids can effectively capture complex workflows, improving our grasp of the system's intricacies and bolstering the efficiency of our review.
4447
- [ ] **Provide lists of actors with their expected roles and privileges** – outlining the distinct actors in your system, along with their specific roles and permissions, grants us a clearer understanding of how user interactions are designed and how authority is structured within the system. This, in turn, boosts the efficiency and depth of our review.
4548
- [ ] **Prepare and share an Incident response plan** – a robust incident response plan provides insight into how your system is prepared to handle potential security breaches or unexpected system behavior. By sharing this, we can assess the system's robustness under adverse conditions, as well as provide recommendations for enhancing the resilience of your incident response strategy.
4649

47-
### References
50+
### References
4851

49-
- Our own experience
50-
- [The Pragamatic Programmer](https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/)
52+
- Our own experience
53+
- [The Pragamatic Programmer](https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/)

0 commit comments

Comments
 (0)