@@ -17,6 +17,8 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
1717 /// @notice Angle-related constants
1818 IERC20 private constant _ANGLE = IERC20 (0x31429d1856aD1377A8A0079410B297e1a9e214c2 );
1919
20+ uint256 public constant BASE_36 = 10 ** 36 ;
21+
2022 // ================================= REFERENCES ================================
2123
2224 /// @notice Maps each reward token to a track record of cumulated rewards
@@ -43,7 +45,7 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
4345 ) internal override {
4446 // Not claiming only if it is a deposit
4547 bool _claim = ! (_from == address (0 ));
46- _claimRewards ();
48+ _claimContractRewards ();
4749 _checkpointRewardsUser (_from, _claim);
4850 _checkpointRewardsUser (_to, _claim);
4951 // If the user is withdrawing, we need to unstake from the gauge
@@ -58,7 +60,7 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
5860 /// @return rewardAmounts Amounts of each reward token claimed by the user
5961 //solhint-disable-next-line
6062 function claim_rewards (address from ) external returns (uint256 [] memory ) {
61- _claimRewards ();
63+ _claimContractRewards ();
6264 return _checkpointRewardsUser (from, true );
6365 }
6466
@@ -68,9 +70,9 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
6870 function claimableRewards (address from , IERC20 _rewardToken ) external view returns (uint256 ) {
6971 uint256 _totalSupply = totalSupply ();
7072 uint256 newIntegral = _totalSupply != 0
71- ? integral[_rewardToken] + (_rewardsToBeClaimed (_rewardToken) * _BASE_PARAMS ) / _totalSupply
73+ ? integral[_rewardToken] + (_rewardsToBeClaimed (_rewardToken) * BASE_36 ) / _totalSupply
7274 : integral[_rewardToken];
73- uint256 newClaimable = (balanceOf (from) * (newIntegral - integralOf[_rewardToken][from])) / _BASE_PARAMS ;
75+ uint256 newClaimable = (balanceOf (from) * (newIntegral - integralOf[_rewardToken][from])) / BASE_36 ;
7476 return pendingRewardsOf[_rewardToken][from] + newClaimable;
7577 }
7678
@@ -88,7 +90,7 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
8890 uint256 userBalance = balanceOf (from);
8991 for (uint256 i; i < rewardTokensLength; ++ i) {
9092 uint256 totalClaimable = (userBalance * (integral[rewardTokens[i]] - integralOf[rewardTokens[i]][from])) /
91- _BASE_PARAMS +
93+ BASE_36 +
9294 pendingRewardsOf[rewardTokens[i]][from];
9395 if (totalClaimable != 0 ) {
9496 if (_claim) {
@@ -104,7 +106,7 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
104106 }
105107
106108 /// @notice Claims all available rewards and increases the associated integral
107- function _claimRewards () internal virtual {
109+ function _claimContractRewards () internal virtual {
108110 uint256 prevBalanceAngle = _ANGLE.balanceOf (address (this ));
109111 gauge ().claim_rewards (address (this ), address (0 ));
110112 uint256 angleRewards = _ANGLE.balanceOf (address (this )) - prevBalanceAngle;
@@ -117,7 +119,7 @@ abstract contract SanTokenERC4626AdapterStakable is SanTokenERC4626Adapter {
117119 /// @param amount Amount to add to the claimable rewards
118120 function _updateRewards (IERC20 rewardToken , uint256 amount ) internal {
119121 uint256 _totalSupply = totalSupply ();
120- if (_totalSupply != 0 ) integral[rewardToken] += (amount * _BASE_PARAMS ) / _totalSupply;
122+ if (_totalSupply != 0 ) integral[rewardToken] += (amount * BASE_36 ) / _totalSupply;
121123 }
122124
123125 /// @notice Gets the reward tokens given in the liquidity gauge
0 commit comments