From 8c8b8421f8036a979474c8087f38d0ed6f44eb5b Mon Sep 17 00:00:00 2001 From: mymiracle0118 Date: Fri, 19 Apr 2024 21:18:03 +0200 Subject: [PATCH] complete makefile --- Makefile | 37 +++++++++++++---------------- commands/get_all_nfts.json | 3 +++ commands/get_count.json | 3 +++ commands/get_nft_contract_addr.json | 3 +++ commands/send_nfts.json | 8 +++++++ commands/set_nft_contract_addr.json | 5 ++++ get_count_msg.json | 3 +++ 7 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 commands/get_all_nfts.json create mode 100644 commands/get_count.json create mode 100644 commands/get_nft_contract_addr.json create mode 100644 commands/send_nfts.json create mode 100644 commands/set_nft_contract_addr.json create mode 100644 get_count_msg.json diff --git a/Makefile b/Makefile index c16e03e..340cd04 100644 --- a/Makefile +++ b/Makefile @@ -9,40 +9,37 @@ optimize: test: cargo unit-test +FROM=nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 +AIRDROP_CONTRACT=nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv + make-wallet: - nibid keys add wallet + @nibid keys add wallet show-wallet: - nibid keys show -a ${id} + @nibid keys show -a ${id} upload-testnet: - nibid tx wasm store artifacts/jarvis_airdrop.wasm --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes + @nibid tx wasm store artifacts/jarvis_airdrop.wasm --from ${FROM} --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes instantiate-testnet: - nibid tx wasm instantiate ${id} '{"count": 1}' --admin nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --label airdrop --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes + @nibid tx wasm instantiate ${id} '{"count": 1}' --admin ${FROM} --label airdrop --from ${FROM} --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes get-count: - nibid query wasm contract-state smart nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"get_count":{}}' + $(eval GET_COUNT := $$(shell cat ./commands/get_count.json)) + @nibid query wasm contract-state smart ${AIRDROP_CONTRACT} '$(GET_COUNT)' get-nft-contract-addres: - nibid query wasm contract-state smart nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"get_nft_contract_addr":{}}' + $(eval GET_NFT_CONTRACT_ADDRESS := $$(shell cat ./commands/get_nft_contract_addr.json)) + @nibid query wasm contract-state smart ${AIRDROP_CONTRACT} '$(GET_NFT_CONTRACT_ADDRESS)' get-all-nfts: - nibid query wasm contract-state smart nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"get_all_nfts":{}}' + $(eval GET_ALL_NFTS := $$(shell cat ./commands/get_all_nfts.json)) + @nibid query wasm contract-state smart ${AIRDROP_CONTRACT} '$(GET_ALL_NFTS)' exe-set-nft-contract-addr: - nibid tx wasm execute nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"set_nft_contract_addr":{"addr": "${id}"}}' --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes + $(eval SET_NFT_CONTRACT_ADDR := $$(shell cat ./commands/set_nft_contract_addr.json)) + @nibid tx wasm execute ${AIRDROP_CONTRACT} '$(SET_NFT_CONTRACT_ADDR)' --from ${FROM} --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes exe-send-nfts: - nibid tx wasm execute nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"send_nfts": { \ - "allocations": [ \ - { "recipient": "terra1...", "amount": 3 }, \ - { "recipient": "terra2...", "amount": 5 } \ - ] \ - }}' --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes - -check-real: - nibid tx wasm execute nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"send_nfts": { "allocations": [ { "recipient": "nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv", "amount": 3 }, { "recipient": "nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv", "amount": 5 } ] }}' --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.725unibi --yes - -check: - nibid tx wasm execute nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv '{"send_nfts": { "allocations": [] }}' --from nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692 --gas auto --gas-adjustment 1.5 --gas-prices 0.725unibi --yes \ No newline at end of file + $(eval SEND_NFTS := $$(shell cat ./commands/send_nfts.json)) + @nibid tx wasm execute ${AIRDROP_CONTRACT} '$(SEND_NFTS)' --from ${FROM} --gas auto --gas-adjustment 1.5 --gas-prices 0.025unibi --yes \ No newline at end of file diff --git a/commands/get_all_nfts.json b/commands/get_all_nfts.json new file mode 100644 index 0000000..f173a55 --- /dev/null +++ b/commands/get_all_nfts.json @@ -0,0 +1,3 @@ +{ + "get_all_nfts": {} +} \ No newline at end of file diff --git a/commands/get_count.json b/commands/get_count.json new file mode 100644 index 0000000..769f3f3 --- /dev/null +++ b/commands/get_count.json @@ -0,0 +1,3 @@ +{ + "get_count": {} +} \ No newline at end of file diff --git a/commands/get_nft_contract_addr.json b/commands/get_nft_contract_addr.json new file mode 100644 index 0000000..8de9fce --- /dev/null +++ b/commands/get_nft_contract_addr.json @@ -0,0 +1,3 @@ +{ + "get_nft_contract_addr": {} +} \ No newline at end of file diff --git a/commands/send_nfts.json b/commands/send_nfts.json new file mode 100644 index 0000000..bedb38b --- /dev/null +++ b/commands/send_nfts.json @@ -0,0 +1,8 @@ +{ + "send_nfts": { + "allocations": [ + { "recipient": "nibi1h6rwvqcmu6nj0evgg39u6aq0detsu6a7eax7yf", "amount": 3 }, + { "recipient": "nibi1h6rwvqcmu6nj0evgg39u6aq0detsu6a7eax7yf", "amount": 5 } + ] + } +} \ No newline at end of file diff --git a/commands/set_nft_contract_addr.json b/commands/set_nft_contract_addr.json new file mode 100644 index 0000000..9c43b60 --- /dev/null +++ b/commands/set_nft_contract_addr.json @@ -0,0 +1,5 @@ +{ + "set_nft_contract_addr": { + "addr": "nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv" + } +} \ No newline at end of file diff --git a/get_count_msg.json b/get_count_msg.json new file mode 100644 index 0000000..769f3f3 --- /dev/null +++ b/get_count_msg.json @@ -0,0 +1,3 @@ +{ + "get_count": {} +} \ No newline at end of file