Skip to content

Repository files navigation

SunStaker

SunStaker is a set of on‑chain yield‑farming smart contracts for the Sun Protocol.
It is intended as a modular, upgradeable system for staking, reward distribution, and strategy management around Sun ecosystem tokens.

Note: This repository contains only the smart contracts and related tooling.
Frontend applications, deployment scripts, and protocol documentation may live in separate repositories.

Features

  • Staking & Unstaking: Users can deposit supported tokens into staking pools and withdraw them at any time, subject to the pool’s rules.
  • Reward Distribution: Rewards are distributed over time based on users’ share of total stake in each pool.
  • Pool Configuration: Each pool can be configured with its own reward rate, reward token, and allocation parameters.
  • Administrative Controls: Restricted functions for protocol operators (e.g. adding pools, updating parameters, pausing certain operations).

Repository Structure

The exact layout may evolve, but typical directories include:

  • contracts/: Core protocol contracts and interfaces.
  • test/: Unit and integration tests for the contracts.
  • scripts/: Optional deployment, migration, and maintenance scripts.
  • lib/ or node_modules/: Third‑party dependencies and libraries.

Development

  1. Clone the repository

    git clone <this-repo-url>
    cd sunstaker-contract
  2. Install dependencies

    Depending on the tooling used (Foundry, Hardhat, Truffle, etc.), install the corresponding dependencies. For example, with Node.js:

    npm install
    # or
    pnpm install
    # or
    yarn install
  3. Compile contracts

    Use the configured tooling in this repository. Typical examples:

    npx hardhat compile
    # or
    forge build

Testing

Run the test suite with the configured framework, for example:

npx hardhat test
# or
forge test

Please refer to the project’s configuration (e.g. hardhat.config.*, foundry.toml) for the exact commands supported in this repository.

Deployment

Deployment is environment‑specific (testnet vs. mainnet) and usually driven by scripts under scripts/ or by configuration files in the root of the project. Typical steps:

  1. Configure environment variables (RPC endpoints, private keys, etc.).
  2. Run the appropriate deployment script for your target network.
  3. Verify deployed contracts on the relevant block explorer (if supported).

Consult internal documentation or deployment scripts for network‑specific details.

Security Notes

  • Use at your own risk: This code may be experimental and subject to change.
  • Audits: If third‑party audits have been performed, refer to audit reports for security findings and mitigations.
  • Responsible disclosure: If you discover a vulnerability, please follow a responsible disclosure process and contact the maintainers privately rather than opening a public issue.

Contributing

Contributions are welcome. To propose a change:

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes and add tests where appropriate.
  4. Open a pull request with a clear description and rationale.

License

Unless otherwise stated in a dedicated LICENSE file, the default license for this repository is unspecified. Please check with the project maintainers or your organization’s guidelines before using this code in production.

About

Yield-Farming contracts of Sun.

Resources

Stars

10 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages