You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the storage interfaces are currently distributed into different structs, instead, we want an interface like below to improve the developer experience
#[derive(Storage)]pubstructMyERC20{// #[zink::storage(String32)]// struct Name(String32);pubname:String32,// #[zink::storage(String32)]// struct Symbol(String32);pubsymbol:String32,// ...pubtotal_supply:U256,pubbalances:Mapping<Address,U256>,puballowances:DoubleKeyMapping<Address,Address,U256>,}#[zink::contract]implMyERC20{/// this method will be compiled as an external call because we have `pub` here/// /// `self` here will be the entrance of the storagepubfnset_and_get(&self,new_name:String32) -> String32{self.name.set(new_name);self.name.get()}}
As we can see in
zink/examples/erc20.rs
Lines 12 to 25 in d340f7e
related to #260
The text was updated successfully, but these errors were encountered: