Skip to content

fighting45/STYXY-smart-contracts-Ethereum

Repository files navigation

Styxy Smart Contracts

This repository is a Hardhat project comprising of smart contracts for the Styxy Token (STYXY). It includes the contract implementation for an ERC-20 token, NFT contract (for staking rewards), STYXY staking contract and the deployment script for deploying and verifying the contracts on Ethereum-based networks such as local Hardhat network or Sepolia network.

Project Overview

  • Contract Name: ERC20.sol
  • Token Name: Styxy
  • Token Symbol: STYXY
  • Token Standard: ERC-20
  • Initial Supply: 1,000,000 STYXY tokens

This smart contract is based on the OpenZeppelin ERC-20 implementation, ensuring security, scalability, and adherence to best practices.

Files

1. contracts

This folder contains ERC-20, testERC-20, staking and vesting contracts which inherit from OpenZeppelin’s ERC20 contract.

2. deploy.js: Deployment Script

The deployment script uses Hardhat's built-in functionality to deploy the contract and verify it. The script deploys the MyToken contract with an initial supply of 1,000,000 STYXY tokens.

This script does the following:

  • Deploys the ERC20 contract with an initial supply of 1,000,000 STYXY tokens.
  • Waits for the contract deployment to be mined.
  • Outputs the contract address, token details (name, symbol, total supply), and the owner's balance.
  • Provides the Hardhat verification command for verifying the contract on Etherscan.

3. test/staking.test.js: Testing Script

The comprehensive testing scripts comprising of 120+ tests cases, for all the smart contracts including ERC 20, NFT, staking & vesting contracts which test all the read, write and ownerOnly modifier functions of the existing contracts.

Setup

To get started, follow these steps:

1. Clone the repository

Clone this repository to your local machine:

git clone https://github.com/your-username/styxy-smart-contracts.git
cd styxy-smart-contracts

2. Install dependencies

Run the following command to install the required dependencies:

npm install

3. Configure .env file

Create a .env file in the root directory and add your sensitive information (Infura/Alchemy API key and wallet private key) for deploying to the Sepolia testnet:

INFURA_PROJECT_ID=your_infura_project_id
PRIVATE_KEY=your_wallet_private_key
ETHERSCAN_API_KEY=your_etherscan_api_key
REPORT_GAS=true || false

4. Deploy the contracts

To deploy the contracts to the Sepolia testnet, run the following command:

npx hardhat run scripts/deploy.js --network sepolia

Once the deployment is complete, you'll see the contract address, token details, and the verification command.

5. Verify the contract on Etherscan (optional)

After deployment, you can verify the contract on Etherscan using the following command:

npx hardhat verify --network sepolia CONTRACT_ADDRESS "1000000000000000000000000"

6. Testing the Contracts

To test the contracts, you can interact with it using Hardhat's ethers.js by running the following command:

npx hardhat test

About

Hardhat project for Smart contracts of STYXY exchange includes ERC20, staking, vesting and governance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published