Merge pull request #180 from public-awesome/account-for-zero-airdrop-fee
This commit is contained in:
commit
7b18cffe87
@ -361,7 +361,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
console.log((Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100)
|
const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)
|
||||||
const res = await client.execute(
|
const res = await client.execute(
|
||||||
senderAddress,
|
senderAddress,
|
||||||
contractAddress,
|
contractAddress,
|
||||||
@ -370,12 +370,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
},
|
},
|
||||||
'auto',
|
'auto',
|
||||||
'',
|
'',
|
||||||
[
|
airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [],
|
||||||
coin(
|
|
||||||
(Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100,
|
|
||||||
'ustars',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
return res.transactionHash
|
return res.transactionHash
|
||||||
})
|
})
|
||||||
@ -396,7 +391,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)
|
||||||
const executeContractMsgs: MsgExecuteContractEncodeObject[] = []
|
const executeContractMsgs: MsgExecuteContractEncodeObject[] = []
|
||||||
for (let i = 0; i < batchNumber; i++) {
|
for (let i = 0; i < batchNumber; i++) {
|
||||||
const msg = {
|
const msg = {
|
||||||
@ -408,12 +403,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
sender: senderAddress,
|
sender: senderAddress,
|
||||||
contract: contractAddress,
|
contract: contractAddress,
|
||||||
msg: toUtf8(JSON.stringify(msg)),
|
msg: toUtf8(JSON.stringify(msg)),
|
||||||
funds: [
|
funds: airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [],
|
||||||
coin(
|
|
||||||
(Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100,
|
|
||||||
'ustars',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,7 +431,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
'Unable to retrieve a valid airdrop mint price. It may be that the given contract address does not belong to a Open Edition Factory.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
const airdropFee = Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)
|
||||||
const executeContractMsgs: MsgExecuteContractEncodeObject[] = []
|
const executeContractMsgs: MsgExecuteContractEncodeObject[] = []
|
||||||
for (let i = 0; i < recipients.length; i++) {
|
for (let i = 0; i < recipients.length; i++) {
|
||||||
const msg = {
|
const msg = {
|
||||||
@ -453,12 +443,7 @@ export const openEditionMinter = (client: SigningCosmWasmClient, txSigner: strin
|
|||||||
sender: senderAddress,
|
sender: senderAddress,
|
||||||
contract: contractAddress,
|
contract: contractAddress,
|
||||||
msg: toUtf8(JSON.stringify(msg)),
|
msg: toUtf8(JSON.stringify(msg)),
|
||||||
funds: [
|
funds: airdropFee > 0 ? [coin(airdropFee / 100 / 100, 'ustars')] : [],
|
||||||
coin(
|
|
||||||
(Number(price) * Number(factoryParameters.params.extension?.airdrop_mint_fee_bps)) / 100 / 100,
|
|
||||||
'ustars',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user