█████╗ ████████╗██╗ ██╗███████╗███╗ ██╗ █████╗ ██╗███╗ ██╗███████╗
██╔══██╗╚══██╔══╝██║ ██║██╔════╝████╗ ██║██╔══██╗ ██║████╗ ██║██╔════╝
███████║ ██║ ███████║█████╗ ██╔██╗ ██║███████║ ██║██╔██╗ ██║███████╗
██╔══██║ ██║ ██╔══██║██╔══╝ ██║╚██╗██║██╔══██║ ██║██║╚██╗██║╚════██║
██║ ██║ ██║ ██║ ██║███████╗██║ ╚████║██║ ██║ ██║██║ ╚████║███████║██╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝
This repository contains the Athena protocol smart-contracts. Athena is DeFi cover AMM where users can provide liquidity to earn premiums from users who want to protect their DeFi assets. The current repository uses Solidity and Hardhat.
Install all dependencies :
npm iGet your .env from .env.example
cp .env.example .envand set your RPC provider keys.
Respect conventional commits rules with scope : https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-scope
Create a new branch when going to break features, and make a pull request.
Launch tests :
You can change the chain against which tests are performed by changing the HARDHAT_FORK_TARGET in your .env file. Only enter chain names available in the chain targets.
npm run testLaunch only a specific test :
npx hardhat test tests/testFile.test.tsBefore deploying make sure to have > 90% coverage
npx hardhat coverageTo generate a security report with Slither:
npm run audit:slitherNote: Before running this command, temporarily remove the src/dependencies directory due to compatibility issues with older Solidity versions used by Kleros:
mv src/dependencies src/dependencies_temp # Before analysis
npm run audit:slither
mv src/dependencies_temp src/dependencies # After analysisBefore deploying the protocol you must set your configuration for the protocol in the scripts/verificationData/deployParams.ts file.
To deploy on Ethereum mainnet
npm run deploy:mainnetTo deploy on Arbitrum One
npm run deploy:arbitrumTo deploy on Sepolia mainnet
npm run deploy:sepoliaBefore verifying contracts you must:
-
Specify the API key for the chain explorer in the appropriate
CHAIN_VERIFY_API_KEYin the.envfile -
Set the deployment addresses in the
scripts/verificationData/addresses.tsfile
To verify on https://etherscan.io/
npm run verify:mainnetTo verify on https://arbiscan.io
npm run verify:arbitrumTo verify on https://sepolia.etherscan.io
npm run verify:sepoliaFor faster runs of your tests and scripts, consider setting parallel to true in the hardhat.config.ts file. Be aware than parallel testing can have undesired sequentiality effects on logs.