-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
111 lines (95 loc) · 2.88 KB
/
Copy pathMakefile
File metadata and controls
111 lines (95 loc) · 2.88 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# StageRaise Makefile
-include .env
# Build & Clean
build:
forge build
clean:
forge clean
# Dependencies
install:
forge install
# Testing
test:
forge test
test-unit:
forge test --match-path "**/uint/**"
test-integration:
forge test --match-path "**/integration/**"
test-fork-sepolia:
forge test --fork-url ${SEPOLIA_RPC_URL}
test-fork-mainnet:
forge test --fork-url ${MAINNET_RPC_URL}
coverage:
forge coverage
# Local node
anvil:
anvil
# Code quality
format:
forge fmt
# Deployment (using keystore)
# First time setup: Create keystore with 'cast wallet import <account-name> --interactive'
# Then use the account name in deploy commands below
# Deploy to Anvil (local)
deploy-local:
forge script script/DeployStageRaise.s.sol:DeployStageRaise --rpc-url http://localhost:8545 --broadcast -vvvv
# Deploy to BSC Testnet
deploy-bsc-testnet:
@echo "Deploying to BSC Testnet..."
@read -p "Enter your keystore account name: " ACCOUNT; \
forge script script/DeployStageRaise.s.sol:DeployStageRaise \
--rpc-url https://data-seed-prebsc-1-s1.binance.org:8545 \
--account $$ACCOUNT \
--broadcast \
--verify \
--etherscan-api-key ${BSCSCAN_API_KEY} \
--legacy \
-vvvv
# Deploy to BSC Testnet (alternative RPC)
deploy-bsc-testnet-alt:
@echo "Deploying to BSC Testnet (Alternative RPC)..."
@read -p "Enter your keystore account name: " ACCOUNT; \
forge script script/DeployStageRaise.s.sol:DeployStageRaise \
--rpc-url https://bsc-testnet.publicnode.com \
--account $$ACCOUNT \
--broadcast \
--verify \
--etherscan-api-key ${BSCSCAN_API_KEY} \
--legacy \
-vvvv
# Deploy to BSC Mainnet
deploy-bsc-mainnet:
@echo "⚠️ WARNING: Deploying to BSC MAINNET ⚠️"
@read -p "Enter your keystore account name: " ACCOUNT; \
forge script script/DeployStageRaise.s.sol:DeployStageRaise \
--rpc-url https://bsc-dataseed.binance.org \
--account $$ACCOUNT \
--broadcast \
--verify \
--etherscan-api-key ${BSCSCAN_API_KEY} \
--legacy \
-vvvv
# Deploy to Sepolia
deploy-sepolia:
@echo "Deploying to Sepolia..."
@read -p "Enter your keystore account name: " ACCOUNT; \
forge script script/DeployStageRaise.s.sol:DeployStageRaise \
--rpc-url ${SEPOLIA_RPC_URL} \
--account $$ACCOUNT \
--broadcast \
--verify \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
-vvvv
# Verify contract on BSCScan (if auto-verify failed)
verify-bsc:
@echo "Verifying on BSCScan..."
@read -p "Enter contract address: " CONTRACT; \
@read -p "Enter USDC address: " USDC; \
@read -p "Enter USDT address: " USDT; \
@read -p "Enter BUSD address: " BUSD; \
forge verify-contract $$CONTRACT \
src/StageRaise.sol:StageRaise \
--chain-id 97 \
--constructor-args $$(cast abi-encode "constructor(address,address,address)" $$USDC $$USDT $$BUSD) \
--etherscan-api-key ${BSCSCAN_API_KEY} \
--watch