CosmWasm Smart Contracts
Stargaze runs community-governed CosmWasm. All this means is that custom smart contracts have to be uploaded via governance.
Because Stargaze has zero gas, smart contracts have to be designed to not exceed compute or storage limits.
Without going through governance, it would be easy to upload a malicious contract that exploits having zero gas (such as a state bloat attack). By going through governance, custom contracts can be reviewed by the community and core team.
- 1.
- 2.If the contract charges any fees, be sure to take advantage of Stargaze’s Developer Royalties. Developer Royalties enables developers to earn 50% of all fees that go through their custom contracts.
- 3.Submit a Commonwealth post, explaining what your contract does, with a link to the source code. Smart contracts on Stargaze are required to be open source. Non-contract code such as frontend and backend may be private.
- 4.Contact the Core Team for a review and audit of your code.
- 5.After validating the project with the community and team, submit a governance proposal with the contract code. See the following command to submit your proposal:
starsd tx gov submit-proposal wasm-store -h
.
Join Discord for more information on deploying on testnet. The testnet is completely permissionless. A faucet is also available in Discord.
Developer Royalties cannot be combined with bounties or Community Pool funding. For example, if you receive Community Pool funding for your contract, it cannot also receive Developer Royalties.
Stargaze is a permissioned chain, meaning there is a governance process to adhere to. After familiarizing yourself with the https://github.com/public-awesome/docs/blob/main/governance/protocol-governance/README.md, here's a template to follow for submitting an on-chain proposal.
To submit a governance proposal via the
starsd
CLI, you may follow the example below.If you don't have
starsd
on your machine, please follow https://github.com/public-awesome/docs/blob/main/nodes-and-validators/getting-setup/README.md.title="Smart contract you're proposing"
desc=$(cat desc.md | jq -Rsa | tr -d '"')
deposit="20000000000ustars"
starsd tx gov submit-proposal wasm-store your_contract_binary.wasm \
--title "$title" \
--description "$desc" \
--deposit $deposit \
--run-as $CREATOR \
--from $PROPOSER \
--gas 30000000 --gas-prices 0ustars -y
Last modified 27d ago