Install:
npm install
Compile contracts:
npm run build
Run unit tests:
npm test
Start hardhat network:
npm run node
- Format contracts, tests, and scripts (prettier):
npm run format
- Lint contracts, tests, and scripts (solhint + eslint):
npm run lint
- Run static analyzer (slither, requires external installation):
npm run analyze
contracts/
- Smart ContractsPool.sol
- Pool base contractPoolFactory.sol
- Pool FactoryTick.sol
- Tick libraryLoanReceipt.sol
- Loan Receipt libraryDepositLogic.sol
- Deposit logic libraryBorrowLogic.sol
- Borrow logic libraryLiquidityLogic.sol
- Liquidity logic libraryinterfaces/
- InterfacesIPool.sol
- Pool interfaceILiquidity.sol
- Liquidity interfaceICollateralWrapper.sol
- Collateral Wrapper interfaceICollateralLiquidator.sol
- Collateral Liquidator interfaceICollateralLiquidationReceiver.sol
- Collateral Liquidation Receiver interfaceIPoolFactory.sol
- Pool Factory interface
configurations/
- Pool ConfigurationsWeightedRateCollectionPool.sol
- Weighted Rate Collection PoolWeightedRateRangedCollectionPool.sol
- Weighted Rate Ranged Collection PoolWeightedRateSetCollectionPool.sol
- Weighted Rate Set Collection PoolWeightedRateMerkleCollectionPool.sol
- Weighted Rate Merkle Collection PoolNoopPool.sol
- Noop Pool
wrappers/
- Collateral WrappersBundleCollateralWrapper.sol
- Bundle Collateral WrapperERC1155CollateralWrapper.sol
- ERC155 Collateral WrapperPunkCollateralWrapper.sol
- CryptoPunks Collateral WrapperKongzBundleCollateralWrapper.sol
- CyberKongz Bundle Collateral Wrapper
filters/
- Collateral FiltersCollateralFilter.sol
- Collateral Filter abstract base contractCollectionCollateralFilter.sol
- Collection Collateral FilterRangedCollectionCollateralFilter.sol
- Ranged Collection Collateral FilterSetCollectionCollateralFilter.sol
- Set Collection Collateral FilterMerkleCollectionCollateralFilter.sol
- Merkle Collection Collateral Filter
rates/
- Interest Rate ModelsInterestRateModel.sol
- Interest Rate Model abstract base contractWeightedInterestRateModel.sol
- Weighted Interest Rate Model
tokenization/
- TokenizationDepositToken.sol
- Deposit Token abstract base contractERC20DepositToken.sol
- ERC20 Deposit Token contractERC20DepositTokenImplementation.sol
- ERC20 Deposit Token implementation contractERC20DepositTokenProxy.sol
- ERC20 Deposit Token proxy contractERC20DepositTokenFactory.sol
- ERC20 Deposit Token factory library contract
oracle/
- Price Oracle SupportPriceOracle.sol
- Price Oracle abstract base contractExternalPriceOracle.sol
- External Price Oracle contractSimpleSignedPriceOracle.sol
- (External) Simple Signed Price Oracle implementation contractReservoirPriceOracle.sol
- (External) Reservoir Price Oracle implementation contractChainlinkPriceOracle.sol
- (External) Chainlink Price Oracle implementation contract
liquidators/
- Collateral LiquidatorsEnglishAuctionCollateralLiquidator.sol
- English Auction Collateral Liquidator
integrations/
- Third-party Integrationstest/
- Testing Contractsintegrations/
- Third-Party Integrationsrates/
- Test Wrappers for Interest Rate Modelsfilters/
- Test Wrappers for Collateral Filterstokens/
- Test TokensTestERC20.sol
- Test ERC20TestERC721.sol
- Test ERC721TestERC1155.sol
- Test ERC71155TestMaliciousERC20.sol
- Test Malicious ERC20
TestTick.sol
- Test Wrapper for Tick libraryTestLoanReceipt.sol
- Test Wrapper for Loan Receipt libraryTestLiquidityLogic.sol
- Test Wrapper for Liquidity logic libraryTestCollateralLiquidatorJig.sol
- Test Jig for Collateral LiquidatorsTestCollateralLiquidatorJigTruncated.sol
- Truncated Test Jig for Collateral LiquidatorsTestProxy.sol
- Test ProxyExternalCollateralLiquidator.sol
- External Collateral Liquidator
test/
- Unit testsrates/
- Interest Rate Model testsWeightedInterestRateModel.spec.ts
- Weighted Interest Rate Model unit test
filters/
- Collateral Filter testsCollectionCollateralFilter.spec.ts
- Collection Collateral Filter unit testRangedCollectionCollateralFilter.spec.ts
- Ranged Collection Collateral Filter unit testSetCollectionCollateralFilter.spec.ts
- Set Collection Collateral Filter unit testMerkleCollectionCollateralFilter.spec.ts
- Merkle Collection Collateral Filter unit test
wrappers/
- Collateral Wrapper testsBundleCollateralWrapper.spec.ts
- Bundle Collateral Wrapper unit testERC1155CollateralWrapper.spec.ts
- ERC1155 Collateral Wrapper unit test
liquidators/
- Collateral Liquidators testsExternalCollateralLiquidator.spec.ts
- External Collateral Liquidator unit testEnglishAuctionCollateralLiquidator.spec.ts
- English Auction Collateral Liquidator unit test
models/
- Integration test modelsPoolModel.ts
- Pool model
helpers/
- Test helpersDeploy.ts
- Deploy with libraries helperEventUtilities.ts
- Event utilitiesFixedPoint.ts
- Fixed Point math utility classTick.ts
- Tick utility classMerkleTree.ts
- Merkle tree utility class
Tick.spec.ts
- Tick unit testLoanReceipt.spec.ts
- Loan Receipt unit testLiquidityLogic.spec.ts
- Liquidity logic unit testPoolFactory.spec.ts
- Pool Factory unit testPool.basic.spec.ts
- Pool basic unit testPool.bundle.spec.ts
- Pool bundle unit testPool.gas.spec.ts
- Pool gas unit testIntegration.spec.ts
- Integration testStorage.spec.ts
- Storage layout test
scripts/
- Scriptsdeploy-simulation.ts
- Simulation deploymentdeployment-manager.ts
- Deployment manager
deployments/
- Deploymentsdocs/
- Documentationhardhat.config.ts
- Hardhat configurationtsconfig.json
- TypeScript configurationpackage.json
- npm package metadatapackage-lock.json
- npm package lockREADME.md
- This README
MetaStreet v2 Contracts are primarily BUSL-1.1 licensed. Interfaces are MIT licensed.