$CONTRACT_ID
- the account ID of the new token fNEAR$OWNER_ID
- the account ID of the controller/owner.wrap.testnet
- the token ID that is being wrapped/locked. wNEAR is used for the example.$ACCOUNT_ID
- the account ID of a test account.
near call $CONTRACT_ID --accountId=$OWNER_ID new '{
"locked_token_account_id": "wrap.testnet",
"meta": {"spec": "ft-1.0.0", "name": "Future NEAR", "symbol": "fNEAR", "decimals": 24},
"owner_id": "'$OWNER_ID'"
}'
near call wrap.testnet --accountId=$OWNER_ID storage_deposit '' --amount=0.00125
near call wrap.testnet --accountId=$OWNER_ID near_deposit --amount=20
near call wrap.testnet --accountId=$OWNER_ID storage_deposit '{"account_id": "'$CONTRACT_ID'"}' --amount=0.00125
near call wrap.testnet --accountId=$OWNER_ID --depositYocto=1 --gas=100000000000000 ft_transfer_call '{
"receiver_id": "'$CONTRACT_ID'",
"amount": "10000000000000000000000000",
"msg": ""
}'
near view $CONTRACT_ID get_info
near view $CONTRACT_ID ft_metadata
near view $CONTRACT_ID ft_total_supply
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$OWNER_ID'"}'
near call $CONTRACT_ID --accountId=$ACCOUNT_ID storage_deposit '' --amount=0.00125
near call $CONTRACT_ID --accountId=$OWNER_ID --depositYocto=1 ft_transfer '{
"receiver_id": "'$ACCOUNT_ID'",
"amount": "1000000000000000000000000"
}'
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$OWNER_ID'"}'
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$ACCOUNT_ID'"}'
near call $CONTRACT_ID --accountId=$ACCOUNT_ID --depositYocto=1 ft_transfer '{
"receiver_id": "'$OWNER_ID'",
"amount": "1000000000000000000000000"
}'
Expected error:
'Not whitelisted for transfers'
near call $CONTRACT_ID --accountId=$ACCOUNT_ID --depositYocto=1 --gas=100000000000000 unwrap ''
Expected error:
'The token is still locked'
near call $CONTRACT_ID --accountId=$OWNER_ID --depositYocto=1 add_transfer_whitelist '{
"account_id": "'$ACCOUNT_ID'"
}'
near call $CONTRACT_ID --accountId=$ACCOUNT_ID --depositYocto=1 ft_transfer '{
"receiver_id": "'$OWNER_ID'",
"amount": "100000000000000000000000"
}'
near call $CONTRACT_ID --accountId=$OWNER_ID --depositYocto=1 unlock ''
near call $CONTRACT_ID --accountId=$ACCOUNT_ID --depositYocto=1 --gas=100000000000000 unwrap ''
Expected error:
'The account is not registered'
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$OWNER_ID'"}'
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$ACCOUNT_ID'"}'
near call wrap.testnet --accountId=$ACCOUNT_ID storage_deposit '' --amount=0.00125
near call $CONTRACT_ID --accountId=$ACCOUNT_ID --depositYocto=1 --gas=100000000000000 unwrap ''
near view $CONTRACT_ID ft_balance_of '{"account_id": "'$ACCOUNT_ID'"}'
near view wrap.testnet ft_balance_of '{"account_id": "'$ACCOUNT_ID'"}'