-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
204 lines (167 loc) · 6.96 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
include Makefile.config
FAUCET_URL=http://0.0.0.0:8081
REST_URL=http://0.0.0.0:8080
TESTNET_URL=https://fullnode.testnet.aptoslabs.com
OWNER=0x0
TESTNET=0x56260c419e8b176e0ca7f6d439b69180c2de2cb284d8dee24476f247af204492
init_profiles:
aptos init --profile owner --rest-url ${REST_URL} --faucet-url ${FAUCET_URL}
aptos init --profile user --rest-url ${REST_URL} --faucet-url ${FAUCET_URL}
init_testnet_prof:
aptos init --profile testnet --rest-url "https://fullnode.testnet.aptoslabs.com/v1"
local_testnet:
aptos node run-local-testnet --with-faucet
local_testnet_restart:
aptos node run-local-testnet --with-faucet --force-restart
# remove bridge module & Move.toml deps before test
test:
aptos move test --skip-fetch-latest-git-deps --named-addresses owner=owner
fund:
aptos account fund-with-faucet \
--profile owner --account owner --amount 999999999
aptos account fund-with-faucet \
--profile user --account user --amount 999999999
compile:
aptos move compile --bytecode-version 6 \
--included-artifacts=${included_artifacts} --skip-fetch-latest-git-deps --save-metadata \
--named-addresses owner=${profile},layerzero_common=${layerzero_common},msglib_auth=${msglib_auth},zro=${zro},msglib_v1_1=${msglib_v1_1},msglib_v2=${msglib_v2},executor_auth=${executor_auth},executor_v2=${executor_v2},layerzero=${layerzero}
compile-common:
cd aptos_bridge/layerzero-common && aptos move compile --included-artifacts=${included_artifacts} --save-metadata --named-addresses layerzero_common=${layerzero_common}
compile_testnet:
aptos move compile --named-addresses owner=testnet
publish:
# mv sources/bridge.move sources/bridge.move2
aptos move publish --named-addresses owner=${profile} \
--bytecode-version=6 --included-artifacts=none \
--sender-account ${profile} --profile ${profile}
# mv sources/bridge.move2 sources/bridge.move
publish_testnet:
aptos move publish --assume-yes --sender-account testnet --profile testnet \
--named-addresses owner=testnet,layerzero_common=${TESTNET_ENDPOINT},msglib_auth=${TESTNET_ENDPOINT},zro=${TESTNET_ENDPOINT},msglib_v1_1=${TESTNET_ENDPOINT},executor_auth=${TESTNET_ENDPOINT},executor_v2=${TESTNET_ENDPOINT},msglib_v2=${TESTNET_ENDPOINT},layerzero=${TESTNET_ENDPOINT}
set_remote:
aptos move run --assume-yes --function-id ${profile}::bridge::set_remote \
--sender-account=${profile} --profile=${profile} \
--args u64:10121 "u8:[]"
send_to_remote:
aptos move run --assume-yes --function-id ${profile}::bridge::send_to_remote \
--sender-account=${profile} --profile=${profile} \
--args u64:10121 u64:555 "u8:[]"
mint_shovel:
aptos move run --function-id ${TESTNET}::urn_to_earn::mint_shovel \
--sender-account=${profile} --profile=${profile}
wl_mint_shovel:
aptos move run --function-id ${OWNER}::urn_to_earn::bayc_wl_mint_shovel \
--sender-account=user --profile=user
add_burned:
aptos move run --function-id ${OWNER}::urn::add_burned \
--sender-account=owner --profile=owner \
--args address:${OWNER} bool:false
mint_shovel_testnet:
aptos move run-script --assume-yes \
--compiled-script-path build/urn/bytecode_scripts/mint_shovel.mv \
--sender-account=testnet --profile=testnet
mint_urn_testnet:
aptos move run-script --assume-yes \
--compiled-script-path build/urn/bytecode_scripts/mint_urn.mv \
--sender-account=testnet --profile=testnet
dig:
aptos move run --function-id ${OWNER}::urn_to_earn::dig \
--sender-account=owner --profile=owner
dig_testnet:
aptos move run-script --assume-yes \
--compiled-script-path build/urn/bytecode_scripts/dig.mv \
--sender-account=testnet --profile=testnet
query_owner_res:
aptos account list --query resources --account owner --profile owner
query_user_res:
aptos account list --query resources --account user --profile user
query_testnet_res:
aptos account list --query resources --account testnet --profile testnet
view:
curl --request POST \
--url ${REST_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "0x1::coin::is_coin_initialized", \
"type_arguments": [ "0x1::aptos_coin::AptosCoin" ], \
"arguments": [] \
}'
add_wl:
aptos move run-script --assume-yes \
--compiled-script-path build/urn_to_earn/bytecode_scripts/add_to_whitelist.mv \
--sender-account ${profile} --profile ${profile} \
add_collection:
aptos move run-script --assume-yes \
--compiled-script-path build/urn_to_earn/bytecode_scripts/add_collection.mv \
--sender-account ${profile} --profile ${profile} \
transfer_knife:
aptos move run-script --assume-yes \
--compiled-script-path build/urn_to_earn/bytecode_scripts/transfer_knife.mv \
--sender-account ${profile} --profile ${profile} \
get_collection_left_quota:
curl --request POST \
--url ${REST_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${OWNER}::whitelist::get_collection_left_quota", \
"type_arguments": [], \
"arguments": ["BAYC"] \
}'
get_collection_left_quota_testnet:
curl --request POST \
--url ${TESTNET_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${TESTNET}::whitelist::get_collection_left_quota", \
"type_arguments": [], \
"arguments": ["BAYC"] \
}'
view_is_whitelisted:
curl --request POST \
--url ${REST_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${OWNER}::whitelist::view_is_whitelisted", \
"type_arguments": [], \
"arguments": ["BAYC", "0x572941edfecf00c392ebf17fdb20729be425ecb5ce018999f19e7e2be534676f"] \
}'
view_is_whitelisted_testnet:
curl --request POST \
--url ${TESTNET_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${TESTNET}::whitelist::view_is_whitelisted", \
"type_arguments": [], \
"arguments": ["Blocto", "0x14bb3a81a6a92db55f4ef6f4f1abef445c418a33d5ddfd4bd672346c9db38add"] \
}'
view_is_whitelisted_and_minted_testnet:
curl --request POST \
--url ${TESTNET_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${TESTNET}::whitelist::view_is_whitelisted_and_minted", \
"type_arguments": [], \
"arguments": ["Blocto", "0x14bb3a81a6a92db55f4ef6f4f1abef445c418a33d5ddfd4bd672346c9db38add"] \
}'
view_quote_fee:
aptos move view --profile=${profile} --function-id ${profile}::bridge::quote_fee_view --args u64:10121 string:'' bool:false
view_get_default_send_msglib:
aptos move view --profile=${profile} --function-id ${profile}::bridge::get_default_send_msglib --args u64:10121
set_seed:
aptos move run --function-id ${profile}::urn_to_earn::set_seed \
--sender-account=${profile} --profile=${profile} \
view_seed:
aptos move view --profile=${profile} --function-id ${profile}::urn_to_earn::view_seed
sum:
curl --request POST \
--url ${TESTNET_URL}/v1/view \
--header 'Content-Type: application/json' \
--data '{ \
"function": "${TESTNET}::whitelist::sum", \
"type_arguments": [], \
"arguments": [["5", "6"]] \
}'
sum2:
aptos move run --function-id ${OWNER}::whitelist::sum2 \
--sender-account=owner --profile=owner \
--args 'vector<u64>:1,2,3'