Conversation
✅ Deploy Preview for gno-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for teritori-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
16add6e to
3d47178
Compare
…chpad contract config, enhance nft-launchpad deploying scripts
7127c7d to
d4b1e0c
Compare
…thub.com/TERITORI/teritori-dapp into feat-contract-nft-launchpad-dao-proposal
Ensure proposal_id from dao-proposal-single execute_propose is got Ensure it's emitted in wasm attributes Enhance multitest (Could be more enhanced)
…:TERITORI/teritori-dapp into feat-contract-nft-launchpad-dao-proposal
| if let Some(proposal_single_contract) = changes.proposal_single_contract { | ||
| config.proposal_single_contract = | ||
| ctx.deps.api.addr_validate(&proposal_single_contract)?; | ||
| attributes.push(attr("new_name", proposal_single_contract.to_string())) |
There was a problem hiding this comment.
| attributes.push(attr("new_name", proposal_single_contract.to_string())) | |
| attributes.push(attr("new_prop_contract", proposal_single_contract.to_string())) |
There was a problem hiding this comment.
Oops yes, forgot this point. Commit will come
| msg: to_json_binary(&ExecuteMsg::DeployCollection { | ||
| collection_id: collection_id.clone(), | ||
| })?, |
There was a problem hiding this comment.
where is the DeployCollection handler?
There was a problem hiding this comment.
I though this would work https://github.com/TERITORI/teritori-dapp/blob/feat-contract-nft-launchpad-dao-proposal/rust/cw-contracts/nft-launchpad/src/contract.rs#L24-L27.
It's a custom message to put here:
https://github.com/DA0-DA0/dao-contracts/blob/main/packages/dao-voting/src/proposal.rs#L25-L27
/// The messages that should be executed in response to this
/// proposal passing.
pub msgs: Vec<CosmosMsg<Empty>>,
| "proposal_id".to_string(), | ||
| ))? | ||
| .to_owned(); | ||
|
|
There was a problem hiding this comment.
so we do nothing with the proposal_id?
There was a problem hiding this comment.
It's used in the indexer to update the DB (not merged), but we could store it onchain such as deploy_address or merkle_root
WIP zone in the code
teritori-dapp/rust/cw-contracts/nft-launchpad/src/contract.rs
Lines 162 to 163 in c7b5375
Why this PR ?
This flow is bad: https://github.com/TERITORI/teritori-dapp/blob/feat/cosmwasm-launchpad/packages/hooks/launchpad/useProposeApproveProject.ts#L29-L112
The front must not create a proposal. Also, there is too much back-and-forth between nft-launchpad contract, front and indexer.
The good way is to have the nft-launchpad contract as entry point for project approbation.
Also, the proposal must be created when the project is ready for review. The user don't have to create manually the proposal.
Then, indexer logic can be triggered from the nft-launchpad contract logic. This flow must be agnostic regarding to the front.
So, we'll execute DAO stuff from nft-launchpad contract. To do that, we'll need to store the DAO contract in the nft-launchpad contract config.
The DAO contract used to make the proposal is the Proposal Single one: https://github.com/DA0-DA0/dao-contracts/tree/development/contracts/proposal/dao-proposal-single.
To instantiate the nft-launchpad contact, we need to deploy/instantiate other contracts, so there are many changes in
network-setup/scripts/So, I've updated:
update_merkle_rootlogic. This is the place where to trigger the proposal creation (this PR's purpose)proposal_idis emitted and will be stored in DBCosmWasmNFTLaunchpadfeaturescriptsfolder, to be clearer and versatile. I modified some files here, and sliced "script" TS files and functions TS filescreateDaoMemberBasedfunction fromdao.tsto make it react-native agnostic: Now, we must pass clients to the function. So, we can use this function in scriptsThe biggest changes
All the changes are made to satisfy the main work done on:
and packages/scripts/network-setup/NftLaunchpad/deployNftLaunchpad.ts
Current state
nft-launchpad/multitest.ts runs successfully, that means we can get the created Proposal ID when updating the Merkle Root.
==> When the author completes its collection, an associated proposal is created. The proposal id can be stored.
Have to fix the CI !