Closed
Description
As we can see in
Lines 12 to 25 in d340f7e
#[derive(Storage)]
pub struct MyERC20 {
// #[zink::storage(String32)]
// struct Name(String32);
pub name: String32,
// #[zink::storage(String32)]
// struct Symbol(String32);
pub symbol: String32,
// ...
pub total_supply: U256,
pub balances: Mapping<Address, U256>,
pub allowances: DoubleKeyMapping<Address, Address, U256>,
}
#[zink::contract]
impl MyERC20 {
/// this method will be compiled as an external call because we have `pub` here
///
/// `self` here will be the entrance of the storage
pub fn set_and_get(&self, new_name: String32) -> String32 {
self.name.set(new_name);
self.name.get()
}
}
related to #260
Metadata
Metadata
Type
Projects
Status
Done