Perpetual Protocol Lugia contract artifacts (ABIs) and deployed addresses
npm install @perp/lugia-deploymentsWe use Foundry to manage contract dependencies (actually, Foundry is using .gitmodules). However, we still add contract dependencies to package.json to get vulnerability alerts using Dependabot.
Therefore, please make sure you update both .gitmodules and package.json when changing contract dependencies.
Make sure you have .env file at project root with the following variables:
``shell`
OPTIMISM_WEB3_ENDPOINT_ARCHIVE // Optimism archive endpoint
For unit tests, basically we follow the best practices of Foundry.
If you want to test a case that expecting a revert, add _reverts suffix to the function name, example:
`solidity`
function test_deposit_reverts() public {
// ...
}
, please reference the doc.Commands
To install all dependencies:
`shell
npm ci
forge install
`
To compile contracts:
`shell
npm run build
or
forge build
`
To run all tests:
`shell
npm run test
or
forge test
``