This is a suite of test cases for Tezos smart contracts in order to check the correct implementation of the FA1.2 interface standard according to TZIP-07 (Commit: af597cdabd8d749c2ff008a2cd1aacd06bfbe026).
This suite can be used by smart contract developers or security assessors to check correct working of their developed or assessed FA1.2 smart contract.
The defined test cases are checking the correct working of the following FA1.2 entrypoints:
- transfer
- approve
- getAllowance
- getBalance
- getTotalSupply
- add/change test cases to support more complex scenarios
- clean up code
- automatic setup of accounts and tez funding
- DApp / front end
- NVM install
- Install nodejs:
nvm install node
- Install npm packages:
npm i
Four Tezos accounts are required. These acccounts have to be configured in the file ./scripts/accounts.ts. A default account file can be found here ./scripts/default_accounts.js.
The names of the accounts (admin, alice, bob, and charlie) in the default account should not be changed. Just insert the public key hash (PKH), public key (PK), and secret key (SK) into the template.
Ensure the accounts have sufficient tez to pay for the transaction they emit.
You have to create an env.js in the root directory of the repo. An example/template file can be found here: example_env.js.
All required tokens have to be given (minted / transferred) to the admin account.
npm test
The contract used to run tests, ManagedLedger.tz, is taken as an example to run the tests. It is included in the TZIP-07 proposal. Feel free to substitute it with any other contract to check its compatibility with the FA1.2 standard.
Everyone is invited to contribute to the FA1.2 smart contract testing suite. We are eager to see new ideas, read new test cases and foster the development of the suite by everyone in the Tezos ecosystem.
This FA1.2 smart contract testing suite is currently "work in progress". The FA1.2 smart contract testing suite does not claim to be complete at any time as it is continuously developed.
This github repository is currently maintained by Inference.