CosmWasm / wasmd

Basic cosmos-sdk app with web assembly smart contracts
Other
364 stars 386 forks source link

Add a way to create a ContractExecutionAuthorization that can utilize any coins/denoms. #1845

Open kakucodes opened 4 months ago

kakucodes commented 4 months ago

Currently the way things work are that you either whitelist the specific denoms that are allowed via the MaxFunds/Combined limit or you use MaxCalls which doesn't allow any denoms, but there is no way to allow any/every denom. This puts some heavy restrictions on when/how the authorization can be used.

A concrete use case that I currently am facing: I have a contract that users can deposit uatom and uosmo into and can claim rewards from (in those same assets that were deposited). Normally I could use a ContractExecutionAuthorization (with a max funds in uatom and uosmo) to be able to claim the rewards and deposit them back performing compounding. The issue comes in when the contract adds a third denom as a permissible deposit/reward so now people can also deposit uusdc and my ContractExecutionAuthorization can claim the uusdc but can no longer deposit it back into the contract. This is where an any denom option would be immensely helpful.