-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (53 loc) · 3.26 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
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
-include .env
####################
# DEPLOY CONTRACTS #
####################
deploy-oft-to-sepolia:
forge create src/OFT_Sepolia.sol:OFT_Sepolia --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY)
deploy-oft-to-mumbai:
forge create src/OFT_Mumbai.sol:OFT_Mumbai --rpc-url $(MUMBAI_RPC_URL) --private-key $(PRIVATE_KEY)
####################
# VERIFY CONTRACTS #
####################
verify-deployed-contract-on-sepolia:
forge verify-contract --chain-id 11155111 --watch $(SEPOLIA_OFT_ADDRESS) src/OFT_Sepolia.sol:OFT_Sepolia --etherscan-api-key $(ETHERSCAN_KEY)
verify-deployed-contract-on-mumbai:
forge verify-contract --chain-id 80001 --watch $(MUMBAI_OFT_ADDRESS) src/OFT_Mumbai.sol:OFT_Mumbai --etherscan-api-key $(POLYGONSCAN_KEY)
#######################################
# SET PEERS - aka 'wire up' contracts #
#######################################
set-peer-on-sepolia-contract:
cast send $(SEPOLIA_OFT_ADDRESS) "setPeer(uint32,bytes32)" 40109 $(MUMBAI_BYTES32_PEER) --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY)
set-peer-on-mumbai-contract:
cast send $(MUMBAI_OFT_ADDRESS) "setPeer(uint32,bytes32)" 40161 $(SEPOLIA_BYTES32_PEER) --rpc-url $(MUMBAI_RPC_URL) --private-key $(PRIVATE_KEY)
############################
# CHECK PEERS ARE WIRED UP #
############################
check-sepolia-peer:
cast call $(SEPOLIA_OFT_ADDRESS) "isPeer(uint32,bytes32)(bool)" 40109 $(MUMBAI_BYTES32_PEER) --rpc-url $(SEPOLIA_RPC_URL)
check-mumbai-peer:
cast call $(MUMBAI_OFT_ADDRESS) "isPeer(uint32,bytes32)(bool)" 40161 $(SEPOLIA_BYTES32_PEER) --rpc-url $(MUMBAI_RPC_URL)
########################
# CHECK TOTAL BALANCES #
########################
check-sepolia-total-supply:
cast call $(SEPOLIA_OFT_ADDRESS) "totalSupply()(uint)" --rpc-url $(SEPOLIA_RPC_URL)
check-mumbai-total-supply:
cast call $(MUMBAI_OFT_ADDRESS) "totalSupply()(uint)" --rpc-url $(MUMBAI_RPC_URL)
########################
# SET ENFORCED OPTIONS #
########################
set-enforced-options-on-sepolia-contract:
cast send $(SEPOLIA_OFT_ADDRESS) "setEnforcedOptions((uint32,uint16,bytes)[])" "[(40109,1,0x00030100110100000000000000000000000000030d40)]" --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY)
########################################
# CALL quoteSend() TO GET GAS ESTIMATE #
########################################
get-send-quote-on-sepolia:
cast call $(SEPOLIA_OFT_ADDRESS) "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)(uint,uint)" "(40109,$(MUMBAI_BYTES32_PEER),100000000000000,100000000000000,0x00030100110100000000000000000000000000030d40,0x,0x)" false --rpc-url $(SEPOLIA_RPC_URL)
get-send-quote-on-mumbai:
cast call $(MUMBAI_OFT_ADDRESS) "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)(uint,uint)" "(40161,$(MUMBAI_BYTES32_PEER),100000000000000,100000000000000,0x00030100110100000000000000000000000000030d40,0x,0x)" false --rpc-url $(MUMBAI_RPC_URL)
###################
# SEND TOKENS !!! #
###################
send-tokens-from-sepolia-to-mumbai:
cast send $(SEPOLIA_OFT_ADDRESS) "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint,uint),address)" "(40109,$(MUMBAI_BYTES32_PEER),10000000000000000000,10000000000000000000,0x,0x,0x)" "(10000000000000000,0)" $(PUBLIC_ADDRESS) --rpc-url $(SEPOLIA_RPC_URL) --private-key $(PRIVATE_KEY) --value 0.01ether