Skip to content

Latest commit

 

History

History
89 lines (68 loc) · 3.24 KB

README.md

File metadata and controls

89 lines (68 loc) · 3.24 KB

Core Developer's guide

Learn

Stack

Used EIP standards

Used fresh Solidity language features

  • 0.8.4: Support custom errors via the error keyword and introduce the revert statement.
  • 0.8.8: Inheritance: A function that overrides only a single interface function does not require the override specifier
  • 0.8.15: Add E.selector for a non-anonymous event E to access the 32-byte selector topic
  • 0.8.18: Allow named parameters in mapping types
  • 0.8.21: Allow qualified access to events from other contracts
  • 0.8.22: Unchecked loop increments

Prepare

  • Setup IDE
    • vscode
      • add extensions
        • nomicfoundation.hardhat-solidity
        • ryanluker.vscode-coverage-gutters
        • davidanson.vscode-markdownlint
    • WebStorm
      • add plugins
      • Windows users: Editor -> Code Style -> Line separator: Unix and macos
  • install foundry
  • clone this repo
  • put your urls and keys to .env from .env.exmaple
  • install deps, compile and test
forge install
forge test -vv
forge coverage
forge coverage --report lcov
forge build --sizes

Documentation

To generate and serve documentation for smart contracts based on NatSpec comments, run:

forge doc --serve

Deploy and verify

It is important to verify during deployment. Otherwise, you will have to manually verify each lib.

Polygon

forge script --rpc-url polygon script/deploy-strategy/IQMF.Polygon.s.sol -vvvv --broadcast --verify --slow --etherscan-api-key polygon

Real

forge script --rpc-url real script/deploy-core/Deploy.Real.s.sol --verify --verifier blockscout --verifier-url https://explorer.re.al/api? --slow --with-gas-price 30000000 -g 200 --broadcast

Sonic

forge script --rpc-url sonic --slow --broadcast --verify --etherscan-api-key sonic script/deploy-core/Deploy.Sonic.s.sol