https://github.com/gysr-io/core
GYSR is an open platform for on-chain incentives
https://github.com/gysr-io/core
defi ethereum solidity staking yield-farming
Last synced: 4 months ago
JSON representation
GYSR is an open platform for on-chain incentives
- Host: GitHub
- URL: https://github.com/gysr-io/core
- Owner: gysr-io
- License: mit
- Created: 2020-08-25T07:09:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T21:41:20.000Z (almost 3 years ago)
- Last Synced: 2025-10-26T19:55:42.618Z (8 months ago)
- Topics: defi, ethereum, solidity, staking, yield-farming
- Language: JavaScript
- Homepage: https://docs.gysr.io
- Size: 935 KB
- Stars: 10
- Watchers: 2
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GYSR core
This repository contains the Solidity contracts for the GYSR core procotol, including modular pools, factory system, and token.
For more information on the project, whitepapers, audits, and other resources,
see [gysr.io](https://www.gysr.io/)
## Install
To use the core contracts, interfaces, libraries, or ABIs in your own project
```
npm install @gysr/core
```
See the [documentation](https://docs.gysr.io/developers) to learn more about interacting with the GYSR protocol.
*Note: the package is published with solidity `^0.8.18` compatibility, but core contracts have only been tested and audited with solidity `0.8.18` exact.*
## Development
Both **Node.js** and **npm** are required for package management and testing. See instructions
for installation [here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
This project uses [Hardhat](https://hardhat.org/docs) for development, testing, and deployment.
To install these packages along with other dependencies:
```
npm install
```
## Test
To run all unit tests
```
npm test
```
To run some subset of tests
```
npx hardhat compile && npx hardhat test --grep ERC20CompetitiveRewardModule
```
## Deploy
Copy `.env.template` to `.env` and define the `INFURA_KEY`, `DEPLOYER_INDEX`,
and `ETHERSCAN_KEY` variables.
To deploy GYSR token to Goerli
```
npx hardhat run --network goerli scripts/i_deploy_token.js
```
Once GYSR token is deployed, define the `GYSR_ADDRESS` variable in your `.env` file.
To deploy the configuration contract to Goerli
```
npx hardhat run --network goerli scripts/i_deploy_config.js
```
Once the configuration contract is deployed, define the `CONFIG_ADDRESS` variable in your `.env` file.
To deploy the factory contract to Goerli
```
npx hardhat run --network goerli scripts/ii_deploy_factory.js
```
Once the factory is deployed, define the `FACTORY_ADDRESS` variable in your `.env` file.
To deploy the ERC20 staking module factory to Goerli
```
npx hardhat run --network goerli scripts/iii_deploy_module_factory_staking.js
```
To deploy the ERC20 competitive reward module factory to Goerli
```
npx hardhat run --network goerli scripts/iii_deploy_module_factory_competitive.js
```
Follow the remaining migration steps to deploy all contracts and libraries.
To verify a contract on Goerli
```
npx hardhat verify --network goerli --contract contracts/PoolFactory.sol:PoolFactory 0xpoolfactory 0xgysrtoken 0xconfig
```