I have questions about: fungible Token example and NEP-21 itself.
- It's a possible situation when
escrow allowances > 0, butaccount balance = 0. Is it legal flow and why? - It never checks
account_idexists or not. Why? Is it secure? - Anyone can call:
inc_allowance/dec_allowance?
And for let owner_id = env::predecessor_account_id(); will be created new account, new escrow allowance automatically (if not exist). Is that logic correct and why?
get_accountalways created a new account. It looks redundant.
For example:
fn get_account(&self, owner_id: &AccountId) -> Account {
assert!(env::is_valid_account_id(owner_id.as_bytes()), "Owner's account ID is invalid");
let account_hash = env::sha256(owner_id.as_bytes());
self.accounts.get(&account_hash).unwrap_or_else(|| Account::new(account_hash))
}
Will create "always" new account for new owner_id. And it's possible then that account will never be used. So is it really practical to silently "create" an account with get_account?
transfer_fromis never checkowner_idas the real owner of the account. Is there logic to protect transferring only by real owners?- Why fungible token doesn't have a name/title?
- Do the NEAR Protocol have some standard or logic for Fungible Tokens exchange?