Subspaces CosmWASM contracts #752
Replies: 2 comments 2 replies
-
Speaking from a technical feasibility perspective: It is. But not in a straight forward way. Let me explain a little bit. They are respectively:
Unfortunately, this is not enough to achieve our purposes. With one of these setup, even if we create a
What I think we can do is fork wasmd and edit it's logic so it uses subspaces to check on contracts store/interactions. |
Beta Was this translation helpful? Give feedback.
-
This is something always in my mind as I always think how smart contracts being deployed on My ideal scenario is similar to what @RiccardoM mentioned that smart contract deployment should be done with stake (locked tokens). This amount cannot be withdrawn from the chain as the deployment has been done. And the staked amount should be slashable when disaster happens. We may consider setting multiple levels of staking as issuing However, I understand this is not easy to achieve. Also defining the scenarios of slashing maybe too complicated and the result could be trivial. We can see that most token hodlers don’t care about slashing/security but focus on quick money. As @bragaz mentioned, of course we can fork The simplest solution is to incur a very high transaction fee for deploying smart contracts. This is similar to the current NFT contracts on In the case of
The smart contract deployment fee should be a parameter so that it can be updated by governance. |
Beta Was this translation helpful? Give feedback.
-
Following the merge of #728 which introduces the concept of subspace as described inside ADR-006, developer will now have the ability to create application-specific subspaces inside Desmos.
To make sure that DApps developers can leverage the full power of Desmos, we need to make sure that they are able to run CosmWASM contracts inside their own subspace. This will allow them to build custom DApps tokenomics as well as custom features that might not be available directly inside Desmos.
That being said, one question is raised: who should be able to deploy a CosmWASM smart contract inside Desmos?.
Current status of CosmWASM deployment on different chains
This same question has been raised inside other Cosmos chains, and two completely opposite solutions have emerged:
Obviously, both of the two methods have each one their pro and cons.
Permissionless deployment
Pros
Cons
Permissioned deployment
Pros
Cons
Considerations about Desmos
Although the two solutions might work on different scenarios, I think neither of the two would work properly inside Desmos due to the fact that:
That being said, I think what we could implement is a hybrid system in which we allow for permissionless deployment only to users that satisfy some requirements.
Semi-permissioned deployment
Since each smart contract will be tied to a subspace, what we can do is require developers to lock some tokens before being able to deploy a smart contract. The amount of token can then be based on a on-chain parameter that the community can change with a governance proposal.
The flow would then be:
This economic requirements acts as a way to prevent users from deploying smart contracts that are either malicious to the chain or are not related to Desmos at all (in this case they can choose another chain).
Note that the required amount does not need to be put only by the developer. It could be locked also using the subspace treasury or by a group of user that want to see that smart contract being deployed.
The only thing necessary for this to work is to make sure, each time a smart contracts needs to execute, that there is enough money locked. If such amount is below the minimum threshold at any given time, the smart contract should become unexecutable until more tokens have been locked.
Please @kwunyeung @bragaz @dadamu @manu0466 let me know what do you think about this approach, if you see any flaws in that and, most importantly, if it's technically doable.
Beta Was this translation helpful? Give feedback.
All reactions