This system manages MIGRATE points, which users earn through various actions, and allows users to claim xpMigrate tokens based on their accumulated points.
The project consists of several smart contracts:
Points.sol
: Manages the accumulation and tracking of MIGRATE points.Helper.sol
: Handles multipliers, tier calculations, and bonus mechanisms.xpMigrate.sol
: Implements the soulbound ERC20 token (non-upgradeable).Claim.sol
: Manages the claiming process for xpMigrate tokens.- Proxy contracts:
PointsProxy.sol
,HelperProxy.sol
,ClaimProxy.sol
SupermigrateProxyAdmin.sol
: Manages proxy contracts for upgrades.
- Upgradeable contract system (except for xpMigrate)
- Flexible point accumulation with action-specific multipliers
- Tier-based claiming system with cooldown periods
- Non-transferrable xpMigrate tokens
- Backend-only access for certain critical functions
- Foundry
- Solidity 0.8.x
-
Clone the repository:
git clone https://github.com/your-repo/supermigrate.git cd supermigrate
-
Install dependencies:
forge install
Compile the smart contracts using Forge:
forge build
Run the test suite using Forge:
forge test
For more verbose output, use:
forge test -vv
Users interact primarily with the Claim contract to claim their xpMigrate tokens:
- Accumulate MIGRATE points through various actions (handled by backend).
- Call the
claim
function on the Claim contract to receive xpMigrate tokens.
- Use the SupermigrateProxyAdmin contract to manage upgrades.
- Update multipliers and tier data through the Helper contract.
- Adjust the dynamic multiplier for token claims through the Claim contract.
To upgrade a contract:
- Deploy a new implementation contract.
- Call
upgrade
orupgradeAndCall
on the SupermigrateProxyAdmin contract, specifying the proxy address and the new implementation address.
- Ensure only authorized backends can call restricted functions.
- Regularly audit the contracts, especially after upgrades.
- Use multi-sig wallets for admin functions to enhance security.
- Implement emergency stop mechanisms in case of detected vulnerabilities.