From 641f11924936c6d1594a40dd2d45a60501899c31 Mon Sep 17 00:00:00 2001 From: Luca Spinazzola Date: Wed, 8 Feb 2023 01:13:00 -0500 Subject: [PATCH] clear the data on init to make sure secret isn't returned It doesn't currently actually return the migration secret in the data but it technically should, and will after this issue is fixed: https://github.com/scrtlabs/SecretNetwork/issues/1323#issuecomment-1420852045 --- contracts/purchaseable-snip721-v1/src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/purchaseable-snip721-v1/src/contract.rs b/contracts/purchaseable-snip721-v1/src/contract.rs index 5ae036a..4519a0b 100644 --- a/contracts/purchaseable-snip721-v1/src/contract.rs +++ b/contracts/purchaseable-snip721-v1/src/contract.rs @@ -87,10 +87,10 @@ pub(crate) fn init_snip721( let snip721_response = snip721_reference_impl::contract::instantiate(deps, env, info.clone(), instantiate_msg) .unwrap(); - // clear the data (that contains the secret) which would be set when init_snip721 is called + // clear the data (that contains the secret) which would be set before init_snip721 is called // from reply as part of the migration process // https://github.com/CosmWasm/cosmwasm/blob/main/SEMANTICS.md#handling-the-reply - return Ok(snip721_response); + return Ok(snip721_response.set_data(b"")); }