Smart contract code for Fei Protocol and the FEI stablecoin
- Git clone this repo: git clone [email protected]:fei-protocol/fei-protocol-core.git
- Install dependencies:
npm install - Set the relevant environment variables in a gitignored
.env:MAINNET_ALCHEMY_API_KEYandETH_PRIVATE_KEY. You can use the.env.exampleas a base - To run the Hardhat based unit tests, run
npm run test:hardhat
Fei makes use of Forge as a smart contract development framework alongside Hardhat. To set this up run: npm run setup
Note that this has only been tested on Linux; you may encounter issues running on other operating systems.
- Node v12 or v16 (you can manage Node versions easily with NVM)
- run
npm run testto run Forge based unit tests - run
npm run test:hardhatto run Hardhat based unit tests - run
npm run test:integrationto run Solidity integration tests, forked from a pinned Mainnet block - run
npm run test:integration:latestto run Solidity integration tests, forked from the latest block - run
npm run test:e2eto run end-to-end/integration tests - run
npm run test:allto run all tests - run
npm run lintto lint ts files and sol files - run
npm lint:allto lint ts AND js files - run
npm run lint:solto lint .sol files - run
npm run lint:fixto fix linting errors, if fixable automatically - run
npm run prettier:tsto run prettier and automatically format all ts files automatically - run
npm run prettier:solto run prettier and automatically format all Solidity files automatically - run
npm run prettierto run prettier and format all files - run
npm run coverage:hardhatto run smart-contract coverage based off of all tests - run
npm run calldatato generage calldata for a proposal - run
npm run check-proposalto run tests for a specific dao proposal - run
npm run compileto compile smart contracts, if needed
See the docs
Every Thursday, do the following for the weekly release:
- Update the current release branch's fixed hardhat block to something within the last hour
- Clean the release branch if necessary:
- fix any failing tests
- clear out proposals-config
- Merge the release branch into master. Create a release via the github UI, using the version number of the release branch.
- Merge master back into develop to ensure that any fixes added are pulled back into develop, and so that the hardcoded fork block is set correctly for the most recent release.
- Create a new branch off of develop of the format release/major.minor.patch, using an incremented minor version number
For hotfix releases or bugfixes to master, branch off of master, add in the necessary fixes, and merge back into master. Then tag that commit with a new release number (increment the patch version number here). Finally merge master back into develop.
- @Joey should update this, because I am confused about the difference between the gh-pages and the master branch. Which one should we update, and which one should we run commands on? Also, do we need to change the default branch of this repo?
Fei Protocol is under the AGPL v3 license