The current end-to-end tests cover the full lifecycle of the VFT program on Vara-Eth.
- ❌ Uploads the VFT code to Vara-Eth.
- ✅ Verifies that the final
codeIdis well-formed. - ✅ Creates a new VFT program from the uploaded
codeId. - ✅ Waits until the program appears on Vara-Eth.
- ✅ Approves wVARA for the VFT program on Ethereum.
- ✅ Tops up the program executable balance.
- ✅ Reads program state from Vara-Eth and checks that
executableBalance == TOP_UP_AMOUNT. - ✅ Parses the generated IDL (
extended_vft.idl). - ✅ Sends the init message and checks:
- transaction status is
success, - reply code is
0x00000000.
- transaction status is
- ✅ Reads the token
namevia a handle query and verifies it equals"Name". - ✅ Reads the token
symboland verifies it equals"Symbol". - ✅ Reads the token
decimalsand verifies it equals12.
- ✅ Sends a
Mintmessage through mirror:- checks that the transaction succeeds on Ethereum,
- checks reply code is
0x00010000, - decodes the result and verifies it is
true.
- ✅ Queries
BalanceOf(address)and verifies that the balance equals the minted amount. - ✅ Verifies that the program executable balance decreases after calls
by comparing
executableBalancebefore and after.
- ✅ Sends an injected
Transfer:- sends the injected transaction and checks that
send()returns"Accept", - waits for the promise from
sendAndWaitForPromise()to resolve.
- sends the injected transaction and checks that
- ✅ Queries
BalanceOf(recipient)and verifies that the balance equals the transferred amount.
- ✅ Sends an injected
Minttransaction:- sends the injected transaction and checks that
send()returns"Accept", - waits for the promise from
sendAndWaitForPromise()to resolve.
- sends the injected transaction and checks that
- ✅ Queries
BalanceOf(recipient)and verifies that the balance equals the minted amount.
-
Create your
.envfrom the exampleIn the project root, copy the example file:
cp .env.example .env
-
Set your private key
Open the new .env file and set your own Ethereum private key:
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
-
Check RPC endpoints and contract IDs
The defaults in .env.example are configured for:
-
ETHEREUM_RPC – public Hoodi Ethereum RPC.
-
VARA_ETH_RPC – public Vara-Eth validator node.
-
ROUTER_ADDRESS – router contract address on Ethereum.
-
CHECKER_CODE_ID, MANAGER_CODE_ID, TOKEN_ID – deployed code IDs on Vara-Eth.
If you redeploy contracts, update these IDs accordingly.
Note: the tests also upload the contract code.
If code upload does not succeed, the tests fall back to using theCHECKER_CODE_ID,MANAGER_CODE_IDandTOKEN_IDvalues from your.envfile. -
-
Account funding
Before running the scripts, make sure that the account corresponding to your PRIVATE_KEY has:
-
sufficient ETH on the Hoodi Ethereum endpoint.
-
sufficient wrapped VARA on Vara-Eth.
-
For detailed NVM setup instructions, see the NVM documentation.
Install Node.js LTS:
nvm install --lts
nvm use --ltsTo verify Node.js is properly installed:
node -v # Should show v20.x.x or later LTS version
npm -v # Should show npm versionFor detailed pnpm setup instructions, see the pnpm documentation.
Install pnpm globally:
npm install -g pnpmTo verify pnpm is installed:
pnpm -v # Should show version 10.x.x or laterInstall all project dependencies:
pnpm installThis command will install all packages listed in package.json and create the node_modules directory.
-
Build the smart contracts
From the repo root:
cargo build --release
-
Run the tests
pnpm test:ui