ISTONEUSDStaking
Author: luoyhang003
Interface for the STONEUSD staking contract used in the Genesis Expedition event.
This interface defines:
- Locking of STONEUSD to earn RawStones and Hammers
- Eligibility tracking for daily rewarded hammers
- Unlocking staked STONEUSD after the event ends
- View helpers for quota, locked amount, and user eligibility
Functions
lock
Locks STONEUSD into the staking contract to participate in the event.
- Requires the event to be active.
- Enforces per-user lock quota.
- May trigger referral binding and bonus hammer distribution.
function lock(uint256 _tokenLocked, address _referrer) external;
Parameters
| Name | Type | Description |
|---|---|---|
_tokenLocked | uint256 | The amount of STONEUSD to lock. |
_referrer | address | The address of the user who referred the caller (optional). |
unlock
Unlocks all previously locked STONEUSD after the event ends.
- Callable only after the global unlock timestamp.
- Transfers all unlocked tokens back to the user.
function unlock() external;
getLockedAmount
Returns the total amount of STONEUSD locked by a user.
function getLockedAmount(address _player) external view returns (uint256 locked_);
Parameters
| Name | Type | Description |
|---|---|---|
_player | address | The user whose locked amount is queried. |
Returns
| Name | Type | Description |
|---|---|---|
locked_ | uint256 | The total locked STONEUSD amount. |
getLockQuota
Returns the remaining amount of STONEUSD the user is still allowed to lock.
Quota is based on the MAX_LOCK_COUNT (10 * 1000 STONEUSD).
function getLockQuota(address _player) external view returns (uint256 quota_);
Parameters
| Name | Type | Description |
|---|---|---|
_player | address | The user whose quota is queried. |
Returns
| Name | Type | Description |
|---|---|---|
quota_ | uint256 | Remaining allowable lock amount. |
getEligibility
Returns whether the user has activated daily hammer rewards (eligibility).
Eligibility becomes true once the user locks STONEUSD for the first time.
function getEligibility(address _player) external view returns (bool eligibility_);
Parameters
| Name | Type | Description |
|---|---|---|
_player | address | The user whose eligibility is queried. |
Returns
| Name | Type | Description |
|---|---|---|
eligibility_ | bool | True if the user receives daily system hammer rewards. |
getLockCount
Returns how many times the user has locked 1000 STONEUSD units.
Each 1000 STONEUSD increases lockCount by 1, up to MAX_LOCK_COUNT.
function getLockCount(address _player) external view returns (uint256 lockCount_);
Parameters
| Name | Type | Description |
|---|---|---|
_player | address | The user whose lockCount is queried. |
Returns
| Name | Type | Description |
|---|---|---|
lockCount_ | uint256 | Number of lock units attributed to the user. |
Events
TokenLocked
Emitted when a user locks STONEUSD for event participation.
event TokenLocked(address indexed player, address indexed token, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
player | address | The user performing the lock. |
token | address | The address of the locked token (STONEUSD). |
amount | uint256 | The amount of STONEUSD locked. |
TokenUnlocked
Emitted when a user unlocks their previously locked STONEUSD.
event TokenUnlocked(address indexed player, address indexed token, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
player | address | The user unlocking the tokens. |
token | address | The address of the unlocked token (STONEUSD). |
amount | uint256 | The amount unlocked. |