Skip to content

Commit

Permalink
makefile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mymiracle0118 committed Apr 20, 2024
1 parent 8c8b842 commit 472bea2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test:
cargo unit-test

FROM=nibi10rdtquh3jl44hg00x0plzeawuclqqet0he4692
AIRDROP_CONTRACT=nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv
AIRDROP_CONTRACT=nibi10jwwkmmn0rzxvfec5swhgvtkh4l94fshz0r8ndj9ldym87lkgdjs4z4cyp

make-wallet:
@nibid keys add wallet
Expand Down
2 changes: 1 addition & 1 deletion artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
385d15d7cf0b20f3681b569dfdbfc26d02270f7b0c8b620d5ed884414259532a jarvis_airdrop.wasm
6cad51fd1cd844c98c7e367b1b0910c4389e8f0c4a69edab1821e7aeb99094f9 jarvis_airdrop.wasm
2 changes: 1 addition & 1 deletion artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d5567d2a0638ed5a53ba728afd13da33e707ad19687e8f41b7ebe5c772291ac1 /target/wasm32-unknown-unknown/release/jarvis_airdrop.wasm
deddb63d42e3a8126c7edda8a28755f4ec6f28ee7f40becb1755b5e3c1be49f7 /target/wasm32-unknown-unknown/release/jarvis_airdrop.wasm
Binary file modified artifacts/jarvis_airdrop.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions commands/send_nfts.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"send_nfts": {
"allocations": [
{ "recipient": "nibi1h6rwvqcmu6nj0evgg39u6aq0detsu6a7eax7yf", "amount": 3 },
{ "recipient": "nibi1h6rwvqcmu6nj0evgg39u6aq0detsu6a7eax7yf", "amount": 5 }
{ "recipient": "nibi1h6rwvqcmu6nj0evgg39u6aq0detsu6a7eax7yf", "amount": 2 },
{ "recipient": "nibi1d3lmwkgjgdyfpsn4xgh299jnpk4r89kd5xs420", "amount": 2 }
]
}
}
2 changes: 1 addition & 1 deletion commands/set_nft_contract_addr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"set_nft_contract_addr": {
"addr": "nibi178kzznh9cepjckjefqc3mgt9gf9rfkyw6kk0pymeypx9rplggvyq9yjjuv"
"addr": "nibi1k3z45lxqeulsyffry77djz2f303echnaa5djgda2fk8n8zphyqtq2ffqq4"
}
}
10 changes: 5 additions & 5 deletions src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cw2::set_contract_version;
use cw721::Cw721ExecuteMsg;

use crate::error::ContractError;
use crate::msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg, AllNftsResponse, NftContractAddrResponse};
use crate::msg::{ExecuteMsg, GetCountResponse, InstantiateMsg, QueryMsg, AllNftsResponse, NftContractAddrResponse, SendNftParam};
use crate::state::{State, STATE, NFTS, NFT_CONTRACT_ADDR};

// version info for migration info
Expand Down Expand Up @@ -108,7 +108,7 @@ pub mod execute {
deps: DepsMut,
_env: Env,
info: MessageInfo,
allocations: Vec<(Addr, u32)>,
allocations: Vec<SendNftParam>,
) -> Result<Response, ContractError> {
let state = STATE.load(deps.storage)?;

Expand All @@ -124,12 +124,12 @@ pub mod execute {
let mut nfts = NFTS.load(deps.storage)?;
let mut response = Response::new().add_attribute("action", "send_nfts");

for (recipient, amount) in allocations {
for _ in 0..amount {
for ele in allocations {
for _ in 0..ele.amount {
if let Some(token_id) = nfts.pop() {
// Create a transfer message for the cw721 NFT
let transfer_msg = Cw721ExecuteMsg::TransferNft {
recipient: recipient.to_string(),
recipient: ele.recipient.to_string(),
token_id: token_id,
};

Expand Down
8 changes: 7 additions & 1 deletion src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum ExecuteMsg {
msg: Binary,
},
SendNfts {
allocations: Vec<(Addr, u32)>, // Each tuple contains an address and the number of NFTs to send
allocations: Vec<SendNftParam>, // Each tuple contains an address and the number of NFTs to send
},
SetNftContractAddr { addr: String },
}
Expand Down Expand Up @@ -49,4 +49,10 @@ pub struct AllNftsResponse {
#[cw_serde]
pub struct NftContractAddrResponse {
pub nft_contract_addr: Addr,
}

#[cw_serde]
pub struct SendNftParam {
pub recipient: Addr,
pub amount: u32
}

0 comments on commit 472bea2

Please sign in to comment.