Skip to content

Commit

Permalink
fix: adjust naming and prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-ux committed Jan 22, 2025
1 parent 1ebd1f1 commit fc41402
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 25 deletions.
23 changes: 14 additions & 9 deletions contracts/contracts/strategies/CurvePoolBooster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ contract CurvePoolBooster is Initializable, Strategizable {
////////////////////////////////////////////////////
/// --- EVENTS
////////////////////////////////////////////////////
event FeeUpdated(uint16 _newFee);
event FeeCollected(address _feeCollector, uint256 _feeAmount);
event FeeCollectorUpdated(address _newFeeCollector);
event CampaignIdUpdated(uint256 _newId);
event BribeCreated(
event FeeUpdated(uint16 newFee);
event FeeCollected(address feeCollector, uint256 feeAmount);
event FeeCollectorUpdated(address newFeeCollector);
event CampaignRemoteManagerUpdated(address newCampaignRemoteManager);
event CampaignCreated(
address gauge,
address rewardToken,
uint256 maxRewardPerVote,
uint256 totalRewardAmount
);
event CampaignIdUpdated(uint256 newId);
event CampaignClosed(uint256 campaignId);
event TotalRewardAmountUpdated(uint256 extraTotalRewardAmount);
event NumberOfPeriodsUpdated(uint8 extraNumberOfPeriods);
event RewardPerVoteUpdated(uint256 newMaxRewardPerVote);
event TokensRescued(address token, uint256 amount, address receiver);
event BribeClosed(uint256 campaignId);
event CampaignRemoteManagerUpdated(address newCampaignRemoteManager);

////////////////////////////////////////////////////
/// --- CONSTRUCTOR && INITIALIZATION
Expand Down Expand Up @@ -142,7 +142,12 @@ contract CurvePoolBooster is Initializable, Strategizable {
additionalGasLimit
);

emit BribeCreated(gauge, rewardToken, maxRewardPerVote, balanceSubFee);
emit CampaignCreated(
gauge,
rewardToken,
maxRewardPerVote,
balanceSubFee
);
}

/// @notice Manage the total reward amount of the campaign
Expand Down Expand Up @@ -253,7 +258,7 @@ contract CurvePoolBooster is Initializable, Strategizable {
ICampaignRemoteManager(campaignRemoteManager).closeCampaign(

Check warning on line 258 in contracts/contracts/strategies/CurvePoolBooster.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/CurvePoolBooster.sol#L258

Added line #L258 was not covered by tests
_campaignId
);
emit BribeClosed(_campaignId);
emit CampaignClosed(_campaignId);

Check warning on line 261 in contracts/contracts/strategies/CurvePoolBooster.sol

View check run for this annotation

Codecov / codecov/patch

contracts/contracts/strategies/CurvePoolBooster.sol#L261

Added line #L261 was not covered by tests
}

/// @notice calculate the fee amount and transfer it to the feeCollector
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/mainnet/119_pool_booster_curve.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = deploymentWithGovernanceProposal(
addresses.base.multichainStrategist, // Strategist
0, // Fee
addresses.base.multichainStrategist, // Fee collector
addresses.mainnet.CampaignRemoteManager // Campaign Remote Manager (VotemarketV2 entry point)
addresses.mainnet.CampaignRemoteManager, // Campaign Remote Manager (VotemarketV2 entry point)
]
);

Expand Down
60 changes: 45 additions & 15 deletions contracts/test/strategies/curvePoolBooster.mainnet.fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,24 @@ describe("ForkTest: CurvePoolBooster", function () {
addresses.mainnet.OUSDProxy
);
expect(await curvePoolBooster.targetChainId()).to.equal(42161);
expect(await curvePoolBooster.strategistAddr()).to.equal(multichainStrategistAddr);
expect(await curvePoolBooster.strategistAddr()).to.equal(
multichainStrategistAddr
);
expect(await curvePoolBooster.governor()).to.equal(
addresses.mainnet.Timelock
);
expect(await curvePoolBooster.campaignRemoteManager()).to.equal(addresses.mainnet.CampaignRemoteManager);
expect(await curvePoolBooster.campaignRemoteManager()).to.equal(
addresses.mainnet.CampaignRemoteManager
);
});

it("Should Create a campaign", async () => {
const { curvePoolBooster, ousd, wousd } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const woethSigner = await impersonateAndFund(wousd.address);
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

// Deal OETH and ETH to pool booster
await ousd
Expand Down Expand Up @@ -75,7 +81,9 @@ describe("ForkTest: CurvePoolBooster", function () {
const { curvePoolBooster, ousd, wousd, josh } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const woethSigner = await impersonateAndFund(wousd.address);
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);
const gov = await curvePoolBooster.governor();
const sGov = await ethers.provider.getSigner(gov);

Expand Down Expand Up @@ -114,7 +122,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should set campaign id", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);
expect(await curvePoolBooster.campaignId()).to.equal(0);

await curvePoolBooster.connect(sStrategist).setCampaignId(12);
Expand All @@ -139,7 +149,9 @@ describe("ForkTest: CurvePoolBooster", function () {
const { curvePoolBooster, ousd, wousd } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const woethSigner = await impersonateAndFund(wousd.address);
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

// Deal OETH and ETH to pool booster
await ousd
Expand Down Expand Up @@ -188,7 +200,9 @@ describe("ForkTest: CurvePoolBooster", function () {
const { curvePoolBooster, ousd, wousd } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const woethSigner = await impersonateAndFund(wousd.address);
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

// Deal OETH and ETH to pool booster
await ousd
Expand Down Expand Up @@ -234,7 +248,9 @@ describe("ForkTest: CurvePoolBooster", function () {
const { curvePoolBooster, ousd, wousd } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const woethSigner = await impersonateAndFund(wousd.address);
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

// Deal OETH and ETH to pool booster
await ousd
Expand Down Expand Up @@ -279,7 +295,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should rescue ETH", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

// Deal ETH to pool booster
await sStrategist.sendTransaction({
Expand All @@ -290,7 +308,9 @@ describe("ForkTest: CurvePoolBooster", function () {
const balanceBefore = await ethers.provider.getBalance(
curvePoolBooster.address
);
await curvePoolBooster.connect(sStrategist).rescueETH(multichainStrategistAddr);
await curvePoolBooster
.connect(sStrategist)
.rescueETH(multichainStrategistAddr);
const balanceAfter = await ethers.provider.getBalance(
curvePoolBooster.address
);
Expand Down Expand Up @@ -326,7 +346,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should revert if campaign is already created", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);
await curvePoolBooster.connect(sStrategist).setCampaignId(12);

await expect(
Expand All @@ -345,7 +367,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should revert if campaign is not created", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

await expect(
curvePoolBooster
Expand All @@ -367,7 +391,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should revert if Invalid number of periods", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

await curvePoolBooster.connect(sStrategist).setCampaignId(12);

Expand All @@ -381,7 +407,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should revert if Invalid reward per vote", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

await curvePoolBooster.connect(sStrategist).setCampaignId(12);

Expand All @@ -395,7 +423,9 @@ describe("ForkTest: CurvePoolBooster", function () {
it("Should revert if No reward to manage", async () => {
const { curvePoolBooster } = fixture;
const { multichainStrategistAddr } = await getNamedAccounts();
const sStrategist = await ethers.provider.getSigner(multichainStrategistAddr);
const sStrategist = await ethers.provider.getSigner(
multichainStrategistAddr
);

await expect(
curvePoolBooster
Expand Down

0 comments on commit fc41402

Please sign in to comment.