- Clone the repository and
cdinto it - Create a
.envfile and put in the environment variables (see.env.template). - It is recommended to insert in the
.envthe variablePRIVATE_KEYonly when you need actually to deploy the contract on the network and removing it immediately after. - To run the smart contract locally just use the command
npm run start, but to 'deploy' on blockchain remember to check and eventually edit the filehardhat.config.jsas it contains the right hardhat framework's configurations/*commented*/to run locally instead of deploying the contract on the network specified.
# Clone the repository
git clone https://github.com/Ramsi88/trusty-contracts.git
# Change directory
cd trusty-contracts
# Install dependencies
npm i
npm update
# Compile contract bytecode
npx hardhat compile
# Run contract locally
npx hardhat run scripts/run.js
# Deploy contract to <network>=goerli/sepolia/mumbai
npx hardhat run scripts/deploy.js --network mainnet
# Verify contract on <network>=goerli/sepolia/mumbai
npx hardhat verify --network goerli 0xabcdef12345... "ConstructorArg1" "ConstructorArg2" # Compile
npm run compile
# Start
npm run start
# Deploy
npm run deploy# Run all tests
npm run test
# Test with GAS fee estimation
npm run test-gas
# Test all
npm run test-all
# Run a specific test-id
npm run test-id -- 'Create trusty test'npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js