Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Aura rewards estimation function to changes introduced #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion contracts/StrategyAuraStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ contract StrategyAuraStaking is BaseStrategy {
view
returns (uint256 amount)
{
uint256 mintAmount = _balAmount
.mul(BOOSTER.getRewardMultipliers(address(baseRewardPool)))
.div(BOOSTER.REWARD_MULTIPLIER_DENOMINATOR());
Copy link
Contributor

@shuklaayush shuklaayush Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store it as a constant (10000)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to move this out of getMintableAuraRewards and call the function with the adjusted bal value

uint256 balAmountAdjusted = _balAmount.mul(BOOSTER.getRewardMultipliers(address(baseRewardPool))).div(REWARD_MULTIPLIER_DENOMINATOR;
getMintableAuraRewards(balAmountAdjusted);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, pushed

// NOTE: Only correct if AURA.minterMinted() == 0
// minterMinted is a private var in the contract, so we can't access it directly
uint256 emissionsMinted = AURA.totalSupply() - AURA.INIT_MINT_AMOUNT();
Expand All @@ -302,7 +305,7 @@ contract StrategyAuraStaking is BaseStrategy {

if (cliff < totalCliffs) {
uint256 reduction = totalCliffs.sub(cliff).mul(5).div(2).add(700);
amount = _balAmount.mul(reduction).div(totalCliffs);
amount = mintAmount.mul(reduction).div(totalCliffs);

uint256 amtTillMax = AURA.EMISSIONS_MAX_SUPPLY().sub(
emissionsMinted
Expand Down
5 changes: 5 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.default]
remappings = [
"@openzeppelin-contracts-upgradeable=/root/.brownie/packages/OpenZeppelin/[email protected]/contracts/",
"@badger-finance=/root/.brownie/packages/Badger-Finance/[email protected]/contracts/",
]
4 changes: 4 additions & 0 deletions interfaces/aura/IBooster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ interface IBooster {

function FEE_DENOMINATOR() external view returns (uint256);

function REWARD_MULTIPLIER_DENOMINATOR() external view returns (uint256);

function MaxFees() external view returns (uint256);

function addPool(
Expand Down Expand Up @@ -83,6 +85,8 @@ interface IBooster {

function gaugeMap(address) external view returns (bool);

function getRewardMultipliers(address) external view returns (uint256);

function isShutdown() external view returns (bool);

function lockIncentive() external view returns (uint256);
Expand Down