Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyc 49 wl #5

Merged
merged 5 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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