This project implements a BadgerBot NFT staking system with smart contracts for NFT minting, staking, and reward distribution.
- Node.js (v18.0.0 or later)
- npm (v6.0.0 or later)
- Hardhat
- Ethereum wallet with testnet ETH (for deployment)
-
Clone the repository:
git clone https://github.com/ProjectBadgerBot/Staking-Token.git cd Staking-Token
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following variables:PRIVATE_KEY=<your-ethereum-private-key> SEPOLIA_RPC_URL=<your-sepolia-rpc-url> MAINNET_RPC_URL=<your-mainnet-rpc-url> ETHERSCAN_API_KEY=<your-etherscan-api-key> TEST_BASE_URI=<your-test-base-uri>
Compile the smart contracts:
To deploy the contracts to the Sepolia testnet:
-
Make sure you have enough Sepolia ETH in your wallet.
-
Run the deployment script:
npx hardhat run scripts/deployBadgerBotContracts.js --network sepolia
-
Note down the deployed contract addresses for future reference.
To deploy the contracts to the Ethereum mainnet:
-
Ensure you have sufficient ETH in your wallet to cover deployment costs and gas fees.
-
Update your
.env
file with the mainnet RPC URL:MAINNET_RPC_URL=<your-mainnet-rpc-url>
-
Run the deployment script with the mainnet network:
npx hardhat run scripts/deployBadgerBotContracts.js --network mainnet
-
Note down the deployed contract addresses for future reference.
-
Verify the contracts on Etherscan (if not done automatically):
npx hardhat verify --network mainnet <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGUMENTS>
Important: Before deploying to mainnet, ensure all contracts have been thoroughly tested and audited. Mainnet deployments involve real value and cannot be undone.
After deployment, you may need to configure the contracts:
- The deployment script automatically sets the staking contract address in the BadgerBotPool contract.
- Add whitelist addresses to the BadgerBotPool contract using the
addToWhitelist
function. - Set up initial parameters for the BadgerBotStakingContract using the setter functions provided.
You can create custom scripts to interact with the deployed contracts and set these configurations.
Run the test suite:
The contracts are automatically verified on Etherscan after deployment if running on the Sepolia network.
- The
BadgerBotStakingContract
interacts with theBadgerBotPool
contract. Make sure both are deployed and properly linked. - Review and adjust the constants in the contracts (e.g., MIN_DEPOSIT, MAX_DEPOSIT, TEAM_SHARE) before deployment to production.
- The project uses OpenZeppelin contracts. Make sure to review their documentation for any updates or security considerations.
After deployment, update this section with the deployed contract addresses:
- BadgerBotPool: [Contract Address]
- BadgerBotStakingContract: [Contract Address]
- Always use safe math operations to prevent overflows.
- Implement access control properly using the Ownable pattern.
- Consider getting a professional audit before deploying to mainnet with real value.
This project is licensed under the MIT License.