Skip to content

Commit 57a3dac

Browse files
authored
Merge branch 'master' into non-standard-erc20-list
2 parents 3074b2c + 5a8ddd6 commit 57a3dac

File tree

108 files changed

+2347
-1569
lines changed

Some content is hidden

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

108 files changed

+2347
-1569
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
CARGO_TERM_COLOR: always
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0
2525
- name: Install mdbook
@@ -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@v3
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@v4

.github/workflows/echidna.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,19 @@ 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'
135135

136136
steps:
137137
- name: Checkout repository
138-
uses: actions/checkout@v3
138+
uses: actions/checkout@v4
139139

140140
- name: Checkout Damn Vulnerable DeFi solutions
141-
uses: actions/checkout@v3
141+
uses: actions/checkout@v4
142142
if: startsWith(matrix.workdir, 'dvdefi')
143143
with:
144144
repository: crytic/damn-vulnerable-defi-echidna
@@ -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_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout repository
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616

1717
- name: Set up Node.js
1818
uses: actions/setup-node@v3

.github/workflows/lint_links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
markdown-link-check:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- uses: gaurav-nelson/github-action-markdown-link-check@v1
2424
with:
2525
use-quiet-mode: "yes"

.github/workflows/manticore.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525
- name: Set up Python 3.8
26-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: 3.8
2929
- name: Install dependencies

.github/workflows/slither.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525
- name: Set up Python 3.8
26-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: 3.8
2929
- name: Install dependencies

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 [email protected] 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 [email protected].
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: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +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)
12-
- [High-level best practices](./development-guidelines/guidelines.md): High-level best-practices for all smart contracts
13-
- [Incident Response Recommendations](./development-guidelines/incident_response.md): Guidelines on how to formulate an incident response plan
14-
- [Secure development workflow](./development-guidelines/workflow.md): A rough, high-level process to follow while you write code
15-
- [Token integration checklist](./development-guidelines/token_integration.md): What to check when interacting with arbitrary token
16-
- [Learn EVM](./learn_evm): EVM technical knowledge
17-
- [EVM Opcodes](./learn_evm/evm_opcodes.md): Details on all EVM opcodes
9+
- [Development Guidelines](./development-guidelines)
10+
- [Code Maturity](./development-guidelines/code_maturity.md): Criteria for developers and security engineers to use when evaluating a codebase’s maturity
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
1817
- [Transaction Tracing](./learn_evm/tracing.md): Helper scripts and guidance for generating and navigating transaction traces
1918
- [Arithmetic Checks](./learn_evm/arithmetic-checks.md): A guide to performing arithmetic checks in the EVM
20-
- [Yellow Paper Guidance](./learn_evm/yellow-paper.md): Symbol reference for more easily reading the Ethereum yellow paper
21-
- [Forks <> EIPs](./learn_evm/eips_forks.md): Summarize the EIPs included in each Ethereum fork
22-
- [Forks <> CIPs](./learn_evm/cips_forks.md): Summarize the CIPs and EIPs included in each Celo fork _(EVM-compatible chain)_
23-
- [Upgrades <> TIPs](./learn_evm/tips_upgrades.md): Summarize the TIPs included in each TRON upgrade _(EVM-compatible chain)_
24-
- [Forks <> BEPs](./learn_evm/beps_forks.md): Summarize the BEPs included in each BSC fork _(EVM-compatible chain)_
25-
- [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
2625
- [Algorand](./not-so-smart-contracts/algorand)
2726
- [Cairo](./not-so-smart-contracts/cairo)
2827
- [Cosmos](./not-so-smart-contracts/cosmos)
2928
- [Substrate](./not-so-smart-contracts/substrate)
3029
- [Solana](./not-so-smart-contracts/solana)
31-
- [Program analysis](./program-analysis): How to use automated tools to secure contracts
32-
- [Echidna](./program-analysis/echidna): a fuzzer that will check your contract's properties.
33-
- [Slither](./program-analysis/slither): a static analyzer available through a CLI and scriptable interface.
34-
- [Manticore](./program-analysis/manticore): a symbolic execution engine that can prove the correctness properties.
35-
- For each tool, this training material will provide:
36-
- a theoretical introduction, a walkthrough of its API, and a set of exercises.
37-
- exercises expected to require ~two hours to practically learn its operation.
38-
- [Resources](./resources): Various online resources
39-
- [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
4039

4140
# License
4241

0 commit comments

Comments
 (0)