Skip to content

Commit

Permalink
Merge pull request #5 from hideyour-cash/HYC-49-wl
Browse files Browse the repository at this point in the history
Hyc 49 wl
  • Loading branch information
veigajoao committed Sep 13, 2022
2 parents c424c5b + 7b28d74 commit 37da9d4
Show file tree
Hide file tree
Showing 9 changed files with 480 additions and 41 deletions.
23 changes: 3 additions & 20 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
<img src="https://avatars.githubusercontent.com/u/104990779?s=200&v=4">
# Requirements

# NEAR Hackachain Monorepo
# Setup

This is how a real application structure should look like for near projects using react and rust smart contracts

## Contents

Here inside this project we have configured

- Github Actions
- Commitlint
- ESLint
- EditorConfig
- Prettier
- Typescript
- React Vite Web App + Tailwind + Zustand + Near
- Smart Contract Written in Rust + Rust Tests + Lib Contract Integration Tests

## Contributing

To Contribute fork this repo and send us a pull request following the patterns!
# Deployment
148 changes: 148 additions & 0 deletions packages/contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/contracts/contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ near-sdk = "4.0.0"
near-bigint = {path = "../../contract-libraries/near_bigint"}
mimc = {path = "../../contract-libraries/mimc"}
rust_verifier = {path = "../../contract-libraries/groth_verifier/rust_verifier"}

[dev-dependencies]
rstest = "0.14.0"
Empty file.
35 changes: 35 additions & 0 deletions packages/contracts/contract/src/events.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use near_bigint::U256;
use near_sdk::json_types::{Base58CryptoHash, U128, U64};
use near_sdk::serde_json::json;
use near_sdk::{log, AccountId};

const STANDARD_NAME: &str = "hyde_your_cash";
const STANDARD_VERSION: &str = "1.0.0";

fn log_basic_event_format(standard: &str, version: &str, event_type: &str, data_vec: Vec<&str>) {
log!(
"EVENT_JSON:{}",
&json!({
"standard": standard,
"version": version,
"event": event_type,
"data": data_vec
})
.to_string()
)
}
/// New account was added to whitelist
pub fn event_new_white_list(index: U64, value: U256) {
let event_type = "new_white_list";
let event_data = &json!({
"index": index,
"value": value,
})
.to_string();
log_basic_event_format(
STANDARD_NAME,
STANDARD_VERSION,
event_type,
vec![event_data],
);
}
Loading

0 comments on commit 37da9d4

Please sign in to comment.