A minimal fungible token implementation following the NEP-141 standard.
zig build wasmnear deploy --accountId token.testnet --wasmFile zig-out/lib/contract.wasmnew()- Initialize the token contractft_transfer()- Transfer tokens to a receiverft_balance_of()- Get the balance of an account (view method)ft_total_supply()- Get the total token supply (view method)ft_metadata()- Get token metadata (NEP-148) (view method)
# Initialize
near call token.testnet new '{"owner_id": "owner.testnet", "total_supply": "1000000000000000000000000"}' --accountId token.testnet
# Transfer tokens
near call token.testnet ft_transfer '{"receiver_id": "bob.testnet", "amount": "1000000000000000000"}' --accountId alice.testnet --depositYocto 1
# Check balance
near view token.testnet ft_balance_of '{"account_id": "alice.testnet"}'
# Get total supply
near view token.testnet ft_total_supply '{}'
# Get metadata
near view token.testnet ft_metadata '{}'