From 252a7b27b0f56132fed40659716f5d30263af169 Mon Sep 17 00:00:00 2001 From: Sergey Ratiashvili Date: Thu, 11 Jul 2024 17:34:01 +0200 Subject: [PATCH 1/2] feat: drop preproprose no timelock --- src/dao.ts | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++- src/types.ts | 2 ++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/dao.ts b/src/dao.ts index f92e2d2..a87f28e 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -32,7 +32,8 @@ import { ParamsGlobalfeeInfo, ParamsInterchainqueriesInfo, ParamsInterchaintxsInfo, - ParamsTokenfactoryInfo, ParamsTransferInfo, + ParamsTokenfactoryInfo, + ParamsTransferInfo, pinCodesCustomAuthorityProposal, pinCodesProposal, removeSchedule, @@ -1242,6 +1243,56 @@ export class DaoMember { ); } + async submitDropPauseProposal( + contractAddr: string, + customModule = 'single', + ): Promise { + const message = { + wasm: { + execute: { + contract_addr: contractAddr, + msg: wrapMsg({ + pause: {}, + }), + funds: [], + }, + }, + }; + + return await this.submitSingleChoiceProposal( + 'pause proposal', + 'pauses contract', + [message], + '', + customModule, + ); + } + + async submitDropUnpauseProposal( + contractAddr: string, + customModule = 'single', + ): Promise { + const message = { + wasm: { + execute: { + contract_addr: contractAddr, + msg: wrapMsg({ + unpause: {}, + }), + funds: [], + }, + }, + }; + + return await this.submitSingleChoiceProposal( + 'pause proposal', + 'pauses contract', + [message], + '', + customModule, + ); + } + async submitUntypedPauseProposal( contractAddr: string, duration = 10, @@ -1947,6 +1998,9 @@ export const deploySubdao = async ( const preProposeNonTimelockedPauseCodeId = await cm.storeWasm( NeutronContract.SUBDAO_PREPROPOSE_NO_TIMELOCK, ); + const preProposeDropNonTimelockedPauseCodeId = await cm.storeWasm( + NeutronContract.SUBDAO_DROP_PREPROPOSE_NO_TIMELOCK, + ); const timelockCodeId = await cm.storeWasm(NeutronContract.SUBDAO_TIMELOCK); const votingModuleInstantiateInfo = { code_id: cw4VotingCodeId, @@ -2047,6 +2101,30 @@ export const deploySubdao = async ( msg: wrapMsg(nonTimelockedPauseProposeInstantiateMessage), }; + const nonTimelockedDropPauseProposeInstantiateMessage = { + threshold: { absolute_count: { threshold: '1' } }, + max_voting_period: { height: 10 }, + allow_revoting: false, + pre_propose_info: { + module_may_propose: { + info: { + code_id: preProposeDropNonTimelockedPauseCodeId, + label: + 'neutron.subdaos.test.proposal.single_nt_pause.pre_propose_drop', + msg: wrapMsg({ + open_proposal_submission: true, + }), + }, + }, + }, + close_proposal_on_execution_failure: false, + }; + const nonTimelockedDropPauseProposalModuleInstantiateInfo = { + code_id: proposeCodeId, + label: 'neutron.subdaos.test.proposal.single_nt_pause_drop', + msg: wrapMsg(nonTimelockedDropPauseProposeInstantiateMessage), + }; + const coreInstantiateMessage = { name: 'SubDAO core test 1', description: 'serves testing purposes', @@ -2055,6 +2133,7 @@ export const deploySubdao = async ( proposalModuleInstantiateInfo, proposal2ModuleInstantiateInfo, nonTimelockedPauseProposalModuleInstantiateInfo, + nonTimelockedDropPauseProposalModuleInstantiateInfo, ], main_dao: mainDaoCoreAddress, security_dao: securityDaoAddr, diff --git a/src/types.ts b/src/types.ts index 2dd25cc..4a2ea18 100644 --- a/src/types.ts +++ b/src/types.ts @@ -142,6 +142,8 @@ export const NeutronContract = { SUBDAO_CORE: 'cwd_subdao_core.wasm', SUBDAO_PREPROPOSE: 'cwd_subdao_pre_propose_single.wasm', SUBDAO_PREPROPOSE_NO_TIMELOCK: 'cwd_security_subdao_pre_propose.wasm', + SUBDAO_DROP_PREPROPOSE_NO_TIMELOCK: + 'cwd_drop_security_subdao_pre_propose.wasm', SUBDAO_PROPOSAL: 'cwd_subdao_proposal_single.wasm', SUBDAO_TIMELOCK: 'cwd_subdao_timelock_single.wasm', LOCKDROP_VAULT: 'lockdrop_vault.wasm', From 1fd3de2db5396d941afac9d0b4e9ac1185d067fa Mon Sep 17 00:00:00 2001 From: Sergey R Date: Fri, 19 Jul 2024 12:22:59 +0200 Subject: [PATCH 2/2] fix: typo Co-authored-by: sotnikov-s <34917380+sotnikov-s@users.noreply.github.com> --- src/dao.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dao.ts b/src/dao.ts index a87f28e..7d3e0a2 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -1285,8 +1285,8 @@ export class DaoMember { }; return await this.submitSingleChoiceProposal( - 'pause proposal', - 'pauses contract', + 'unpause proposal', + 'unpauses contract', [message], '', customModule,