Skip to content

opseccloud/staking

Repository files navigation

Opsec Staking

Overview

Opsec Staking is a Solidity project built with Hardhat, designed for the Ethereum blockchain. It enables users to stake OPSEC tokens to earn rewards over time. The contract includes features like staking, unstaking, extending stake duration, and claiming rewards. It utilizes OpenZeppelin contracts for secure token handling and contract ownership management.

Features

  • Staking OPSEC tokens with a specified duration.
  • Ability to extend the duration of an existing stake.
  • Unstaking tokens after the staking period has ended.
  • Claiming ETH rewards distributed by the contract owner.
  • Withdraw functionality for the contract owner to manage staked tokens and contract balances.

Installation

Before installing, ensure you have Node.js and npm (or Yarn) installed on your system. You'll also need Git to clone the repository.

  1. Install dependencies:
npm install
  1. Create a .env file in the project root and add the following environment variables:
PRIVATE_KEY=your_wallet_private_key
INFURA_API_KEY=your_infura_api_key
  1. Compile the contracts:
npx hardhat compile

Usage

The project includes a set of Hardhat tasks for testing, deploying, and interacting with the contract. You can run these tasks using the npx hardhat command.

  1. Run the test suite:
npx hardhat test
  1. Deploy the contract to a local Hardhat network:
npx hardhat run scripts/deploy.js --network localhost

Contributing

Contributions are welcome! Please open an issue or submit a pull request with your proposed changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Staking contract for Opsec Cloudverse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published