diff --git a/contracts/okp4-cognitarium/src/contract.rs b/contracts/okp4-cognitarium/src/contract.rs index a4c03f70..858b42d8 100644 --- a/contracts/okp4-cognitarium/src/contract.rs +++ b/contracts/okp4-cognitarium/src/contract.rs @@ -5,6 +5,7 @@ use cw2::set_contract_version; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use crate::state::{Store, STORE}; // version info for migration info const CONTRACT_NAME: &str = "crates.io:storage"; @@ -14,11 +15,20 @@ const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn instantiate( deps: DepsMut, _env: Env, - _info: MessageInfo, - _msg: InstantiateMsg, + info: MessageInfo, + msg: InstantiateMsg, ) -> Result { set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; - Err(ContractError::NotImplemented) + + STORE.save( + deps.storage, + &Store { + owner: info.sender, + limits: msg.limits.into(), + }, + )?; + + Ok(Response::default()) } #[cfg_attr(not(feature = "library"), entry_point)] diff --git a/contracts/okp4-cognitarium/src/state.rs b/contracts/okp4-cognitarium/src/state.rs index 528f24c6..003c31e6 100644 --- a/contracts/okp4-cognitarium/src/state.rs +++ b/contracts/okp4-cognitarium/src/state.rs @@ -1,5 +1,5 @@ use crate::msg; -use cosmwasm_std::Uint128; +use cosmwasm_std::{Addr, Uint128}; use cw_storage_plus::Item; use serde::{Deserialize, Serialize}; @@ -7,7 +7,7 @@ pub const STORE: Item = Item::new("store"); #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub struct Store { - pub owner: String, + pub owner: Addr, pub limits: StoreLimits, }