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.
- 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.
This folder contains ERC-20, testERC-20, staking and vesting contracts which inherit from OpenZeppelin’s ERC20 contract.
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.
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.
To get started, follow these steps:
Clone this repository to your local machine:
git clone https://github.com/your-username/styxy-smart-contracts.git
cd styxy-smart-contractsRun the following command to install the required dependencies:
npm installCreate 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 || falseTo deploy the contracts to the Sepolia testnet, run the following command:
npx hardhat run scripts/deploy.js --network sepoliaOnce the deployment is complete, you'll see the contract address, token details, and the verification command.
After deployment, you can verify the contract on Etherscan using the following command:
npx hardhat verify --network sepolia CONTRACT_ADDRESS "1000000000000000000000000"To test the contracts, you can interact with it using Hardhat's ethers.js by running the following command:
npx hardhat test