通用合约是指不需要 Sei 的 dex 模块功能的 CosmWasm 合约 A generic contract refers to a CosmWasm contract that does not require functionalities from Sei's dex module
If you have your own chain running already (see instruction here), the following steps show how to upload your contract to that chain. Sei is a permissioned network, which means that only wasm contracts which are voted on by governance can be deployed to the chain.
如果您已经有自己的链在运行(参见此处的说明),请执行以下展示如何将您合约上传到该链步骤。 Sei 是一个许可网络,这意味着只有经过治理投票的 wasm 合约才能部署到链上。
1.构建 Cosmwasm 合约 (1.Build Cosmwasm contract)
Build the image. Note that the following steps are run from your contract directory, so they assume seid is in your $PATH:
Go back to sei-chain repo, and submit a governance proposal to upload the wasm contract.
返回 sei-chain repo,并提交治理提案以上传 wasm 合约。
seid tx gov submit-proposal wasm-store artifacts/$CONTRACTNAME.wasm \
--from $(seid keys show -a $ACCOUNT_NAME) \
--run-as $(seid keys show -a $ACCOUNT_NAME) \
--title "<Enter title proposal title for uploading of wasm contract>" \
--description "<Enter description of proposal and contract>" \
--chain-id sei-chain \
--instantiate-everybody "false" \
--instantiate-only-address $(seid keys show -a $ACCOUNT_NAME) \
--broadcast-mode=block \
--gas=500000 \
--fees=10000000usei
Once the governance proposal has been submitted, it must be approved by governance. Find the proposal id and vote on it
治理提案一经提交,必须得到治理层的批准。找到提案 id 并对其进行投票
4.实例化合约 (4.Instantiating contract)
Once your proposal is approved, you can instantiate your contract.
一旦您的提案获得批准,您就可以实例化您的合约。
Note in this example the $CONTRACT_ID is 1 and $LABEL is any contract name you want:
注意在这个例子中 $CONTRACT_ID 是 1 并且 $LABEL 是你想要的任何合约名称:
Note that the '{}' part is the parameters you pass to instantiate the contract. In this example, the contract takes no parameter so '{}' suffices. For any real world contracts, their instantiation parameters would likely be non-empty. For example, to instantiate Vortex contract, the following parameters need to be used instead (the actual values need/can be changed though):
From the output, you can see that your contract was created at address: sei1wug8sewp6cedgkmrmvhl3lf3tulagm9hnvy8p0rppz9yjw0g4wtqdxfzff. You will need this address for any contract interaction.