Closed triccs closed 1 year ago
Are you talking about tokenfactory, if it is then the fee will be deducted from funds sending from msg sender.
Thanks for responding @iboss-ptk . Yes I am but for example: If I'm sending funds to a a contract that uses tokenfactory, then that contract would need to also send those funds when calling CreateDenom. I don't see where that happens or where that could be added, unless the .into() adds the funds automatically?
TLDR; you don't need to do anything from contract side, only that msg sender needs to send enough funds for denom creation fee.
When you attach funds to cosmwasm execute msg, it invokes bank
Send
, from msg sender to contract.
After that, in the same tx, with funds owned by contract, the it invokes CreateDenom
with contract as creator.
Then tokenfactory keeper will ask the creator (which is the contract) to fund community pool with amount = denom creation fee.
If the contract has enough funds, it should just consume those funds.
Okay thank you! Seems like a chain interaction I’m not used to, makes sense though that the funds don’t need to be sent.
How is the fee accounted for when creating a CosmosMsg from MsgCreateDenom? For example, if I call a function to create a denom and send the fee alongside it, where is the fee handled? If it isn't then the creation would error right?