This repository contains all contracts Overnight
- Node v16
- yarn v1.22.18
- Install node
- Install yarn
- Run
yarn install --frozen-lockfile
- Create .env file from copy .env.example
- Define ETHNODE_URI{CHAIN} - public RPC
- Define HARDHATBLOCK_NUMBER{CHAIN} - blockNumber for startup hardhat node
- Define ETH_NETWORK - chain ID [OPTIMISM, ARBITRUM and etc.]
- Define STAND - stand id [polygon, bsc, bsc_usdt, optimism_dai and etc.]
- Define PK - private key [can be any test key]
- Define PK - if you need to deploy contracts to real chain
- Define ETHERSCANAPI${CHAIN} - for verify contracts
enum CHAIN:
- POLYGON
- OPTIMISM
- BSC
- BASE
- ARBITRUM
- ZKSYNC
- LINEA
This repository contains is next modules:
- common - it contains common scripts for deploying, build, testing contracts
- connectors - interfaces/libraries for integration with other protocols
- core - core contracts: UsdPlusToken/Exchange and etc.
- governance-new - new governance contracts
- leverage - RND contract with leverage strategies [DEPRECATED]
- lockup - contracts for lock OVN tokens
- market - ZapIns and WrappedUsdPlus contracts
- pools - deploy scripts and other date about USD+ pools on Balancer and etc.
- pre-sale - contracts of pre-sale OVN
- proposals - governance proposals
- recovery - information about recovery data after hachs
- strategies - contains sub modules with strategies for each chain
- swapper - RND on-chain swapper (1inch)
- sy - integrate USD+ in Pendle
- Set in .env file your parameters and check actual gas price in gas station.
- Deploy core and setting in pkg/core npx hardhat deploy --tags base,setting --network bsc_usdt
- Run base setting in pkg/core npx hardhat run scripts/base-setting.js --network bsc_usdt
- Verify core in pkg/core and verify it on scan service. npx hardhat run scripts/verify.js --network bsc_usdt
- Deploy market and setting in pkg/market npx hardhat deploy --tags base,setting --network bsc_usdt
- Verify market in pkg/market and verify it on scan service. npx hardhat run scripts/verify.js --network bsc_usdt
- Deploy cash strategy and setting in pkg/strategies/bsc npx hardhat deploy --tags StrategyVenusUsdt --setting --network bsc_usdt
- Verify cash strategy in pkg/strategies/bsc and verify it on scan service. npx hardhat run scripts/verify.js --network bsc_usdt
- Set PM by cash strategy in pkg/core npx hardhat run scripts/set-strategies-bsc-usdt.js --network bsc_usdt
- Deploy new governance if new chain. Copy governance files if same chain
- Move rules of core contracts to governance in pkg/governance npx hardhat run scripts/move_core_to_gov.js --network bsc_usdt
- Add cash strategy in core.strategies and core contracts in dict.contracts.
- Set percentage in core.collateral after adding liquidity in cash strategy.
- Set in .env file your parameters and check actual gas price in gas station
- Deploy strategy in pkg/strategies/networkName npx hardhat deploy --tags StrategyName --setting --network networkName
- Verify strategy in pkg/strategies/networkName and verify it on scan service npx hardhat run scripts/verify.js --network networkName
- Add new record in core.strategies, core.collateral and dict.tokens (if it needs)
- Add strategy in PM through proposal in pkg/proposals npx hardhat run scripts/proposalName.js --network networkName
- Move rules of strategy to governance in pkg/governance npx hardhat run scripts/move_strategies_to_gov.js --network networkName