near-non-transferrable-token
Popula Library for Non-transferrable Token.
## Example
```rust
use near_non_transferrable_token::{impl_fungible_token_core, impl_fungible_token_storage};
#[near_bindgen]
impl Contract {
#[init]
pub fn new(
owner_id: AccountId,
metadata: FungibleTokenMetadata,
) -> Self {
assert!(!env::state_exists(), "Already initialized");
metadata.assert_valid();
let mut this = Self {
token: FungibleToken::new(b"a".to_vec()),
metadata: LazyOption::new(b"m".to_vec(), Some(&metadata)),
owner_id,
white_list: HashSet::new()
};
this
}
}
impl_fungible_token_core!(Contract, token);
impl_fungible_token_storage!(Contract, token);
#[near_bindgen]
impl FungibleTokenMetadataProvider for Contract {
fn ft_metadata(&self) -> FungibleTokenMetadata {
self.metadata.get().unwrap()
}
}
```
See https://github.com/beepopula/Drip-contract for more details.
## Features
### Account Book
Separate Balances for different contracts:
```rust
#[derive(BorshDeserialize, BorshSerialize)]
pub struct Account {
pub contract_ids: UnorderedMap