Skip to content

Commit

Permalink
chore(zink): introduce interface for contract storage
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop committed Dec 29, 2024
1 parent 453604b commit 20d40a9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zink/codegen/src/contract.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//! derive macro for contract storage
use proc_macro::TokenStream;
use syn::ItemStruct;

/// Parse the input struct and generate the contract storage
pub fn parse(input: ItemStruct) -> TokenStream {
todo!()
}
8 changes: 8 additions & 0 deletions zink/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use proc_macro2::Span;
use quote::ToTokens;
use syn::{parse_macro_input, Attribute, DeriveInput, Expr, ItemFn, ItemStruct, LitStr};

mod contract;
mod event;
mod revert;
mod selector;
Expand All @@ -33,6 +34,13 @@ pub fn assert(input: TokenStream) -> TokenStream {
revert::parse_assert(input)
}

/// Declare contract storage
#[proc_macro_derive(Contract)]
pub fn contract(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as ItemStruct);
contract::parse(input)
}

/// Event logging interface
///
/// ```ignore
Expand Down

0 comments on commit 20d40a9

Please sign in to comment.