omnes-tech / BlockchainRio-Mutuo-NFT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hardhat x Foundry Template - Afonso Dalvi

Template repository for getting started quickly with Hardhat and Foundry in one project - Deploy and verify whith truffle

Github Actions

Getting Started

-- Se usar o git configurar para ser usado no Linux/Unix e no Windows: https://pt.stackoverflow.com/questions/44373/aviso-git-lf-will-be-replaced-by-crlf

git config --global core.autocrlf true
  • Use Foundry na pasta foundry: (Os testes no foundry são mais rápidos)
yarn

forge build
  • Install libraries with Foundry which work with Hardhat.
forge install transmissions11/solmate Openzeppelin/openzeppelin-contracts
 # Already in this repo, just an example
forge test

forge test -vv
forge test --gas-report
  • Caso esteja usando uma máquina virtual Linux ou um Mac conseguirá executar os comandos abaixo sem problemas:
avil   (blockchain do foundry)
  • Para o deploy e verificação dos contratos no foundry deve configurar o env. e executar os comandos na ordem:
source .env
forge script script/NFT.s.sol:MyScript --rpc-url $RINKEBY_RPC_URL  --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv
  • Use Hardhat na pasta principal template-deploy (melhor opção de deploy e verificação caso esteja usando o Windows):
yarn
yarn test
  • Use compile watch or test watch:
yarn hardhat compile:watch
yarn hardhat test:watch
truffle dashboard  (para não precisar configurar as chaves privadas no seu .env)
  • Deploy your smart-contract using testnet Truffle Dashboard:
yarn deploy --network truffle

Features

  • Write / run tests with either Hardhat or Foundry:
forge test
# or
yarn test
  • Use Truffle Dashboard:
truffle dashboard
  • Use Truffle ppara deployar e verificar seus contratos sem necessidade de inserir suas chaves privadas: (obs. o truffle dashboard precisa estar executado)
yarn deploy:truffle
yarn deploy:NFT
yarn hardhat verify --network truffle 0xCF00fd269fE5Ad09E0907b96AfeeD7e04F8423C6 argumentos
  • Use Prettier
yarn prettier

Notes

Fiz um conjunto de implementações para ficar mais fácil o uso de diversos frameworks necessários para iniciar qualquer projeto.

About


Languages

Language:Solidity 64.6%Language:JavaScript 32.4%Language:Ruby 1.2%Language:TypeScript 0.7%Language:Julia 0.6%Language:Shell 0.4%Language:Handlebars 0.1%Language:Makefile 0.1%Language:Nix 0.0%