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

feat: V2 sidechain gauges and boosting #1

Open
wants to merge 23 commits into
base: v2
Choose a base branch
from
Open

Conversation

UrAvgDeveloper
Copy link
Collaborator

@UrAvgDeveloper UrAvgDeveloper commented Sep 21, 2022

resolves pickle-finance/internal#69

Copy link

@larrythecucumber321 larrythecucumber321 left a comment

Choose a reason for hiding this comment

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

Because the folder structure has changed between feat/gauge-proxy-v2 and this current branch (e.g. src/dill/gauge-proxy-v2.sol => src/dill/gauge-proxies/gauge-proxy-v2.sol, I'm not able to evaluate the changes. Would you be able to match the current structure in the base branch and rebase so that a diff can be made?

Re: tests, if you plan on writing more GaugeProxyV2 tests, we would probably benefit from abstracting the setup process into a common file so there's less boilerplate


pragma solidity ^0.8.1;

contract DillSideChain {

Choose a reason for hiding this comment

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

Might be more descriptive to name it something like DillSideChainBalanceStore

deployer
);

const SidechainGaugeProxy = await upgrades.deployProxy(

Choose a reason for hiding this comment

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

Woah, this upgrades plugin is cool

Deploy Guage on sidechain
*/
console.log("-- Deploying Gaugev2 contract --");
const gaugeV2 = await ethers.getContractFactory(

Choose a reason for hiding this comment

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

Why aren't the sidechain gauges deployed using the factory pattern like for the mainnet gauges?

/*
Register Gauge on sidechain gauge proxy on sidechain
*/
await SidechainGaugeProxy.addGauge(gaugeToken.address, GaugeV2.address);

Choose a reason for hiding this comment

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

SidechainGaugeProxy.addGauge probably doesn't require token as an argument right? The property is directly obtainable from the Gauge interface.

IERC20(token).balanceOf(msg.sender) < amount
) {
uint256 old_balance = IERC20(_underlying).balanceOf(token);
IERC20(_underlying).safeTransferFrom(msg.sender, token, amount);

Choose a reason for hiding this comment

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

I don't believe that the user has the amount to transfer in this case. It should be IERC20(token).balanceOf(msg.sender) instead

periods[_periodToDistribute].amount == 0,
"All period distribution compleated"
);
int256[] memory _weights = periods[periodToDistribute].weights;

Choose a reason for hiding this comment

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

If the sendRewards and distribute calls might ever be de-coupled, would we want to use the previous week's weights if the current week's sendRewards call was missed (similar to that of mainnet's GaugeProxyV2)?

// Check if stake already exists and if it is unlocked
if (thisStake.liquidity > 0) {
require(
(!stakesUnlocked || !stakesUnlockedForAccount[msg.sender]) &&

Choose a reason for hiding this comment

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

I believe it should be an OR for the last evaulation. Any of these conditions being satisfied means the user can withdraw their stake and should do so before locking again.

Also, per my feedback on our initial review, I don't see functionality which allows users to escape the boost decay (by extendin an existing lock for example).

periodId
);

rewardTokenDetails[_rewardToken] = token;

Choose a reason for hiding this comment

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

Why is rewardTokenDetails being updated here? I don't see any updates to it.

@manymoneymanny manymoneymanny removed their request for review June 14, 2023 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants