Skip to content

sovreign-protocol/sovreign-contracts

Repository files navigation

Build and Test Solidity Twitter Follow

👑 Sovreign: Contracts 👑

This repo has all smart contracts used by Sovreign.

The ./contracts folder has the following structure:

  • ./facets/: contains the Diamond Facets utilized
  • ./farming/: contains all yield-farming contracts as well as the main staking vault
  • ./governance/: contains contracts related to the ReignDAO, the Diamond set-up, and Governance Rewards
  • ./interfaces/: contains all interfaces used across the protocol
  • ./libraries/: contains all libraries
  • ./mocks/: contains mock contracts used for testing
  • ./tokens/: contains the SOV and REIGN Token contracts
  • ./vesting/: contains vesting contracts for the team and early investors
  • ./wrapper/: contains all functionality related to wrapping the Balancer LP into SVR

Check the ./docs folder for an audit report and deployment information on testnet + mainnet.

solc

This project is using the solidity compiler version 0.7.6

Dependencies

  • node v14.14
  • hardhat v2
  • openzeppelin-contracts v3.2.2-solc-0.7
  • docker
  • docker-compose

Commands

Install dependencies

yarn install

Compile

yarn compile

Test

yarn test

Test Single

yarn test ./test/<TestName>.test.ts

Coverage

yarn coverage

Deployment

IMPORTANT:

The following env variables can be set:

  • TAG
  • MAINNET_FORKING_ENABLED
  • MAINNET_URL
  • RINKEBY_URL
  • ETHERSCAN_API_KEY

By default, the MAINNET_FORKING_ENABLED is set to true in .env file. It means that hardhat uses mainnet forking for running the scripts and tests.

  • Just deploy and set-up all contracts:
npx hardhat run scripts/run-deploy-all.ts
  • Run the scenario1:
npx hardhat run ./scripts/run-scenario1.ts

Run Remix-IDE and point to your local folder

docker-compose up

Go to http://localhost:8080, and choose --connect to localhost-- in the "Workspaces" dropdown menu within "File Explorers".

Acknowledgement

This repository was composed being based on the following repositories:

We're pretty thankful for their hard work! 👏 🚀

Modifications from the original work can be found in subsequent commits on this repository, made by the Sovreign Team. 🙏

License

Licensed under the Apache2 License.

See LICENSE for more information.


Made with ❤️ by Sovreign Team