• Stars
    star
    430
  • Rank 101,083 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Template to develop ethereum smart contracts

Boilerplate for ethereum solidity smart contract development

INSTALL

yarn

TEST

There are 3 flavors of tests: hardhat, dapptools and forge

hardhat

  • One using hardhat that can leverage hardhat-deploy to reuse deployment procedures and named accounts:
yarn test

dapptools

dapp test

The latter requires additional step to set up your machine:

Install dapptools (Following instruction here):

# user must be in sudoers
curl -L https://nixos.org/nix/install | sh

# Run this or login again to use Nix
. "$HOME/.nix-profile/etc/profile.d/nix.sh"

curl https://dapp.tools/install | sh

Then install solc with the correct version:

nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-static-versions.solc_0_8_9

forge

forge test

This require the installation of forge (see foundry)

SCRIPTS

Here is the list of npm scripts you can execute:

Some of them relies on ./_scripts.js to allow parameterizing it via command line argument (have a look inside if you need modifications)

yarn prepare

As a standard lifecycle npm script, it is executed automatically upon install. It generate config file and typechain to get you started with type safe contract interactions

yarn format and yarn format:fix

These will format check your code. the :fix version will modifiy the files to match the requirement specified in .prettierrc.

yarn compile

These will compile your contracts

yarn void:deploy

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. quick way to ensure deployments work as intended without consequences

yarn test [mocha args...]

These will execute your tests using mocha. you can pass extra arguments to mocha

yarn coverage

These will produce a coverage report in the coverage/ folder

yarn gas

These will produce a gas report for function used in the tests

yarn dev

These will run a local hardhat network on localhost:8545 and deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn local:dev

This assumes a local node it running on localhost:8545. It will deploy your contracts on it. Plus it will watch for any changes and redeploy them.

yarn execute <network> <file.ts> [args...]

This will execute the script <file.ts> against the specified network

yarn deploy <network> [args...]

This will deploy the contract on the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn export <network> <file.json>

This will export the abi+address of deployed contract to <file.json>

yarn fork:execute <network> [--blockNumber <blockNumber>] [--deploy] <file.ts> [args...]

This will execute the script <file.ts> against a temporary fork of the specified network

if --deploy is used, deploy scripts will be executed

yarn fork:deploy <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a temporary fork of the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it

yarn fork:test <network> [--blockNumber <blockNumber>] [mocha args...]

This will test the contract against a temporary fork of the specified network.

yarn fork:dev <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a fork of the specified network and it will keep running as a node.

Behind the scene it uses hardhat node command so you can append any argument for it

More Repositories

1

hardhat-deploy

hardhat deployment plugin
TypeScript
1,043
star
2

clones-with-immutable-args

Solidity
193
star
3

jolly-roger

Build and Deploy for Eternity. Jolly Roger is a production-ready template for decentralised applications.
TypeScript
192
star
4

tutorial-hardhat-deploy

Tutorial for hardhat + hardhat-deploy
TypeScript
173
star
5

forge-deploy

Rust
113
star
6

eip721-subgraph

JavaScript
78
star
7

hardhat-deploy-ethers

TypeScript
64
star
8

forge-exec

Execute programs from forge with an open 2-way communication channel between both
Solidity
56
star
9

openfl-stage3d

Stage3D API for openfl
Haxe
52
star
10

bleeps

Bleeps, The First Truly onchain sounds
TypeScript
25
star
11

mandalas

TypeScript
24
star
12

hardhat-preprocessor

An hardhat plugin to pre-process contract source code before compilation
TypeScript
24
star
13

stratagems

Stratagems is an Autonomous World where players are actual gods. They are literaly the one creating the world.
TypeScript
23
star
14

sveltejs-adapter-ipfs

JavaScript
21
star
15

rocketh

A tool to test and deploy ethereum smart contract
TypeScript
17
star
16

singleton-1776-meta-transaction

A Singleton MetaTx Processor using EIP-1776 that support all ERC20 tokens
JavaScript
17
star
17

erc721-lease

A contract to manage lease of NFT
Solidity
16
star
18

spriter

Spriter runtime for Haxe with 0 allocation for hxcpp
Haxe
15
star
19

khage

KHAGE stands for KHA Graphical Extension. It is a set of class/macro to make use of graphics in a sane and safe way
Haxe
15
star
20

web3w

TypeScript
14
star
21

hardhat-deploy-tenderly

plugin for hardhat that push hardhat-deploy's deployments to tenderly
TypeScript
14
star
22

embed-art

Embed your NFT art anywhere, generate preview for oldschool platforms
TypeScript
14
star
23

gcusage

haxe lib to gather gc usage via code. Also serve as live doc on how haxe/hxcpp deal with allocation for various types
Haxe
14
star
24

hxcpp-test

C++
11
star
25

transfer-gateway

Solidity
11
star
26

hardhat-deploy-test-uniswap

Solidity
10
star
27

blockies-nft

TypeScript
10
star
28

antarctica

TypeScript
10
star
29

hardhat-deploy-ts-test

A test of buidler + buidler-deploy using typescript
TypeScript
9
star
30

stage3d-glsl

Lib to deal with glsl on top of flash stage3d api
Haxe
9
star
31

spriterkha

kha renderer for spriter runtime
Haxe
9
star
32

solidity-kit

Solidity
8
star
33

fuzd

time-lock encrypted commit + reveal system using drand
TypeScript
8
star
34

loot-for-everyone

TypeScript
7
star
35

kit

A set of lib and tools to make cross platform games
Haxe
7
star
36

vending-machine

simple-nft-sale
TypeScript
7
star
37

hardhat-deploy-test-diamond

TypeScript
7
star
38

conquest-eth-player-handbook

Conquest's Player's Handbook, Everything a player needs to know to play conquest.eth
7
star
39

universal-forwarder

The only meta transaction forwarder you need
Solidity
7
star
40

the-bleep-machine

Onchain algorithmic Music
JavaScript
6
star
41

template-on-chain-art

TypeScript
6
star
42

template-foundry

A basic template that uses foundry-rs/forge and forge-deploy to deploy and test ethereum smart contracts
Solidity
6
star
43

vitest-solidity-coverage

TypeScript
6
star
44

docker-compose-blockchain-setup

A docker-compose setup for local blockchain with blockscout
JavaScript
6
star
45

Yoga

Yoga aims to be a tool like maven for Haxe with at first the functionality of dependency management and project setup.
Haxe
5
star
46

cosmos

A Type safe Entity Component System with minimum overhead + optional Types
Haxe
5
star
47

mystery-box

CSS
5
star
48

yakuza-revenge

Solidity
5
star
49

viem-chai-matchers

TypeScript
5
star
50

hardhat-deploy-ethers-old

buidler plugin for ethers v5
TypeScript
5
star
51

bomber-woman

TypeScript
4
star
52

eip-2585

EIP-2585 Minimal Native Meta transaction Forwarder
JavaScript
4
star
53

fungible-bonding-curve

fungible-bonding-curve
Solidity
4
star
54

svelte-wallet

JavaScript
4
star
55

catacombs

TypeScript
4
star
56

missiv

TypeScript
3
star
57

multi-165

Solidity
3
star
58

mixingloom-profiler

A profiler injected at runtime through MixingLoom and as3commons bytecode
ActionScript
3
star
59

duel-in-the-dark

TypeScript
3
star
60

ethereum_gas

Solidity
3
star
61

redstone-composability-hackathon

Solidity
3
star
62

gsn-playground

JavaScript
3
star
63

OpenFLStage3DTest

A test app for openfl stage3d
Haxe
3
star
64

hardhat-vitest-demo

hardhat + vitest
TypeScript
3
star
65

wighawag-game-utils

Game library code that is here temporarely waiting for a better place
Haxe
3
star
66

ethereum-lan-node

A node for LAN network
JavaScript
3
star
67

conquest-website

Svelte
3
star
68

vitalik-secret

A world scale puzzle
Solidity
2
star
69

template-hardhat-plugin

TypeScript
2
star
70

forge-deploy-proxy

Solidity
2
star
71

web3-html-provider

A provider that use an html iframe / popup to allow user to authorize transaction without having to enable CORS on ethereum nodes
HTML
2
star
72

js13k-on-chain

HTML
2
star
73

web3w-walletconnect-v2-loader

wallet connect v2 module for web3w
TypeScript
2
star
74

the_eternal_dungeon

JavaScript
2
star
75

imagesheet

spritesheet lib for kha
Haxe
2
star
76

glsl2agal-lib

simple wrapper to glsl2agal project to generatre a swf usable by NME for converting glsl to agal at runtime
ActionScript
2
star
77

conquest-basic-spaceship-market

TypeScript
2
star
78

ethereum-contracts-test-suite

A suite of test for your smart contracts
TypeScript
2
star
79

VirtualThread

Green Thread implementation in actionscript
ActionScript
2
star
80

javelin

A Tool to manage your haxelib library (update,test,build,install,deploy) using haxelib.json (a superset)
Haxe
2
star
81

template-ethereum-contracts-test

Solidity
2
star
82

spriter_test

test project for spriter runtime and kha renderer
Haxe
2
star
83

contract-tester

Solidity
2
star
84

bleeps-code

repo for the Bleeps
2
star
85

use-stores

React Hooks for Observable / Svelte Stores
TypeScript
2
star
86

ethereum-indexer

ethereum-indexer
TypeScript
2
star
87

chai-ethers

Chai Matchers for ethers type (copied from @ethereum-waffle/chai but without dependencies on ganache-core, etc...)
TypeScript
2
star
88

event-processor-eip721

TypeScript
1
star
89

forge-exec-ipc-server-js

forge-exec-ipc-server-js
TypeScript
1
star
90

ethereum-indexer-snapshots

1
star
91

web3-connection-viem

TypeScript
1
star
92

files

1
star
93

sratagems-wars

A game built on top of Stratagems
TypeScript
1
star
94

yooloot

JavaScript
1
star
95

jolly-roger-web

TypeScript
1
star
96

foam-svelte-kit

JavaScript
1
star
97

sveltore

svelte store package (copied from svelte)
TypeScript
1
star
98

wighawag-view

Entity Views used for game
Haxe
1
star
99

lootxp

Loot XP
TypeScript
1
star
100

hardhat-deploy-doc

1
star