From 150b745c2d1263673a8c74aa6c6e7ec8dde8f2c8 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Fri, 24 Feb 2023 11:44:23 +0100 Subject: [PATCH 1/4] 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 --- .github/workflows/deploy.yml | 8 +++++--- CONTRIBUTING.md | 13 +++++++++++++ README.md | 8 +++++++- book.toml | 3 ++- static/TOB_Black.svg | 31 +++++++++++++++++++++++++++++++ static/custom.css | 7 +++++++ 6 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 static/TOB_Black.svg create mode 100644 static/custom.css diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0cbf155e..d20de03a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,15 +10,17 @@ jobs: permissions: contents: read runs-on: ubuntu-latest + + env: + CARGO_TERM_COLOR: always + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install mdbook run: | - mkdir mdbook - 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 - echo `pwd`/mdbook >> $GITHUB_PATH + cargo install --git https://github.com/montyly/mdBook.git mdbook || true - name: Build artifacts run: mdbook build - name: Upload artifact diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79cddafb..1764ca45 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,3 +46,16 @@ To run `markdown-link-check`: ```bash $ find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check ``` + +## Create the book + +We use `mdbook` to generate [secure-contracts.com](https://secure-contracts.com/). + +To run it locally: +``` +$ cargo install --git https://github.com/montyly/mdBook.git mdbook +$ mdbook build +``` + + +Note: we use https://github.com/montyly/mdBook.git, which contains https://github.com/rust-lang/mdBook/pull/1584. diff --git a/README.md b/README.md index 9fc44815..3c5e8c29 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ ![](https://github.com/crytic/building-secure-contracts/workflows/CI/badge.svg) ![](https://github.com/crytic/building-secure-contracts/workflows/Echidna/badge.svg) -Follow our guidelines and best practices to write secure smart contracts. +This repository, brought to you by [Trail of Bits](https://www.trailofbits.com/), outlines guidelines and best practices to write secure smart contracts. + +We welcome contributions, and you can contribute by following our [contributing guidelines](https://github.com/crytic/building-secure-contracts/blob/master/CONTRIBUTING.md). **Table of contents:** @@ -34,3 +36,7 @@ Follow our guidelines and best practices to write secure smart contracts. - exercises expected to require ~two hours to practically learn its operation. - [Resources](./resources): Various online resources - [Trail of Bits blogposts](./resources/tob_blogposts.md): List of blockchain related blogposts made by Trail of Bits + + +# License +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. \ No newline at end of file diff --git a/book.toml b/book.toml index 7d663099..a0f17ff0 100644 --- a/book.toml +++ b/book.toml @@ -5,13 +5,14 @@ multilingual = false src = "." title = "Building Secure Contracts" description = "Follow our guidelines and best practices to write secure smart contracts." +logo = "static/TOB_Black.svg" [output.html] git-repository-url = "https://github.com/crytic/building-secure-contracts" edit-url-template = "https://github.com/crytic/building-secure-contracts/edit/master/{path}" -default-theme = "ayu" cname = "crytic.github.io/building-secure-contracts" no-section-label = true +additional-css = ["static/custom.css"] [output.html.fold] enable = true diff --git a/static/TOB_Black.svg b/static/TOB_Black.svg new file mode 100644 index 00000000..cf0df3a6 --- /dev/null +++ b/static/TOB_Black.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/custom.css b/static/custom.css new file mode 100644 index 00000000..4987331d --- /dev/null +++ b/static/custom.css @@ -0,0 +1,7 @@ +.sidebar .sidebar-scrollbox .sidebar-book-logo img { + display: block; + margin-left: auto; + margin-right: auto; + width: 50%; + max-width: max-content; +} From 74682dd908160c7633416dc40feac66ba8e2a4a6 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Fri, 24 Feb 2023 14:34:26 +0100 Subject: [PATCH 2/4] Add favicon --- favicon.png | Bin 0 -> 3023 bytes favicon.svg | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 favicon.png create mode 100644 favicon.svg diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..06813a4c598a9c88cbcbb0a36e363c009de37f09 GIT binary patch literal 3023 zcmcgu`CAj$8a^3EGDI{%RN|TlS`bj6V4*-sLRi#Vh-ejMi=xni6%|y(!i=IQf`*Da zmgGtmEht1pSrlRc!4+^}DMBP}M1ry;0kX{8!9Mr?2lxIk&w0P^eb4#MdFGt&c{2oo z0h4L7XaIo8%a{2E13)1m1t2Em5VrG5G&z`VU$#C0fJqkP9|fGhz#Nw(1PAzl>rdw> z$pDVw{lEi2Dw<^2IFVFsUhd0VlSJw73i@eI+g#b8+#w@T>NDSaP2j!RS2kY~D9Rbs z=hG%#j4NHz?|I4Oe(ai#8@{!5Al+ycD{j;0kpe6 z!>ryhct^~xEiQUuSi7OLL$#vHGd?eyj zUR8Bo23N{_PxLMRIXwQCt$7}K5rH+MF`cPxUb<7ABirtrG}envv1MhcE)~vuKUO4; ztu|hti(R7={WZ6Ir_it~TUfe2i`f>#v-YRshp&kZzm8Jq>eAG{?odbN=bVHD(b62x zWAurb{k7Kjzw$pVu$hQ?E-xHR0k4@9Fvl8TQU7yNx)0{(CJQ%w+}boDa=Q9wIAL<^eM_xZ#d;N}e zyw~u7q`HN&Z0&bCgoQ7=OBA@(+e1!&bku*QDQ+qf$BGe>oSW*)5C?S|xviWH)5#1& z>+M=Q#0f53XTa6#U?EbP8AMa4^WOBKejwc`Wi*@Z-N#CCh$D<#FKbYB_Ti`BKmVR< zUKjK3;nKn5Ky`7fZV$X;sMQm?V4)R#Wem`I$9CnOQPURRq5gG6>9(KQEY09Ni zn34(^jqUHDN8^l_g_9_~d{h?{*l%9fFswp3u!J5>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x8@fBEA>DZzl$}%mj$=b?3W3?waJ+Be_|jK+Z3)7i z^5oD*G2VB053zBa%4{R-9|Iu_3s-s=qIQfC-c|I% zS2vY9<{kyLoW?Ye#j_T^yEXeC{PS3y@}aeCfIegezWoVaYv+}k`HnLlgpWSR&;}{& zineQ6JIPqNI!R~JePdkf!v>T@D+%l24JShy1L3m!5yO=`$UgzM(mK)~RufHMbo)=4 zQ%)1eAuvtSJ1!6)T%IdLzOGe`2|6=^Jq;2_%2chA>#&bM*26mJ3uvtwTw5>W;cSF! z>Iyw_%sb6s;=Ezu5 zrZYdRnV*i57ftZnD(mbeQbRxzEb+=>OY5{l~Q305^jvuLHk-o6P?vr;Rjx877ibTX8>7{`~KD zub1wrZ-#DceK?cyIzW4lLpsjRT#Tr4*%4e!g}LfPCFfkqd(B8cFnERIYJ&8ZMKIR5 zMLd|HD#gRJ=i1_Px;Y%Tk&xA-o4j<&>%xMa0 + + + + From 223919964f92156ecb884467e84cb2d1cc323658 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Fri, 24 Feb 2023 10:11:25 -0600 Subject: [PATCH 3/4] fix echidna ToC --- program-analysis/echidna/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program-analysis/echidna/README.md b/program-analysis/echidna/README.md index 88a915c4..f449a697 100644 --- a/program-analysis/echidna/README.md +++ b/program-analysis/echidna/README.md @@ -6,12 +6,12 @@ Watch our [Fuzzing workshop](https://www.youtube.com/watch?v=QofNQxW_K08&list=PL **Table of contents:** -- [Introduction](./introduction/README.md): Introductory material to fuzzing and Echidna -- [Basic](./basic/README.md): Learn the first steps on how to use Echidna -- [Advanced](./advanced/README.md): Learn advanced features of Echidna -- [Fuzzing tips](./fuzzing_tips.md): General fuzzing tips -- [Frequently Asked Questions](./frequently_asked_questions.md): Answers to common questions about Echidna -- [Exercises](./exercises/README.md): Exercises +- [Introduction](introduction): Introductory material to fuzzing and Echidna +- [Basic](basic): Learn the first steps on how to use Echidna +- [Advanced](advanced): Learn advanced features of Echidna +- [Fuzzing tips](fuzzing_tips): General fuzzing tips +- [Frequently Asked Questions](frequently_asked_questions): Answers to common questions about Echidna +- [Exercises](exercises): Exercises Join the team on Slack at: https://empireslacking.herokuapp.com/ #ethereum From 03827857c5999e5578f779a520e4fdba494c0545 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Fri, 24 Feb 2023 10:41:03 -0600 Subject: [PATCH 4/4] fix links --- program-analysis/echidna/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program-analysis/echidna/README.md b/program-analysis/echidna/README.md index f449a697..a03f4241 100644 --- a/program-analysis/echidna/README.md +++ b/program-analysis/echidna/README.md @@ -9,8 +9,8 @@ Watch our [Fuzzing workshop](https://www.youtube.com/watch?v=QofNQxW_K08&list=PL - [Introduction](introduction): Introductory material to fuzzing and Echidna - [Basic](basic): Learn the first steps on how to use Echidna - [Advanced](advanced): Learn advanced features of Echidna -- [Fuzzing tips](fuzzing_tips): General fuzzing tips -- [Frequently Asked Questions](frequently_asked_questions): Answers to common questions about Echidna +- [Fuzzing tips](./fuzzing_tips.md): General fuzzing tips +- [Frequently Asked Questions](./frequently_asked_questions.md): Answers to common questions about Echidna - [Exercises](exercises): Exercises Join the team on Slack at: https://empireslacking.herokuapp.com/ #ethereum