From ac38d6e1fd50b80cd3ba3cece9bc43d5ea10dfa7 Mon Sep 17 00:00:00 2001 From: Jake Hartnell Date: Thu, 28 Sep 2023 16:38:47 -0400 Subject: [PATCH] ModuleInstantiateInfo callback to accept ownership of new NFT contract Ownship transfer process is two steps now, so the DAO needs to accept the ownership transfer. --- .../dao-voting-cw721-staked/src/contract.rs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/contracts/voting/dao-voting-cw721-staked/src/contract.rs b/contracts/voting/dao-voting-cw721-staked/src/contract.rs index 3fd4a52f5..202340f52 100644 --- a/contracts/voting/dao-voting-cw721-staked/src/contract.rs +++ b/contracts/voting/dao-voting-cw721-staked/src/contract.rs @@ -9,6 +9,7 @@ use cw721::{Cw721QueryMsg, Cw721ReceiveMsg, NumTokensResponse}; use cw_storage_plus::Bound; use cw_utils::{parse_reply_execute_data, parse_reply_instantiate_data, Duration}; use dao_hooks::nft_stake::{stake_nft_hook_msgs, unstake_nft_hook_msgs}; +use dao_interface::state::ModuleInstantiateCallback; use dao_interface::{nft::NftFactoryCallback, voting::IsActiveResponse}; use dao_voting::duration::validate_duration; use dao_voting::threshold::{ @@ -719,7 +720,7 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result Result::UpdateOwnership( + cw721_base::Action::AcceptOwnership {}, + ), + )?, + funds: vec![], + })], + })?; + + Ok(Response::new().set_data(callback)) } FACTORY_EXECUTE_REPLY_ID => { // Parse reply data