Assessment reports>StaFi>Threat Models>newEra

Function: newEra()

Starts a new cycle.

Branches and code coverage (including function calls)

Intended branches

  • If pool bond is above the pool, unbond call is delegated.

  • If pool unbond is above the pool, bond call is undelegated.

Negative behavior

  • Check that the appropriate amount of time has passed since the newEra.

  • Rate cannot change over limit.

Function call analysis

  • IStakePool(poolAddress).checkAndWithdrawRewards(validators)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? New pool reward.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • IStakePool(poolAddress).unstakeClaimTokens(validators[j], oldClaimedNonce)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? New pool reward.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • IStakePool(poolAddress).delegate(validators[0], needDelegate)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • IStakePool(poolAddress).getTotalStakeOnValidator(validators[j])

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Total stake of validators[j].

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • IStakePool(poolAddress).undelegate(validators[j], unbondAmount)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

  • IERC20MintBurn(rTokenAddress).mint(address(this), rTokenProtocolFee)

    • What is controllable? Nothing.

    • If return value controllable, how is it used and how can it go wrong? Discarded.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

Zellic © 2024Back to top ↑