This repo contains the same ballot contract as this repo but this time the contract controls the vote using a token allowance. The token contract is located in the BallotToken folder.
Before testing the contracts, you have to install soroban. You can follow their step-by-step guide.
Go to the BallotToken folder and execute the following commands:
cargo test
This will compile the code and then execute the tests. After ensuring all tests pass, you can generate the token wasm file:
soroban contract build
The Ballot contract needs the token wasm file to run so, as we have generated it, we can now test the ballot contract. Go to the Ballot folder and execute the tests as we did before:
cargo test
Check this link to get more info about this repo: https://dev.to/icolomina/using-tokenization-to-control-a-soroban-voting-smart-contract-3lm6