Giter Club home page Giter Club logo

trusty-contracts's Introduction

Trusty-Contracts Project

Setup

  • Clone the repository and cd into it
  • Create a .env file and put in the environment variables (see .env.template).
  • To run and test the smart contract locally just use the command npm run start and npm run test.
  • It is recommended to insert in the .env the variable PRIVATE_KEY only when you need actually to deploy the contract on the desired network and removing it immediately after.
  • To 'deploy' the smart contract on blockchain remember to check and eventually edit the file hardhat.config.js removing the comment on the line containing the code //accounts: [PRIVATE_KEY] in the desired network.
  • It is possible to deploy the contracts using a Ledger wallet hardware device answering correctly to the interactive prompt that will appear when running the npm run deploy.
  • It is possible to deploy a single Trusty multi-signature without the need to deploy the Trusty Factory deployer using the command npm run deploy-single.

Install, compile, run, deploy and verify

# Clone the repository
git clone https://github.com/Ramsi88/trusty-contracts.git

# Change directory
cd trusty-contracts

# Install dependencies
npm i

# Update dependencies
npm update

# Start
npm run start

# Deploy locally
npm run deploy hardhat

# Deploy on Testnets
npm run deploy <goerli>|<sepolia>|<mumbai>

# Deploy on Mainnet
npm run deploy mainnet

# Verify contract
npm run verify mainnet <Contract_Address> "ConstructorArg1" "ConstructorArg2"

# Deploy a single Trusty without Factory
npm run deploy-single

Scripts commands shortcut

# Compile
npm run compile

# Start
npm run start

# Deploy
npm run deploy 

Integration tests

# 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'

Basic HardHat usage

npx hardhat help

# Run a local node
npx hardhat node

# Test
npx hardhat test
REPORT_GAS=true npx hardhat test

# Compile contract bytecode
npx hardhat compile

# Run contract locally
npx hardhat run scripts/run.js

# Deploy
npx hardhat run scripts/deploy.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" 

trusty-contracts's People

Contributors

ramsi88 avatar fametrano avatar

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.