Project Overview
- Create BottoRewardDistributor contract for a fresh deployment on Base network
- Optionally use existing Mainnet contract as boilerplate
- Existing Mainnet contract allows for ETH reward distribution to specific claimants
- New contract mimics core functionality, to be deployed on Base.
- Implement best practices and optimize for Base Network deployment.
Key Requirements
- Maintain core functionality:
- Allow depositing ETH rewards for multiple addresses
- Enable claiming of ETH rewards
- Permit recovery of mistakenly sent ERC20 tokens by the owner
- Update to latest Solidity version:
- Current: pragma solidity >=0.6.0 <0.8.0
- Target: Latest stable Solidity version (e.g., 0.8.19)
- Ensure compatibility with Base network:
- Verify gas optimization for Base
- Update OpenZeppelin imports to latest compatible versions
- Include BaseScan verification into deployment scripts
- Implement best practices and fix existing issues:
- Correct typos and syntax errors
- Enhance security measures
- Improve code quality and readability
Specific Tasks
- Update Solidity version to latest stable release
- Review and update OpenZeppelin imports for latest compatible versions
- Fix typos and syntax errors if using mainnet contract as boilerplate:
- In
claim
function: Change uint256 *amount
to uint256 _amount
- In
recover
function: Remove asterisks and correct variable names
- Implement additional security measures:
- Add checks for zero addresses in
deposit
and claim
functions
- Implement input validation for array lengths in
deposit
function
- Optimize gas usage:
- Consider using
uint256
instead of address
as mapping key for rewards
- Evaluate the use of
safeMath
(may not be necessary for Solidity >=0.8.0)
- Enhance code quality:
- Add comprehensive NatSpec comments
- Implement more granular error messages
- Consider adding new features:
- Implement a way to view total rewards distributed
- Add a function to remove an address from the rewards mapping
- Ensure all functions (deposit, claim, recover) work correctly
- Verify that events (Claim, Deposit, RecoveryTransfer) are emitted correctly