Skip to content

Commit 404b81d

Browse files
committed
Merge branch 'master' into code-maturity
2 parents 8ae6216 + 77dc85c commit 404b81d

File tree

96 files changed

+1656
-1296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1656
-1296
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Build artifacts
2929
run: mdbook build
3030
- name: Upload artifact
31-
uses: actions/upload-pages-artifact@v1
31+
uses: actions/upload-pages-artifact@v2
3232
with:
3333
path: ./book
3434
deploy:
@@ -43,4 +43,4 @@ jobs:
4343
steps:
4444
- name: Deploy to GitHub Pages
4545
id: deployment
46-
uses: actions/deploy-pages@v1
46+
uses: actions/deploy-pages@v2

.github/workflows/echidna.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ jobs:
126126
expected: 'testERC20PermitDeposit(uint256):\s*passing'
127127
- name: MultiABI
128128
workdir: program-analysis/echidna/example/
129-
files: multiabi.sol
129+
files: allContracts.sol
130130
solc-version: 0.8.0
131-
config: multiabi.yaml
131+
config: allContracts.yaml
132132
contract: EchidnaTest
133133
outcome: failure
134134
expected: 'test_flag_is_false():\s*failed'
@@ -167,7 +167,7 @@ jobs:
167167
contract: ${{ matrix.contract }}
168168
config: ${{ matrix.config }}
169169
output-file: ${{ matrix.files }}.out
170-
solc-version: ${{ matrix.solc-version || '0.5.11' }}
170+
solc-version: ${{ matrix.solc-version || '0.8.0' }}
171171
echidna-workdir: ${{ matrix.workdir }}
172172
echidna-version: edge
173173
crytic-args: ${{ matrix.crytic-args || '' }}

.github/workflows/lint_links.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ on:
1212
- ".github/workflows/lint_links.yml"
1313
- "**.md"
1414
schedule:
15-
# run CI at 09:00, on day 1 of the month even if no PRs/merges occur
16-
- cron: "0 9 1 * *"
15+
# run CI at 09:00 every Tuesday even if no PRs/merges occur
16+
- cron: "0 9 * * 2"
1717

1818
jobs:
1919
markdown-link-check:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@master
22+
- uses: actions/checkout@v3
2323
- uses: gaurav-nelson/github-action-markdown-link-check@v1
2424
with:
2525
use-quiet-mode: "yes"
26+
check-modified-files-only: ${{ (github.event_name == 'pull_request' && 'yes') || 'no' }}

CONTRIBUTING.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
# Contributing to Building-secure-contracts
1+
# Contributing to Building-Secure-Contracts
22

3-
First, thanks for your interest in contributing to Building-secure-contracts! We welcome and appreciate all contributions, including bug reports, feature suggestions, tutorials/blog posts, and code improvements.
3+
First, thank you for your interest in contributing to Building-Secure-Contracts! We appreciate and warmly welcome all contributions, which include bug reports, feature suggestions, tutorials/blog posts, and code improvements.
44

5-
If you're unsure where to start, we recommend our [`good first issue`](https://github.com/crytic/building-secure-contracts/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [`help wanted`](https://github.com/crytic/building-secure-contracts/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) issue labels.
5+
If you're not sure where to begin, we recommend checking out our [`good first issue`](https://github.com/crytic/building-secure-contracts/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [`help wanted`](https://github.com/crytic/building-secure-contracts/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) issue labels.
66

7-
## Bug reports and feature suggestions
7+
## Bug Reports and Feature Suggestions
88

9-
Bug reports and feature suggestions can be submitted to our issue tracker. For bug reports, attaching the contract that caused the bug will help us in debugging and resolving the issue quickly. If you find a security vulnerability, do not open an issue; email opensource@trailofbits.com instead.
9+
Please submit bug reports and feature suggestions to our issue tracker. When reporting a bug, attaching the contract causing the issue is helpful for efficient debugging and resolution. If you discover a security vulnerability, do not open an issue; instead, email opensource@trailofbits.com.
1010

1111
## Questions
1212

13-
Questions can be submitted to the issue tracker, but you may get a faster response if you ask in our [chat room](https://empireslacking.herokuapp.com/) (in the #ethereum channel).
13+
Questions can be submitted to the issue tracker, but you may get a faster response if you ask in our [chat room](https://slack.empirehacking.nyc/) (in the #ethereum channel).
1414

15-
## Code
15+
## Code Contributions
1616

17-
building-secure-contracts uses the pull request contribution model. Please make an account on Github, fork this repo, and submit code contributions via pull request. For more documentation, look [here](https://guides.github.com/activities/forking/).
17+
Building-Secure-Contracts follows the pull request contribution model. Create an account on Github, fork this repo, and submit code contributions through pull requests. For additional documentation, refer [here](https://guides.github.com/activities/forking/).
1818

1919
Some pull request guidelines:
2020

21-
- Minimize irrelevant changes (formatting, whitespace, etc) to code that would otherwise not be touched by this patch. Save formatting or style corrections for a separate pull request that does not make any semantic changes.
22-
- When possible, large changes should be split up into smaller focused pull requests.
23-
- Fill out the pull request description with a summary of what your patch does, key changes that have been made, and any further points of discussion, if applicable.
24-
- Title your pull request with a brief description of what it's changing. "Fixes #123" is a good comment to add to the description, but makes for an unclear title on its own.
21+
- Limit unnecessary changes (formatting, whitespace, etc.) to code unrelated to the patch. Save formatting or style corrections for a separate pull request, which doesn't include any semantic changes.
22+
- When possible, break down large changes into smaller, focused pull requests.
23+
- Complete the pull request description with an overview of your patch, including key modifications, and any further discussion points if relevant.
24+
- Use a concise title to describe your pull request's changes. "Fixes #123" is suitable for adding to the description, but not as a standalone title.
2525

2626
## Directory Structure
2727

28-
Below is a rough outline of building-secure-contracts's structure:
28+
Here's a basic overview of Building-Secure-Contracts' structure:
2929

3030
```text
3131
.
32-
├── development-guidelnes # High-level best-practices for all smart contracts
32+
├── development-guidelines # High-level best practices for all smart contracts
3333
├── learn_evm # EVM technical knowledge
34-
├── not-so-smart-contracts # Examples of smart contract common issues. Each issue contains a description, an example and recommendations
35-
├── program-analysis # How to use automated tools to secure contracts
36-
├── ressources # Various online resources
34+
├── not-so-smart-contracts # Examples of common smart contract issues, including descriptions, examples, and recommendations
35+
├── program-analysis # How to utilize automated tools to secure contracts
36+
├── resources # Various online resources
3737
└── ...
3838
```
3939

40-
## Linting and formatting
40+
## Linting and Formatting
4141

4242
To install the formatters and linters, run:
4343

4444
```bash
4545
npm install
4646
```
4747

48-
To run the formatter, use:
48+
To use the formatter, run:
4949

5050
```bash
5151
npm run format
5252
```
5353

54-
To run the linters, use:
54+
To use the linters, run:
5555

5656
```bash
5757
npm run lint
5858
```
5959

60-
To run the individual linters, use:
60+
To use individual linters, run:
6161

6262
- `npm run lint:format` to check the formatting
63-
- `npm run lint:links` to check for invalid links in markdown files
63+
- `npm run lint:links` to verify the validity of links in markdown files
6464

65-
## Create the book
65+
## Creating the Book
6666

67-
We use `mdbook` to generate [secure-contracts.com](https://secure-contracts.com/).
67+
We utilize `mdbook` to generate [secure-contracts.com](https://secure-contracts.com/).
6868

6969
To run it locally:
7070

@@ -73,4 +73,4 @@ cargo install --git https://github.com/montyly/mdBook.git mdbook
7373
mdbook build
7474
```
7575

76-
Note: we use https://github.com/montyly/mdBook.git, which contains https://github.com/rust-lang/mdBook/pull/1584.
76+
Note: We use https://github.com/montyly/mdBook.git, which contains https://github.com/rust-lang/mdBook/pull/1584.

README.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,40 @@
22

33
![](https://github.com/crytic/building-secure-contracts/workflows/CI/badge.svg) ![](https://github.com/crytic/building-secure-contracts/workflows/Echidna/badge.svg)
44

5-
This repository, brought to you by [Trail of Bits](https://www.trailofbits.com/), outlines guidelines and best practices to write secure smart contracts.
5+
Brought to you by [Trail of Bits](https://www.trailofbits.com/), this repository offers guidelines and best practices for developing secure smart contracts. Contributions are welcome, you can contribute by following our [contributing guidelines](https://github.com/crytic/building-secure-contracts/blob/master/CONTRIBUTING.md).
66

7-
We welcome contributions, and you can contribute by following our [contributing guidelines](https://github.com/crytic/building-secure-contracts/blob/master/CONTRIBUTING.md).
7+
**Table of Contents:**
88

9-
**Table of contents:**
10-
11-
- [Development guidelines](./development-guidelines)
9+
- [Development Guidelines](./development-guidelines)
1210
- [Code Maturity](./development-guidelines/code_maturity.md): Criteria for developers and security engineers to use when evaluating a codebase’s maturity
13-
- [High-level best practices](./development-guidelines/guidelines.md): High-level best-practices for all smart contracts
14-
- [Incident Response Recommendations](./development-guidelines/incident_response.md): Guidelines on how to formulate an incident response plan
15-
- [Secure development workflow](./development-guidelines/workflow.md): A rough, high-level process to follow while you write code
16-
- [Token integration checklist](./development-guidelines/token_integration.md): What to check when interacting with arbitrary token
17-
- [Learn EVM](./learn_evm): EVM technical knowledge
18-
- [EVM Opcodes](./learn_evm/evm_opcodes.md): Details on all EVM opcodes
11+
- [High-Level Best Practices](./development-guidelines/guidelines.md): Best practices for all smart contracts
12+
- [Incident Response Recommendations](./development-guidelines/incident_response.md): Guidelines for creating an incident response plan
13+
- [Secure Development Workflow](./development-guidelines/workflow.md): A high-level process to follow during code development
14+
- [Token Integration Checklist](./development-guidelines/token_integration.md): What to check when interacting with arbitrary tokens
15+
- [Learn EVM](./learn_evm): Technical knowledge about the EVM
16+
- [EVM Opcodes](./learn_evm/evm_opcodes.md): Information on all EVM opcodes
1917
- [Transaction Tracing](./learn_evm/tracing.md): Helper scripts and guidance for generating and navigating transaction traces
2018
- [Arithmetic Checks](./learn_evm/arithmetic-checks.md): A guide to performing arithmetic checks in the EVM
21-
- [Yellow Paper Guidance](./learn_evm/yellow-paper.md): Symbol reference for more easily reading the Ethereum yellow paper
22-
- [Forks <> EIPs](./learn_evm/eips_forks.md): Summarize the EIPs included in each Ethereum fork
23-
- [Forks <> CIPs](./learn_evm/cips_forks.md): Summarize the CIPs and EIPs included in each Celo fork _(EVM-compatible chain)_
24-
- [Upgrades <> TIPs](./learn_evm/tips_upgrades.md): Summarize the TIPs included in each TRON upgrade _(EVM-compatible chain)_
25-
- [Forks <> BEPs](./learn_evm/beps_forks.md): Summarize the BEPs included in each BSC fork _(EVM-compatible chain)_
26-
- [Not so smart contracts](./not-so-smart-contracts): Examples of smart contract common issues. Each issue contains a description, an example and recommendations
19+
- [Yellow Paper Guidance](./learn_evm/yellow-paper.md): Symbol reference for easier reading of the Ethereum yellow paper
20+
- [Forks <> EIPs](./learn_evm/eips_forks.md): Summaries of the EIPs included in each Ethereum fork
21+
- [Forks <> CIPs](./learn_evm/cips_forks.md): Summaries of the CIPs and EIPs included in each Celo fork _(EVM-compatible chain)_
22+
- [Upgrades <> TIPs](./learn_evm/tips_upgrades.md): Summaries of the TIPs included in each TRON upgrade _(EVM-compatible chain)_
23+
- [Forks <> BEPs](./learn_evm/beps_forks.md): Summaries of the BEPs included in each BSC fork _(EVM-compatible chain)_
24+
- [Not So Smart Contracts](./not-so-smart-contracts): Examples of common smart contract issues, complete with descriptions, examples, and recommendations
2725
- [Algorand](./not-so-smart-contracts/algorand)
2826
- [Cairo](./not-so-smart-contracts/cairo)
2927
- [Cosmos](./not-so-smart-contracts/cosmos)
3028
- [Substrate](./not-so-smart-contracts/substrate)
3129
- [Solana](./not-so-smart-contracts/solana)
32-
- [Program analysis](./program-analysis): How to use automated tools to secure contracts
33-
- [Echidna](./program-analysis/echidna): a fuzzer that will check your contract's properties.
34-
- [Slither](./program-analysis/slither): a static analyzer available through a CLI and scriptable interface.
35-
- [Manticore](./program-analysis/manticore): a symbolic execution engine that can prove the correctness properties.
36-
- For each tool, this training material will provide:
37-
- a theoretical introduction, a walkthrough of its API, and a set of exercises.
38-
- exercises expected to require ~two hours to practically learn its operation.
39-
- [Resources](./resources): Various online resources
40-
- [Trail of Bits blogposts](./resources/tob_blogposts.md): List of blockchain related blogposts made by Trail of Bits
30+
- [Program Analysis](./program-analysis): Using automated tools to secure contracts
31+
- [Echidna](./program-analysis/echidna): A fuzzer that checks your contract's properties
32+
- [Slither](./program-analysis/slither): A static analyzer with both CLI and scriptable interfaces
33+
- [Manticore](./program-analysis/manticore): A symbolic execution engine that proves the correctness of properties
34+
- For each tool, this training material provides:
35+
- A theoretical introduction, an API walkthrough, and a set of exercises
36+
- Exercises that take approximately two hours to gain practical understanding
37+
- [Resources](./resources): Assorted online resources
38+
- [Trail of Bits Blog Posts](./resources/tob_blogposts.md): A list of blockchain-related blog posts created by Trail of Bits
4139

4240
# License
4341

0 commit comments

Comments
 (0)