Merge branch 'main' into alex_payup

This commit is contained in:
Array in a Matrix 2022-03-27 09:33:41 -04:00 committed by GitHub
commit 8a316add09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 3 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules

View file

@ -1,3 +1,2 @@
# DefiHackathon-2022
Demo video: https://youtu.be/kMNxAIWr4T8
Demo video: https://youtu.be/kMNxAIWr4T8

View file

@ -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",
]

View file

@ -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),
}
}

View file

@ -11,8 +11,19 @@ pub struct State {
pub TotalPayers: i32,
}
pub const STATE: Item<State> = 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
*/