Skip to content

Commit 150b745

Browse files
committed
Minor improvements to secure-contracts.com
- Made contributing guidelines visible on the first page - Add license - Use custom mdbook version to add the ToB logo on top of the table of content
1 parent 68a1616 commit 150b745

File tree

6 files changed

+65
-5
lines changed

6 files changed

+65
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ jobs:
1010
permissions:
1111
contents: read
1212
runs-on: ubuntu-latest
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
1317
steps:
1418
- uses: actions/checkout@v3
1519
with:
1620
fetch-depth: 0
1721
- name: Install mdbook
1822
run: |
19-
mkdir mdbook
20-
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
21-
echo `pwd`/mdbook >> $GITHUB_PATH
23+
cargo install --git https://github.com/montyly/mdBook.git mdbook || true
2224
- name: Build artifacts
2325
run: mdbook build
2426
- name: Upload artifact

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,16 @@ To run `markdown-link-check`:
4646
```bash
4747
$ find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check
4848
```
49+
50+
## Create the book
51+
52+
We use `mdbook` to generate [secure-contracts.com](https://secure-contracts.com/).
53+
54+
To run it locally:
55+
```
56+
$ cargo install --git https://github.com/montyly/mdBook.git mdbook
57+
$ mdbook build
58+
```
59+
60+
61+
Note: we use https://github.com/montyly/mdBook.git, which contains https://github.com/rust-lang/mdBook/pull/1584.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
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-
Follow our guidelines and best practices to write secure smart contracts.
5+
This repository, brought to you by [Trail of Bits](https://www.trailofbits.com/), outlines guidelines and best practices to write secure smart contracts.
6+
7+
We welcome contributions, and you can contribute by following our [contributing guidelines](https://github.com/crytic/building-secure-contracts/blob/master/CONTRIBUTING.md).
68

79
**Table of contents:**
810

@@ -34,3 +36,7 @@ Follow our guidelines and best practices to write secure smart contracts.
3436
- exercises expected to require ~two hours to practically learn its operation.
3537
- [Resources](./resources): Various online resources
3638
- [Trail of Bits blogposts](./resources/tob_blogposts.md): List of blockchain related blogposts made by Trail of Bits
39+
40+
41+
# License
42+
secure-contracts and building-secure-contracts are licensed and distributed under the [AGPLv3 license](https://github.com/crytic/building-secure-contracts/blob/master/LICENSE). Contact us if you're looking for an exception to the terms.

book.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ multilingual = false
55
src = "."
66
title = "Building Secure Contracts"
77
description = "Follow our guidelines and best practices to write secure smart contracts."
8+
logo = "static/TOB_Black.svg"
89

910
[output.html]
1011
git-repository-url = "https://github.com/crytic/building-secure-contracts"
1112
edit-url-template = "https://github.com/crytic/building-secure-contracts/edit/master/{path}"
12-
default-theme = "ayu"
1313
cname = "crytic.github.io/building-secure-contracts"
1414
no-section-label = true
15+
additional-css = ["static/custom.css"]
1516

1617
[output.html.fold]
1718
enable = true

static/TOB_Black.svg

Lines changed: 31 additions & 0 deletions
Loading

static/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.sidebar .sidebar-scrollbox .sidebar-book-logo img {
2+
display: block;
3+
margin-left: auto;
4+
margin-right: auto;
5+
width: 50%;
6+
max-width: max-content;
7+
}

0 commit comments

Comments
 (0)