Commit b7f65d4f authored by Hero Bird's avatar Hero Bird

[examples/erc20] Some minor code clean-up

parent 3497a1d7
......@@ -6,12 +6,10 @@ use pdsl_core::{
Key,
alloc::ForwardAlloc,
},
env::{Env, ContractEnv, srml::Address},
env::{Env, ContractEnv, srml::Address, srml::Balance},
};
use parity_codec::{Encode, Decode};
type Balance = u64;
/// Returns the zero address.
fn zero_address() -> Address {
Address::from([0x0_u8; 32].as_ref())
......@@ -30,8 +28,6 @@ pub struct Erc20Token {
allowances: storage::HashMap<(Address, Address), Balance>,
/// The total supply.
total_supply: storage::Value<Balance>,
/// The allocator for newly allocated entities.
alloc: storage::alloc::CellChunkAlloc,
}
impl Erc20Token {
......@@ -108,7 +104,6 @@ impl Erc20Token {
balances: storage::HashMap::new_using_alloc(alloc),
allowances: storage::HashMap::new_using_alloc(alloc),
total_supply: storage::Value::new_using_alloc(alloc, 0),
alloc: storage::alloc::CellChunkAlloc::new_using_alloc(alloc),
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment