coinsPoL Security Guidelines: Tokenomics

Berachain Tokenomics

Threat 1: Liquidity crisis due to native token shortage during BGT redemption

When a user attempts to redeem their acquired $BGT for the native token, $BERA, at a 1:1 ratio, if the target contract has an insufficient amount of $BERA, some users will not be able to receive their rewards, and the transaction will revert.

Impact

High

If the redemptions of many users fail due to a shortage of native tokens, it can directly lead to a loss of trust, a large-scale capital outflow, and a system-wide liquidity crisis. Therefore, it is rated High.

Guideline

  • Validation during BGT redemption:

    • Check contract balance:

      • Use safeTransferETH in the redeem function to revert if the balance is insufficient when transferring BERA.

    • Verify redemption request amount:

      • Use the checkUnboostedBalance function to verify that the user's redemption request amount is less than or equal to the unboosted BGT amount.

  • Ensure sufficient native token holdings in the contract:

    • Guarantee finality after redemption:

      • After the redemption process is completed, use _invariantCheck to compare the current total BGT supply with the amount of native tokens held to verify that a sufficient amount of native tokens is held.

    • BERA issuance settings in the chain spec:

    • Manage excess token holdings and maintain an appropriate buffer:

      • When calculating the expected BGT issuance, calculate an accurate expected amount considering factors such as the block buffer size and BGT issuance per block.

        • Calculate the maximum BGT that can be issued per block by inputting 100% for boostPower in the computeReward function of BlockRewardController.

        • Set HISTORY_BUFFER_LENGTH to 8191 in accordance with EIP-4788.

        • Calculate the potential BGT issuance with the above two values, then add it to the current BGT issuance to calculate outstandingRequiredAmount.

        • If the native token balance exceeds the outstandingRequiredAmount value, burn the excess amount to the zero address through the burnExceedingReserves function.

Best Practice

BGT.solarrow-up-right

BlockRewardController.solarrow-up-right


Threat 2: Operators collude to concentrate BGT rewards in a specific reward vault, leading to liquidity concentration and depletion of other protocols' liquidity

If operators collude to direct BGT rewards to a specific reward vault, the liquidity of some reward vaults will be depleted, and the liquidity of other protocols will also decrease.

Impact

Medium

If liquidity is concentrated in some vaults, it can lead to market distortion and service imbalances due to the depletion of liquidity in other vaults and protocols. However, since it does not directly lead to an immediate system-wide paralysis or catastrophic loss, it is rated Medium.

Guideline

  • Force rewards to be distributed to multiple reward vaults to prevent concentration in a single vault.

    • Manage all created reward vault addresses (receivers) through the Weight struct.

    • To receive rewards, a reward vault address (receiver) must be registered in the whitelist through governance19.

      • Simply being created in the Weight struct does not mean it can be allocated rewards.

  • Prevent an operator from concentrating rewards in a single vault through multiple transactions.

    • Introduce a delay (approx. 2000 blocks) for reward allocation so that it is not reflected immediately. Also, by requiring each allocation to distribute 100% of the total rewards, it prevents the distribution of rewards in parts through multiple transactions.

  • If a single operator operates multiple validators, prevent them from concentrating the rewards of multiple validators in a specific vault.

    • queueNewRewardAllocation: Check the operator's total allocation limit.

    • activateReadyQueuedRewardAllocation: Reflect the actual allocation and update the cumulative value.

    • lastActiveWeights: Track the last activated RewardAllocation for each validator.

    • operatorVaultAllocations: Track the total allocation ratio for each vault by operator.

    • For detailed implementation, refer to the Custom Code below.

  • Prevent a situation where multiple operators collude to concentrate rewards in a specific vault18.

    • If the total allocation of all operators to a specific vault exceeds a certain limit, introduce a function to temporarily suspend reward allocation to that vault (= the vault cannot be selected in RewardAllocation).

    • Track the total allocation sum for each vault.

    • If the limit is exceeded, the vault cannot be included in RewardAllocation (queuing itself will revert).

    • Allocation can be resumed once it falls below the limit.

    • For detailed implementation, refer to the Custom Code below.

Best Practice

BeraChef.solarrow-up-right

Custom Code

chevron-rightPreventing a single operator running multiple validators from concentrating rewards in a specific vaulthashtag
chevron-rightPreventing multiple operators from colluding to concentrate rewards in a specific vaulthashtag

Threat 3: Reward monopolization and BGT inflation due to boost collusion between LSD and validators

If a small number of top LSDs and validators collude to monopolize BGT boosting, BGT inflation could rapidly increase and BGT ownership and rewards could become concentrated among a very few entities.

Impact

Low

Although BGT inflation and reward concentration may favor a small number of entities, it does not directly cause critical immediate impact on overall system operation or stability, so it is rated Low.

Guideline

  • Governance management of BlockRewardController reward parameters:

    • baseRate, rewardRate, minBoostedRewardRate, boostMultiplier, rewardConvexity, etc. β†’ All can only be changed by onlyOwner (governance/operator) β†’ Parameters can be immediately adjusted if inflation increases excessively

  • Transparency and adjustability of reward distribution formulas

    • Reward formula

      • BGT rewards are calculated with parameters like boostPower, rewardRate, boostMultiplier, rewardConvexity in the computeReward() function

  • Automatic detection and limitation when rewards become overly concentrated

    • When rewards become excessively concentrated in one validator/vault/address

    • Adjust parameters20 like convexity, boostMultiplier in the reward distribution formula so that additional reward efficiency decreases rapidly as concentration increases

    • computeReward() formula design

    Source - https://docs.berachain.com/learn/pol/blockrewardsarrow-up-right

  • Forced distribution in RewardAllocation

    • Distribution through Weight struct: When distributing rewards, clearly allocate ratios to multiple vaults (receivers) with Weight

    • Limit maximum Weight per vault: Limit maximum Weight (maxWeightPerVault) allocatable to one vault

    • Revert if RewardAllocation total is not 100%

    • Code reference: Check _validateWeights code in Threat 2

  • Automatic revert when reward concentration limits are exceeded

    • Track total allocation sum per vault

      • If total allocation sum of all operators to a specific vault exceeds the limit, the vault cannot be included in RewardAllocation (queuing itself will revert)

    • Code reference: See "Preventing multiple operators from colluding to concentrate rewards in a specific vault" section in Threat 2

  • Real-time parameter adjustment and community monitoring

    • BlockRewardController parameters, RewardAllocation policies, etc. can only be changed by governance/operator

    • Reference: Governance management of BlockRewardController reward parameters

Best Practice

Custom Code

chevron-rightGovernance management of BlockRewardController reward parametershashtag
chevron-rightReward distribution formula examplehashtag

Threat 4: Validator boost reward reduction if additional supply is not provided after incentive tokens are depleted

If additional supply is not provided after incentive tokens are depleted, validators' boost rewards will drastically decrease. If the incentive token balance in reward vaults cannot be checked in real-time, validators may not be able to anticipate reward reductions in advance.

Impact

Low

When incentive tokens are depleted, validator rewards may temporarily decrease, but this does not directly cause critical impact on overall system stability or operation and can be relatively easily recovered through additional supply, so it is rated Low.

Guideline

  • Limit minimum incentive token holdings in reward vaults

    • Add minIncentiveBalance21 state variable

    • Changeable via setter

    • Add event logging

    • Add getCurrentIncentiveBalance() function to check current incentive token balance in reward vaults

  • For validators, when selecting reward vaults to distribute BGT, allocation to reward vaults with incentive tokens below the threshold is not allowed

    • In _validateWeights and _checkIfStillValid functions, if each vault's incentive balance is below threshold, it cannot be included in reward allocation (revert)

    • guaranteeBlocks is set to unify with rewardAllocationBlockDelay currently set to 2000 blocks in BeraChef

  • minIncentiveBalance is calculated by multiplying the most recent BGT issuance by each incentive token's incentiveRate and reward allocation period (guaranteeBlocks) to get the incentive amount for BGT issued per period

  • Through getCurrentIncentiveBalance, check if all incentive tokens have quantity above minIncentiveBalance when allocating rewards; if insufficient, allocation is not possible

Best Practice

Custom Code


Threat 5: Boost APR reduction for validators who selected the corresponding reward vault due to lowered reward ratios after incentive tokens are depleted

After incentive tokens are depleted, incentive ratios are lowered, causing boost APR reduction for validators who selected the corresponding reward vaults. If authority management is inadequate, incentive ratios could be arbitrarily adjusted, causing damage.

Impact

Low

Although incentive ratio adjustments may reduce boost APR for some validators, this is limited and temporary loss that does not significantly affect overall system stability or operation, so it is rated Low.

Guideline

  • Define clear roles (Owner, Admin, User, etc.) for each function and critical data, strictly grant access permissions according to roles

    • Owner: Contract settings, incentive token management, administrator designation, pause/resume, recovery of incorrect tokens, etc.

    • Admin: Incentive addition/settlement (token-specific manager), reward period settings (RewardDurationManager)

    • User: Staking/unstaking, reward claiming, delegation, operator designation (only their own operator), etc.

  • Clearly use modifiers like onlyOwner, onlyRole

  • Event logging for administrative activities (permission changes, critical function calls, etc.)

Best Practice

RewardVault.solarrow-up-right


Threat 6: Distortion of user fee rewards due to front-running of claimFees function

When front-running occurs through transaction preemption before users calling the claimFees function, users may suffer losses by having to pay HONEY without receiving fee rewards.

Impact

Low

Although claimFees front-running may temporarily distort fee rewards for some users, this occurs limitedly to individual users and does not significantly affect overall system stability or operation, so it is rated Low.

Guideline

  • Before claiming fees, compare the balance state of fees that serve as calculation basis with users' expected rewards, and revert if actual claimable fees are less

    • Previously, claiming only required passing an array of desired fee token addresses as arguments

    • Additionally, create arrays of expected amounts for each fee token and pass as arguments, reverting if the contract's current fee token amount is below expectations

Best Practice

Custom Code

Last updated