This repo uses Yarn workspaces to manage multiple packages in the same repo. To prepare the repository for use, run:
yarn install
This will install all dependencies, wire dependencies between packages in this repo, and allow for you to build projects.
Periodically we need to upgrade contacts:
yarn upgrade-contracts
yarn dedupe
and browserlists:
yarn upgrade-browsers
yarn dedupe
- Install
foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
Have INFURA_KEY
env variable set
-
Run Foundry Anvil fork
yarn anvil:base
-
Update all prices
yarn update-prices:base
-
Run Liquidity app locally
yarn start
-
Open Cypress for Base
yarn e2e:base
Example for Arbitrum Mainnet
All RPC calls in this mode will be made to 127.0.0.1:8585
and all transactions will be automatically signed, without any popups
-
Run Foundry Anvil fork
yarn anvil:arbitrum
-
Update all prices (optionally, to speed up UI as it will not need to attach price updates to each call)
yarn update-prices:arbitrum
-
Run Liquidity app locally
yarn start
-
Open app in browser
open http://localhost:3000
-
Open devtools and set
localStorage
valueslocalStorage.DEBUG = 'true'; localStorage.MAGIC_WALLET = '0xWalletAddress';
-
Reload page and proceed with connecting your wallet through UI choosing "Metamask" in popup (the only option)
-
If wallet needs some ETH balance you can use foundry's
cast
to set balancecast rpc anvil_setBalance 0xWalletAddress 10000000000000000000 # check your balance cast balance 0xWalletAddress -e
-
Periodically (once an hour or less) sync fork time and update prices.
yarn update-prices:arbitrum yarn sync-time
Because price updates are coming from offchain server we need to bring fork's internal time to realtime, otherwise we will will have empty
priceUpdateTx
but then consistently getOracleDataRequiredError
for ALL price feeds