Add upgrade fee payment for wl member limit increase
This commit is contained in:
parent
7c6ca46400
commit
d95ab021ec
@ -243,7 +243,17 @@ export const WhiteList = (client: SigningCosmWasmClient, txSigner: string): Whit
|
|||||||
}
|
}
|
||||||
|
|
||||||
const increaseMemberLimit = async (limit: number): Promise<string> => {
|
const increaseMemberLimit = async (limit: number): Promise<string> => {
|
||||||
const res = await client.execute(txSigner, contractAddress, { increase_member_limit: limit }, 'auto')
|
const whitelistConfig = await config()
|
||||||
|
const currentLimit = Number(whitelistConfig.member_limit)
|
||||||
|
const upgradeFee = (Math.ceil(limit / 1000) - Math.ceil(currentLimit / 1000)) * 100000000
|
||||||
|
const res = await client.execute(
|
||||||
|
txSigner,
|
||||||
|
contractAddress,
|
||||||
|
{ increase_member_limit: limit },
|
||||||
|
'auto',
|
||||||
|
'Increase Member Limit',
|
||||||
|
upgradeFee === 0 ? undefined : [coin(upgradeFee.toString(), 'ustars')],
|
||||||
|
)
|
||||||
return res.transactionHash
|
return res.transactionHash
|
||||||
}
|
}
|
||||||
/// EXECUTE END
|
/// EXECUTE END
|
||||||
|
Loading…
Reference in New Issue
Block a user