Core library for DeFi.
| Name | Purpose |
|---|---|
| accumulator | tracks cumulative changes to a value |
| attribute | abstract contracts with foundational patterns |
| number | fixed decimal types and math functions |
| synbook | synthetic orderbook |
| token | helpers for working with fungible tokens |
| utilization | calculates rates based on a utilization curve |
| verifier | helps create and verify EIP712 signed messages |
forge install equilibria/root@v3This debugging library is designed to be a replacement for hardhat or forge's console library, adding support for logging signed integers and fixed number types in format strings. However, it only supports the following types:
- uint256
- int256
- UFixed6
- UFixed18
- Fixed6
- Fixed18
- address
- bool
It supports 1, 2, or 3 of the above values in a format string.
To use, import the library...
import { console } from "@equilibria/root/utils/console.sol";
...and then call console.log with your format string:
console.log("Processing local order for %s with maker %s at %s",
context.account, // address
newOrder.maker(), // Fixed6 (without unwrap)
newOrder.timestamp // uint256
);
This package uses Foundry, a smart contract development toolchain.
To install Foundry:
curl -L https://foundry.paradigm.xyz | bash
# (follow instructions to source environment or start a new shell)
foundryupOther installation options available here.
Before running any command, make sure to install dependencies:
forge installOptionally, to install Slither static analyzer:
python3 -m pip install slither-analyzerOther installation options available here.
Optionally, to install solhint:
sudo npm install -g solhint@~5.0forge buildforge testor for coverage report
make coverageTo autogenerate Markdown documentation based on natspec comments:
forge docTo run local server for browsing; add --serve option. Details here.