diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md index 0700063..f8d7cf8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # DefiHackathon-2022 - -Demo video: https://youtu.be/kMNxAIWr4T8 +Demo video: https://youtu.be/kMNxAIWr4T8 \ No newline at end of file diff --git a/contracts/counter/Cargo.lock b/contracts/counter/Cargo.lock index 6d5f2dc..6294467 100644 --- a/contracts/counter/Cargo.lock +++ b/contracts/counter/Cargo.lock @@ -164,8 +164,10 @@ name = "cw-storage-plus" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e867b9972b83b32e00e878dfbff48299ba26618dabeb19b9c56fae176dc225" + dependencies = [ "cosmwasm-std", + "cw-storage-plus", "schemars", "serde", ] diff --git a/contracts/counter/src/contract.rs b/contracts/counter/src/contract.rs index e6906f4..53d26c0 100644 --- a/contracts/counter/src/contract.rs +++ b/contracts/counter/src/contract.rs @@ -7,6 +7,7 @@ use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, totalPayersResponse, QueryMsg, self}; use crate::state::{State, STATE, BALANCES}; + // version info for migration info const CONTRACT_NAME: &str = "crates.io:counter"; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -43,6 +44,7 @@ pub fn execute( match msg { ExecuteMsg::Payup {} => try_payup(deps, info), ExecuteMsg::Createaccounts {} => create_accounts(deps, info), + } } diff --git a/contracts/counter/src/state.rs b/contracts/counter/src/state.rs index f2ee5f6..9a8447f 100644 --- a/contracts/counter/src/state.rs +++ b/contracts/counter/src/state.rs @@ -11,8 +11,19 @@ pub struct State { pub TotalPayers: i32, } - pub const STATE: Item = Item::new("state"); pub const BALANCES: Map<&Addr, bool> = Map::new("balance"); +/* +add states: + +1 - the bill(s) / item +2 - the customers /map +3 - Need to figure out a way to store money that we've taken from users. Third state is item again? + +1 - how to use map and item to store customers or any state +2 - how to display bill to user + +Hello +*/ \ No newline at end of file