generated from foundry-rs/forge-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (37 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
install: solc update npm
# dapp deps
update:; dapp update
# npm deps for linting etc.
npm:; yarn install
# install solc version
# example to install other versions: `make solc 0_8_2`
SOLC_VERSION := 0_8_7
solc:; nix-env -f https://github.com/dapphub/dapptools/archive/master.tar.gz -iA solc-static-versions.solc_${SOLC_VERSION}
# Build & test
build :; dapp build
test :; dapp test # --ffi # enable if you need the `ffi` cheat code on HEVM
clean :; dapp clean
lint :; yarn run lint
estimate :; ./scripts/estimate-gas.sh ${contract}
size :; ./scripts/contract-size.sh ${contract}
# Deployment helpers
deploy :; @./scripts/deploy.sh
# mainnet
deploy-mainnet: export ETH_RPC_URL = $(call network,mainnet)
deploy-mainnet: check-api-key deploy
# rinkeby
deploy-rinkeby: export ETH_RPC_URL = $(call network,rinkeby)
deploy-rinkeby: check-api-key deploy
check-api-key:
ifndef ALCHEMY_API_KEY
$(error ALCHEMY_API_KEY is undefined)
endif
# Returns the URL to deploy to a hosted node.
# Requires the ALCHEMY_API_KEY env var to be set.
# The first argument determines the network (mainnet / rinkeby / ropsten / kovan / goerli)
define network
https://eth-$1.alchemyapi.io/v2/${ALCHEMY_API_KEY}
endef