A Typescript Hardhat-based template to develop evm-based smart contracts with all the tooling you need.

Overview

EVM-based Smart Contract Scaffold

A Typescript Hardhat-based template to develop evm-based smart contracts with all the tooling you need.

Features

  • Uses hardhat-deploy to keep track of deployments (upgradable or normal)
  • Uses typechain to auto-generate typescript bindings for compiled contracts, useful for auto-completion in your frontend dApps
  • Uses semantic-release and commitlint for a streamline CI
  • Uses Github Actions to publish versioned contracts to NPM, along with their Typescript bindings, ABIs (useful for interacting from your dApp) and bytecodes (useful when deploying contracts using ethers.js or web3).
  • Supports multiple chains
  • Gas cost reporter using CoinMarketCap APIs for your contract deployment and each interaction
  • Contract size calculator plugin for Hardhat
  • Automated Etherscan verification for deployed contracts

Getting Started

  1. Clone this repo (or click on "Use Template" button above in Github), then update the .github/CODEOWNERS:

    git clone https://github.com/0xflair/evm-contract-scaffold my-amazing-contracts
    vi my-amazing-contracts/.github/CODEOWNERS
  2. Create a .env file based on .env.example and update the values.

  3. Create your first contract in src/.

  4. Compile the contracts:

    npm run compile

Deploying

When you are ready, let's deploy the contract on the blockchain and have it verified in corresponding block scanner.

  1. Deploy the contracts:

    npm run deploy:rinkeby
  2. Verify the contracts on Etherscan:

    npm run verify:rinkeby

Releasing

If you want your contract to be released as an NPM package you can:

  1. Create a new Automation token in your NPM account.
  2. Add a new secret called NPM_TOKEN in your Github repository > Settings > Secrets > Actions.
  3. Commit anything on main branch then automatically you'll get a new release.

Ensure your main branch is either does not require status checking, or has "bypass" exception for semantic-release-bot so that it can push new tags and releases on the Github repo.

Testing

  1. Write your tests in test/ directory.

  2. Execute them:

    npm run test

License

This repository is under MIT license.

You might also like...

Ethereum Smart Contracts for locking your Ether and ERC20 tokens based on time and price conditions

SmartHold - a simple way to lock and hold your ETH or ERC20 in a smart contract This is a BETA software that has not been audited for security. USE AT

May 5, 2022

An NPM package to help you get started with modern javascript tooling easier & faster

MODERNIZE.JS Creating config files for webpack and babel can be an hell of stress, this NPM package helps you get started with writing code as soon as

Sep 22, 2022

A collection of smart contracts for the Stackup platform 🤖 📑

Contracts A collection of smart contracts for the Stackup platform. Dev Blog Deployed Contracts See releases for deployed contracts of previous versio

Nov 29, 2021

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

Crowdcoin ♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS. Project from "Ethereum and Solidity: T

Dec 14, 2022

Cooperative databases using smart contracts.

Cooperative databases using smart contracts.

Vitra ██╗ ██╗██╗████████╗██████╗ █████╗ ██║ ██║██║╚══██╔══╝██╔══██╗██╔══██╗ ██║ ██║██║ ██║ ██████╔╝███████║ ╚██╗ ██╔╝██║ ██║ ██╔══██╗██

Dec 30, 2022

Run CosmWasm smart contracts in Node.js and web browsers

Run CosmWasm smart contracts in Node.js and web browsers

Nov 25, 2022

A 'to do list' powered by Ethereum smart contracts

A 'to do list' powered by Ethereum smart contracts. built with JavaScript, Ganache, Truffle, Node.js, Metamask, jQuery, and Bootstrap

Feb 17, 2022

Context-aware smart contracts for blockchain IoT systems

Context-aware smart contracts for blockchain IoT systems It contains 2 directories: contracts: contains the ContextAwareSmartContract.sol contract wit

Jun 17, 2022

This is the main repository for NFT collection dao smart contracts.

Basic Sample Hardhat Project This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample s

Apr 11, 2022
Releases(v1.0.0)
Owner
Flair
Blockchain with Style
Flair
A professional truffle solidity template with all necessary libraries that support developer to develop, debug, test, deploy solidity smart contract

solidity-truffle-template A professional truffle solidity template with necessary libraries that support to develop, compile, test, deploy, upgrade, v

ChimGoKien 6 Nov 4, 2022
A list of EVM-based chains that also allows you to add chains to your favorite Web3 wallet

A list of EVM-based chains that also allows you to add chains to your favorite Web3 wallet. An alternative to the closing chainlist.org

Frederik Bolding 108 Jan 5, 2023
Foundry-Hardhat plugins: Use Foundry for Hardhat projects

This repo contains hardhat plugins to use foundry tools in hardhat environments. Installation See in each plugin anvil forge foundryup Documentation F

Foundry 77 Nov 3, 2022
A bridge between different EVM based Chains.

Blockchain Bridge between different Ethereum based chains. This project uses DApps and smart contracts to Bridge assets between blockchains and it is

Yadav! ✔ 4 Jun 2, 2022
This is a development platform to quickly generate, develop & deploy smart contract based applications on StarkNet.

generator-starknet This is a development platform to quickly generate, develop, & deploy smart contract based apps on StarkNet. Installation First, in

Only Dust 34 Nov 18, 2022
A Multichain crypto wallet library that supports Ethereum, Solana and other EVM compatible blockchains.

Multichain Crypto Wallet A Multichain crypto wallet library that supports Ethereum, Solana and other EVM compatible blockchains. Installation npm inst

Abdulfatai Suleiman 117 Jan 2, 2023
A fully-fledged Hardhat project template based on TypeScript.

Fully-Fledged Hardhat Project Template Based on TypeScript Installation It is recommended to install Yarn through the npm package manager, which comes

Pascal Marco Caversaccio 75 Dec 21, 2022
A tool that enables developers to connect multiple applications without the need to develop any interface.

Flooq A tool that enables developers to connect multiple applications without the need to develop any interface. Environments Env Service Status stagi

Agile Waterfall Inc. 8 Jul 1, 2022
In this repository, I try to perform a mainnet fork and then simulate popular smart contract exploits on various DEFI Protocols using Hardhat Framework.

defiHacks_via_Hardhat 1. Alchemix Access Control Bug Any user could have called setWhitelist() to give an attacker the ability to call the harvest fun

null 34 Dec 27, 2022
This monorepo stores all code and assets of all projects with which we develop regels.overheid.nl

Welcome Introduction In 2021 Utrecht started developing the Virtual Income Desk with Open Rules. An initiative with the aim for citizens to always and

Ministerie van Binnenlandse Zaken en Koninkrijksrelaties 5 Dec 8, 2022