We use Protostar for our testing and development purposes. Protostar is a StarkNet smart contract development toolchain, which helps you with dependencies management, compiling and testing cairo contracts.
- Copy and run in a terminal the following command to install protostar 0.4.2:
curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash -s -- -v 0.4.2
- Restart the terminal.
- Run
protostar -vto check Protostar and cairo-lang version.
Protostar requires version 2.28 or greater of Git.
protostar install
protostar build
protostar test
It is not possible to call @l1_handler using Cairo from protostar. To run tests locally, must change @l1_handler to @external in DefiPooling.cairo
- python3 scripts/deploy.js
- update defiPooling_address in scripts/config/testnet.py
- update L1 defiPooling address in scripts/setL1Contract.py
- python3 scripts/setL1Contract.py
- let user deposit usdc into contract.
- python3 scripts/depositAssetToL1.py
- lets users call withdraw function
- python3 scripts/sendWithdrawalRequestToL1.py