Coder Social home page Coder Social logo

gakonst / solidity-book Goto Github PK

View Code? Open in Web Editor NEW
844.0 36.0 58.0 277 KB

The Senior Solidity Engineer's Book is a resource meant to transform you into a Senior Solidity Engineer.

Home Page: https://solidity-book.netlify.app/

Makefile 43.18% JavaScript 42.36% Solidity 14.46%
ethereum solidity book

solidity-book's Introduction

The Senior Solidity Engineer's Book

Still in early development

Available live at: https://solidity-book.netlify.app/

The Senior Solidity Engineer's Book is a resource meant to transform you into a Senior Solidity Engineer.

To view the book locally: mdbook serve and navigate to http://localhost:3000

Requirements

This section is copied from the rust-lang book

Building the book requires mdBook, ideally the same version that rust-lang/rust uses in this file. To get it:

$ cargo install mdbook-mermaid
$ cargo install mdbook --vers [version-num]

Building

This section is copied from the rust-lang book

To build the book, type:

$ mdbook build

The output will be in the book subdirectory. To check it out, open it in your web browser.

Firefox:

$ firefox book/index.html                       # Linux
$ open -a "Firefox" book/index.html             # OS X
$ Start-Process "firefox.exe" .\book\index.html # Windows (PowerShell)
$ start firefox.exe .\book\index.html           # Windows (Cmd)

Chrome:

$ google-chrome book/index.html                 # Linux
$ open -a "Google Chrome" book/index.html       # OS X
$ Start-Process "chrome.exe" .\book\index.html  # Windows (PowerShell)
$ start chrome.exe .\book\index.html            # Windows (Cmd)

To run the tests:

$ mdbook test

Deploying to Netlify

npm i -g netlify
netlify deploy

solidity-book's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solidity-book's Issues

Content Suggestions

Some ideas for content:-

Recreating some famous hacks/bugs to demonstrate exploitable code and what to avoid
Reliable sources of libraries and audited code OpenZeppelin etc.
Design patterns
Quirks and gotchas with Solidity compiler
Hardhat vs Truffle
IDE Plugins and custom deployment scripts
How EVM works
Layer 2 technologies
Best practices for storing on chain vs off chain data
Gas optimisation tips
MEV and flashbots
Useful code snippets
Oracles and Uni twap
Swaps and UniV2 vs V3 concentrated liquidity
Connecting lego bricks to build yield farming vaults
Creating custom and bootlegged interfaces
Unit testing
Fuzzing and linters
Community Hackathons, Meetups, EthGlobal etc.

If you want any help I wouldn't mind researching and writing a chapter.

EVM Articles

Content Suggestion List

Let's use this issue to track all useful content types, so we don't end up with very fragmented information:

How others have been teaching

Solidity Best Practices

EVM Internals

Topic Ideas

  • Recreating some famous hacks/bugs to demonstrate exploitable code and what to avoid
  • Reliable sources of libraries and audited code OpenZeppelin etc.
  • Design patterns
  • Quirks and gotchas with Solidity compiler
  • Hardhat vs Truffle
  • IDE Plugins and custom deployment scripts
  • How EVM works
  • Layer 2 technologies
  • Best practices for storing on chain vs off chain data
  • Gas optimisation tips
  • MEV and flashbots
  • Useful code snippets
  • Oracles and Uni twap
  • Swaps and UniV2 vs V3 concentrated liquidity
  • Connecting lego bricks to build yield farming vaults
  • Creating custom and bootlegged interfaces
  • Unit testing
  • Fuzzing and linters
  • Community Hackathons, Meetups, EthGlobal etc.

Recipe for validating off-chain data

Publish a recipe for validating off-chain data, both how to set it up in the smart contract and how to set it up on the back-end server with web3 or ethers. I've seen this used to good effect for saving gas or sending trusted data to a smart contract that would be difficult to do otherwise. I couldn't really find anything online detailing how to do this.

  • For example, how to set up a website that can check a database for a whitelist, and provide a signed payload to use in a transaction (prevents having to store a whitelist on-chain and saves gas) (e.g. see presaleMint function in GrayBoys.sol contract here: https://etherscan.io/address/0x8d4100897447d173289560bc85c5c432be4f44e4#code)
    Something like this could be set up in ethers.js on the whitelisting server by doing:
const encodedAddress = ethers.utils.defaultAbiCoder.encode(["address"], [whitelistedAddress]);
const messageHash = ethers.utils.arrayify(ethers.utils.solidityKeccak256(['address'], [encodedAddress]));
const whitelistSignature = await owner.signMessage(messageHash);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.