This repository contains all contracts for Salvor.
- SalvorGovernanceToken
- VeART
- NFTCollectible (template ERC721 contract)
- SalvorLending
- SalvorExchange
- AssetManager
- SalvorLendingERC20
For technical and functional requirements and more detailed information about the VeArt, AssetManager, SalvorExchange, SalvorLendingERC20 and SalvorLending contracts, please refer to the documentation for the contracts, which can be accessed via the link provided below.
- Node v14.18.0
- Npm v8.1.3
- Make a copy of
.env.example
and rename it.env
. Must be filled with the correct values to deploy on fujinet or mainnet. For the local environment it can be set with dummy values. WALLET_PR_KEY
is deployer wallet private key.SNOWTRACE
snowtrace api key to verify contracts.
WALLET_PR_KEY='9ef92333bd48e7a927b7cc40c38d5e0b90a669d820e7e39d6cce3ed3eea9f29e'
SNOWTRACE=XYZ
npm install
npx hardhat compile
In order to properly organize the contracts, the AssetManager contract must be deployed first.
Once deployed, the obtained AssetManager address needs to be set in the exchange and lending contracts using their respective setAssetManager
function.
Additionally, the deployed SalvorExchange , SalvorLending and SalvorLendingERC20 contracts' addresses must be whitelisted on the AssetManager contract using the addPlatform
function.
deploy.js
configured to handle above explanation.
npx hardhat run --network fuji deploy.js
It is crucial to acknowledge that the new contract (VeART) requires funding with both ART and AVAX tokens in order to function optimally. For demonstration purposes, we have provided a sample contract named SalvorMini, which can enhance the generation rate through the burnSalvorMiniToBoostVeART function. However, it is important to note that SalvorMini should not be considered as a final version and should not be part of any audit process. In order to deploy the VeART contract, the GovarnanceToken contract must be deployed first and the address of the GovarnanceToken contract must be passed as a parameter to the VeART contract.
npx hardhat run --network fuji deployVeART.js
In order to boost the generation rate by burning SalvorMini, the sample contract should be deployed as indicated below and the resulting address value should be set in the VeART contract using the setSalvorMini function.
npx hardhat run --network fuji deploySalvorMini.js
npx hardhat verify --network fuji ASSET_MANAGER_CONTRACT_ADDRESS
npx hardhat verify --network fuji GOVARNANCE_TOKEN_CONTRACT_ADDRESS
npx hardhat verify --network fuji EXCHANGE_CONTRACT_ADDRESS
npx hardhat verify --network fuji LENDING_CONTRACT_ADDRESS
npx hardhat verify --network fuji LENDING_ERC20_CONTRACT_ADDRESS
npx hardhat verify --network fuji VEART_CONTRACT_ADDRESS
npx hardhat node
must be run to deploy on localhost and the process must be kept running, then run the deploy.js in a different process.
npx hardhat node
npx hardhat run --network localhost deploy.js
npx hardhat test
npx hardhat coverage
ERC721Dummy.sol and SalvorMini is only for testing purpose. No real use on production.