This repository is the submission to the zkSync bounty of the daily spending limit tutorial.
TUTORIAL.md
is the tutorial documentation.
Deployed Account contract that has the daily spending limit feature: 0x6b6B8ea196a6F27EFE408288a4FEeBE9A9e12005 and owner pk:0x957aff65500eda28beb7130b7c1bc48f783556bb84fa6874d2204c1d66a0ddc7
As for deployment and simple test on zkSync2.0 testnet, please take a look at the tutorial doc, TUTORIAL.md.
spend-limit.test.ts
in the test folder offers more detailed tests for each functionality of the SpendLimit contract.
git clone git@github.com:porco-rosso-j/daily-spendlimit-tutorial.git
- Enter the repo and install dependencies.
cd daily-spendlimit-tutorial
yarn
-
To set up a local environment, Docker and docker-compose should be installed.
If they are not installed on your computer: Install. -
To run zkSync local chain, do:
git clone https://github.com/matter-labs/local-setup.git
cd local-setup
./start.sh
*check details and common errors for running local zksync chain here.
- Compile:
yarn hardhat compile
- Additional configuration: rename .env.example to
.env
and addNODE_ENV=test
.
Then run:
yarn hardhat test