Node v16 or below. Hardhat doesn't work with Node v17 currently: hardhat#1988.
Install:
npm install
Compile contracts:
npm run build
Run unit tests:
npm test
Start hardhat network:
npm run node
- Format contracts (prettier):
npm run format
- Lint contracts (solhint):
npm run lint
- Run unit tests with gas reporter:
npm run test:gas
- Run unit tests with coverage (solidity-coverage):
npm run test:coverage
- Run static analyzer (slither, requires external installation):
npm run analyze
- Format tests and scripts (prettier):
npm run format:ts
- Lint tests and scripts (eslint):
npm run lint:ts
contracts/
- Smart Contractsinterfaces/
- InterfacesINoteAdapter.sol
- NoteAdapter interfaceILoanPriceOracle.sol
- LoanPriceOracle interfaceILoanReceiver.sol
- LoanReceiver interfaceIVault.sol
- Vault interfaceIVaultRegistry.sol
- VaultRegistry interface
LoanPriceOracle.sol
- LoanPriceOracle implementationLPToken.sol
- LPToken implementationVault.sol
- Vault implementationVaultRegistry.sol
- VaultRegistry implementationintegrations/
- Thirdparty integration contractstest/
- Testing contractslending/
- Test lending platformTestNoteToken.sol
- Note token for TestLendingPlatformTestLendingPlatform.sol
- TestLendingPlatform implementationTestNoteAdapter.sol
- Note adapter for TestLendingPlatform
TestERC20.sol
- Test ERC20 tokenTestERC721.sol
- Test ERC721 tokenMockLoanPriceOracle.sol
- Mock LoanPriceOracleTestLPTokenUpgrade.sol
- Test LPToken upgradeTestVaultUpgrade.sol
- Test Vault upgrade
test/
- Unit testsTestLendingPlatform.spec.ts
- TestLendingPlatform unit testsLoanPriceOracle.spec.ts
- LoanPriceOracle unit testsLPToken.spec.ts
- LPToken unit testsVault.spec.ts
- Vault unit testsVault.accounting.spec.ts
- Vault accounting unit testsVault.keeper.spec.ts
- Vault keeper integration unit testsIntegration.spec.ts
- Integration testhelpers/
- Test helpersEventUtilities.ts
- Event helper functionsFixedPointHelpers.ts
- Fixed point math helper functionsRandomHelpers.ts
- Random number helper functionsLoanPriceOracleHelpers.ts
- Loan price oracle helper functionsVaultHelpers.ts
- Vault helper functions
scripts/
- Scriptsdeploy-simulation.ts
- Simulation deploymentdeployment-manager.ts
- Deployment manager
deployments/
- Deploymentsdocs/
- DocumentationSECURITY.md
- Security notes
hardhat.config.ts
- Hardhat configurationtsconfig.json
- TypeScript configurationpackage.json
- npm package metadatapackage-lock.json
- npm package lockREADME.md
- This README
MetaStreet v1 Contracts are primary BUSL-1.1 licensed. Interfaces are MIT licensed.