chore: make linter happy

This commit is contained in:
r4bbit
2025-02-03 14:15:37 +01:00
parent 70a7f30d2a
commit aa67f1f628
6 changed files with 20 additions and 8 deletions

View File

@@ -2,10 +2,11 @@
## Overview
The XPToken is an ERC-20 token implementation with a modified supply mechanism that incorporates external reward providers.
XP tokens are not transferrable, but they can be used as voting power in the Status Network.
The XPToken is an ERC-20 token implementation with a modified supply mechanism that incorporates external reward
providers. XP tokens are not transferrable, but they can be used as voting power in the Status Network.
## Features
- **Minting with Restrictions:**
- The contract owner (admin) can mint tokens, and their accounting is kept internally.
- Prevents exceeding a dynamically calculated mint allowance.
@@ -24,23 +25,27 @@ XP tokens are not transferrable, but they can be used as voting power in the Sta
- `SYMBOL`: "XP"
### State Variables
- `rewardProviders`: A list of addresses implementing the `IRewardProvider` interface.
### Errors
- `XPToken__MintAllowanceExceeded`: Raised when minting exceeds the allowed threshold.
- `XPToken__TransfersNotAllowed`: Raised when a transfer, approval, or transferFrom is attempted.
- `RewardProvider__IndexOutOfBounds`: Raised when an invalid index is used for removing a reward provider.
## Supply and Balance Calculation
- **totalSupply()**: Sum of the internal supply and the sum of external supplies from reward providers.
- **balanceOf(address)**: Internal balance plus the sum of external balances from reward providers.
## Sources of XP Tokens
One of the sources for the generation of XP tokens is the [staking protocol](overview.md), with more sources planned in the future.
One of the sources for the generation of XP tokens is the [staking protocol](overview.md), with more sources planned in
the future.
## Notes
- The contract is designed to work alongside an external reward system.
- Transfers and approvals are explicitly disabled to enforce controlled distribution.
- The contract ensures a dynamic supply mechanism tied to external rewards.

View File

@@ -1,8 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import { ITrustedCodehashAccess } from "./ITrustedCodehashAccess.sol";
/**
* @title IStakeConstants
* @author Ricardo Guilherme Schmidt <ricardo3@status.im>

View File

@@ -4,4 +4,5 @@ pragma solidity ^0.8.26;
import { IStakeManager } from "./IStakeManager.sol";
import { ITransparentProxy } from "./ITransparentProxy.sol";
// solhint-disable-next-line
interface IStakeManagerProxy is IStakeManager, ITransparentProxy { }

View File

@@ -51,6 +51,7 @@ abstract contract StakeMath is MultiplierPointMath {
{
uint256 newBalance = _balance + _increasedAmount;
_newLockEnd = Math.max(_currentLockEndTime, _processTime) + _increasedLockSeconds;
// solhint-disable-next-line
uint256 dt_lock = _newLockEnd - _processTime;
if (dt_lock != 0 && (dt_lock < MIN_LOCKUP_PERIOD || dt_lock > MAX_LOCKUP_PERIOD)) {
revert StakeMath__InvalidLockingPeriod();
@@ -99,6 +100,7 @@ abstract contract StakeMath is MultiplierPointMath {
}
_newLockEnd = Math.max(_currentLockEndTime, _processTime) + _increasedLockSeconds;
// solhint-disable-next-line
uint256 dt_lock = _newLockEnd - _processTime;
if (dt_lock != 0 && (dt_lock < MIN_LOCKUP_PERIOD || dt_lock > MAX_LOCKUP_PERIOD)) {
revert StakeMath__InvalidLockingPeriod();

View File

@@ -6,7 +6,6 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { TrustedCodehashAccess } from "./../../src/TrustedCodehashAccess.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import { IStakeConstants } from "./../../src/interfaces/IStakeConstants.sol";
contract StackOverflowStakeManager is
UUPSUpgradeable,
@@ -14,6 +13,7 @@ contract StackOverflowStakeManager is
TrustedCodehashAccess,
ReentrancyGuardUpgradeable
{
// solhint-disable-next-line
IERC20 public STAKING_TOKEN;
uint256 public constant SCALE_FACTOR = 1e18;
@@ -42,15 +42,19 @@ contract StackOverflowStakeManager is
mapping(address account => Account data) public accounts;
// solhint-disable-next-line
function getStakedBalance(address _vault) external view override returns (uint256 _balance) {
// implementation
}
// solhint-disable-next-line
function lock(uint256 _seconds) external override {
// implementation
}
// solhint-disable-next-line
function stake(uint256 _amount, uint256 _seconds) external override {
// implementation
}
// solhint-disable-next-line
function unstake(uint256 _amount) external override {
// implementation
}
@@ -67,6 +71,7 @@ contract StackOverflowStakeManager is
return accounts[_account];
}
// solhint-disable-next-line
function registerVault() external override {
// implementation
}

View File

@@ -4,6 +4,7 @@ pragma solidity ^0.8.26;
import { IRewardProvider } from "../../src/interfaces/IRewardProvider.sol";
contract XPProviderMock is IRewardProvider {
// solhint-disable-next-line
mapping(address => uint256) public userXPShare;
uint256 public totalXPShares;