diff --git a/contracts/contracts/buyback/BaseBuyback.sol b/contracts/contracts/buyback/BaseBuyback.sol index 2229896e41..a852c7a50f 100644 --- a/contracts/contracts/buyback/BaseBuyback.sol +++ b/contracts/contracts/buyback/BaseBuyback.sol @@ -19,12 +19,12 @@ abstract contract BaseBuyback is Initializable, Strategizable { event TreasuryManagerUpdated(address indexed _address); event CVXShareBpsUpdated(uint256 bps); - // Emitted whenever OUSD/OETH is swapped for OGV/CVX or any other token + // Emitted whenever OUSD/OETH is swapped for OGN/CVX or any other token event OTokenBuyback( address indexed oToken, address indexed swappedFor, uint256 swapAmountIn, - uint256 minExpected + uint256 amountOut ); // Address of 1-inch Swap Router @@ -39,7 +39,7 @@ abstract contract BaseBuyback is Initializable, Strategizable { // slither-disable-next-line constable-states address private __deprecated_weth9; - // Address that receives OGV after swaps + // Address that receives OGN after swaps address public rewardsSource; // Address that receives all other tokens after swaps @@ -49,12 +49,12 @@ abstract contract BaseBuyback is Initializable, Strategizable { uint256 private __deprecated_treasuryBps; address public immutable oToken; - address public immutable ogv; + address public immutable ogn; address public immutable cvx; address public immutable cvxLocker; - // Amount of `oToken` balance to use for OGV buyback - uint256 public balanceForOGV; + // Amount of `oToken` balance to use for OGN buyback + uint256 public balanceForOGN; // Amount of `oToken` balance to use for CVX buyback uint256 public balanceForCVX; @@ -64,7 +64,7 @@ abstract contract BaseBuyback is Initializable, Strategizable { constructor( address _oToken, - address _ogv, + address _ogn, address _cvx, address _cvxLocker ) { @@ -72,7 +72,7 @@ abstract contract BaseBuyback is Initializable, Strategizable { _setGovernor(address(0)); oToken = _oToken; - ogv = _ogv; + ogn = _ogn; cvx = _cvx; cvxLocker = _cvxLocker; } @@ -118,9 +118,9 @@ abstract contract BaseBuyback is Initializable, Strategizable { if (oldRouter != address(0)) { // Remove allowance of old router, if any - if (IERC20(ogv).allowance(address(this), oldRouter) != 0) { + if (IERC20(ogn).allowance(address(this), oldRouter) != 0) { // slither-disable-next-line unused-return - IERC20(ogv).safeApprove(oldRouter, 0); + IERC20(ogn).safeApprove(oldRouter, 0); } if (IERC20(cvx).allowance(address(this), oldRouter) != 0) { @@ -133,7 +133,7 @@ abstract contract BaseBuyback is Initializable, Strategizable { } /** - * @dev Sets the address that receives the OGV buyback rewards + * @dev Sets the address that receives the OGN buyback rewards * @param _address Address */ function setRewardsSource(address _address) external onlyGovernor { @@ -176,27 +176,27 @@ abstract contract BaseBuyback is Initializable, Strategizable { /** * @dev Computes the split of oToken balance that can be - * used for OGV and CVX buybacks. + * used for OGN and CVX buybacks. */ function _updateBuybackSplits() internal - returns (uint256 _balanceForOGV, uint256 _balanceForCVX) + returns (uint256 _balanceForOGN, uint256 _balanceForCVX) { - _balanceForOGV = balanceForOGV; + _balanceForOGN = balanceForOGN; _balanceForCVX = balanceForCVX; uint256 totalBalance = IERC20(oToken).balanceOf(address(this)); - uint256 unsplitBalance = totalBalance - _balanceForOGV - _balanceForCVX; + uint256 unsplitBalance = totalBalance - _balanceForOGN - _balanceForCVX; // Check if all balance is accounted for if (unsplitBalance != 0) { // If not, split unaccounted balance based on `cvxShareBps` uint256 addToCVX = (unsplitBalance * cvxShareBps) / 10000; _balanceForCVX = _balanceForCVX + addToCVX; - _balanceForOGV = _balanceForOGV + unsplitBalance - addToCVX; + _balanceForOGN = _balanceForOGN + unsplitBalance - addToCVX; // Update storage - balanceForOGV = _balanceForOGV; + balanceForOGN = _balanceForOGN; balanceForCVX = _balanceForCVX; } } @@ -231,34 +231,34 @@ abstract contract BaseBuyback is Initializable, Strategizable { require(amountOut >= minAmountOut, "Higher Slippage"); - emit OTokenBuyback(oToken, tokenOut, minAmountOut, amountOut); + emit OTokenBuyback(oToken, tokenOut, oTokenAmount, amountOut); } /** - * @dev Swaps `oTokenAmount` to OGV + * @dev Swaps `oTokenAmount` to OGN * @param oTokenAmount Amount of OUSD/OETH to swap - * @param minOGV Minimum OGV to receive for oTokenAmount + * @param minOGN Minimum OGN to receive for oTokenAmount * @param swapData 1inch Swap Data */ - function swapForOGV( + function swapForOGN( uint256 oTokenAmount, - uint256 minOGV, + uint256 minOGN, bytes calldata swapData ) external onlyGovernorOrStrategist nonReentrant { - (uint256 _amountForOGV, ) = _updateBuybackSplits(); - require(_amountForOGV >= oTokenAmount, "Balance underflow"); + (uint256 _amountForOGN, ) = _updateBuybackSplits(); + require(_amountForOGN >= oTokenAmount, "Balance underflow"); require(rewardsSource != address(0), "RewardsSource contract not set"); unchecked { // Subtract the amount to swap from net balance - balanceForOGV = _amountForOGV - oTokenAmount; + balanceForOGN = _amountForOGN - oTokenAmount; } - uint256 ogvReceived = _swapToken(ogv, oTokenAmount, minOGV, swapData); + uint256 ognReceived = _swapToken(ogn, oTokenAmount, minOGN, swapData); - // Transfer OGV received to RewardsSource contract + // Transfer OGN received to RewardsSource contract // slither-disable-next-line unchecked-transfer unused-return - IERC20(ogv).transfer(rewardsSource, ogvReceived); + IERC20(ogn).transfer(rewardsSource, ognReceived); } /** diff --git a/contracts/deploy/deployActions.js b/contracts/deploy/deployActions.js index f10d75d06d..2fafd7d8ee 100644 --- a/contracts/deploy/deployActions.js +++ b/contracts/deploy/deployActions.js @@ -1279,13 +1279,13 @@ const deployBuyback = async () => { const oethContractName = isMainnetOrFork ? "OETHBuyback" : "MockBuyback"; const dOUSDBuybackImpl = await deployWithConfirmation(ousdContractName, [ ousd.address, - assetAddresses.OGV, + assetAddresses.OGN, assetAddresses.CVX, assetAddresses.CVXLocker, ]); const dOETHBuybackImpl = await deployWithConfirmation(oethContractName, [ oeth.address, - assetAddresses.OGV, + assetAddresses.OGN, assetAddresses.CVX, assetAddresses.CVXLocker, ]); diff --git a/contracts/deploy/mainnet/095_ogn_buyback.js b/contracts/deploy/mainnet/095_ogn_buyback.js new file mode 100644 index 0000000000..10c1187ae0 --- /dev/null +++ b/contracts/deploy/mainnet/095_ogn_buyback.js @@ -0,0 +1,76 @@ +const { isFork } = require("../../test/helpers"); +const addresses = require("../../utils/addresses"); +const { + deploymentWithGovernanceProposal, + deployWithConfirmation, +} = require("../../utils/deploy"); + +module.exports = deploymentWithGovernanceProposal( + { + deployName: "095_ogn_buyback", + // forceSkip: true, + // onlyOnFork: true, // this is only executed in forked environment + reduceQueueTime: true, // just to solve the issue of later active proposals failing + proposalId: "", + }, + async ({ ethers }) => { + const cOETHBuybackProxy = await ethers.getContract("OETHBuybackProxy"); + const cOUSDBuybackProxy = await ethers.getContract("BuybackProxy"); + + const cSwapper = await ethers.getContract("Swapper1InchV5"); + + // Deploy new OETHBuyback implementation + const dOETHBuybackImpl = await deployWithConfirmation( + "OETHBuyback", + [ + addresses.mainnet.OETHProxy, + addresses.mainnet.OGN, + addresses.mainnet.CVX, + addresses.mainnet.CVXLocker, + ], + undefined, + true + ); + + // Deploy new OUSDBuyback implementation + const dOUSDBuybackImpl = await deployWithConfirmation( + "OUSDBuyback", + [ + addresses.mainnet.OUSDProxy, + addresses.mainnet.OGN, + addresses.mainnet.CVX, + addresses.mainnet.CVXLocker, + ], + undefined, + true + ); + + await cSwapper.approveAssets([addresses.mainnet.OGN]); + + if (!isFork) { + // No Governance action on mainnet + // To be upgraded with the proposal from `ousd-governance` repo + return { + actions: [], + }; + } + + return { + name: "Upgrade contracts for OGN Buyback", + actions: [ + // 1. Upgrade OUSD Buyback to new implementation + { + contract: cOUSDBuybackProxy, + signature: "upgradeTo(address)", + args: [dOUSDBuybackImpl.address], + }, + // 2. Upgrade OETH Buyback to new implementation + { + contract: cOETHBuybackProxy, + signature: "upgradeTo(address)", + args: [dOETHBuybackImpl.address], + }, + ], + }; + } +); diff --git a/contracts/test/buyback/buyback.fork-test.js b/contracts/test/buyback/buyback.fork-test.js index fea52ea691..cd604acd39 100644 --- a/contracts/test/buyback/buyback.fork-test.js +++ b/contracts/test/buyback/buyback.fork-test.js @@ -18,37 +18,41 @@ describe("ForkTest: OETH Buyback", function () { }); }); - it("Should swap OETH for OGV", async () => { - const { oethBuyback, oeth, oethVault, ogv, rewardsSource, strategist } = + it("Should swap OETH for OGN", async () => { + const { oethBuyback, oeth, oethVault, ogn, rewardsSource, strategist } = fixture; const oethBalanceBefore = await oeth.balanceOf(oethBuyback.address); - const ogvShareBefore = await oethBuyback.balanceForOGV(); + const ognShareBefore = await oethBuyback.balanceForOGN(); const cvxShareBefore = await oethBuyback.balanceForCVX(); - const rewardsBalanceBefore = await ogv.balanceOf(rewardsSource.address); + const rewardsBalanceBefore = await ogn.balanceOf(rewardsSource.address); + + const ognAmount = ognShareBefore.lte(oethUnits("1")) + ? ognShareBefore + : oethUnits("1"); let data = await getIInchSwapData({ vault: oethVault, fromAsset: oeth, - toAsset: ogv, - fromAmount: ogvShareBefore, - // 20%, just so that fork-tests don't fail on + toAsset: ogn, + fromAmount: ognAmount, + // 5%, just so that fork-tests don't fail on // CI randomly due to price volatility. - slippage: 20, + slippage: 5, }); data = await recodeSwapData(data); await oethBuyback .connect(strategist) - .swapForOGV(ogvShareBefore, oethUnits("100"), data); + .swapForOGN(ognAmount, oethUnits("100"), data); const oethBalanceAfter = await oeth.balanceOf(oethBuyback.address); - const ogvShareAfter = await oethBuyback.balanceForOGV(); + const ognShareAfter = await oethBuyback.balanceForOGN(); const cvxShareAfter = await oethBuyback.balanceForCVX(); - const rewardsBalanceAfter = await ogv.balanceOf(rewardsSource.address); + const rewardsBalanceAfter = await ogn.balanceOf(rewardsSource.address); - expect(ogvShareAfter).to.eq(0); - expect(oethBalanceAfter).to.eq(oethBalanceBefore.sub(ogvShareBefore)); + expect(ognShareAfter).to.eq(ognShareBefore.sub(ognAmount)); + expect(oethBalanceAfter).to.eq(oethBalanceBefore.sub(ognAmount)); expect(cvxShareAfter).to.eq(cvxShareBefore); expect(rewardsBalanceAfter).to.be.gt(rewardsBalanceBefore); }); @@ -58,7 +62,7 @@ describe("ForkTest: OETH Buyback", function () { fixture; const oethBalanceBefore = await oeth.balanceOf(oethBuyback.address); - const ogvShareBefore = await oethBuyback.balanceForOGV(); + const ognShareBefore = await oethBuyback.balanceForOGN(); const cvxShareBefore = await oethBuyback.balanceForCVX(); const strategistAddr = await strategist.getAddress(); const lockedCVXBalanceBefore = await cvxLocker.lockedBalanceOf( @@ -70,9 +74,9 @@ describe("ForkTest: OETH Buyback", function () { fromAsset: oeth, toAsset: cvx, fromAmount: cvxShareBefore, - // 20%, just so that fork-tests don't fail on + // 5%, just so that fork-tests don't fail on // CI randomly due to price volatility. - slippage: 20, + slippage: 5, }); data = await recodeSwapData(data); @@ -81,12 +85,12 @@ describe("ForkTest: OETH Buyback", function () { .swapForCVX(cvxShareBefore, oethUnits("1"), data); const oethBalanceAfter = await oeth.balanceOf(oethBuyback.address); - const ogvShareAfter = await oethBuyback.balanceForOGV(); + const ognShareAfter = await oethBuyback.balanceForOGN(); const cvxShareAfter = await oethBuyback.balanceForCVX(); expect(cvxShareAfter).to.eq(0); expect(oethBalanceAfter).to.eq(oethBalanceBefore.sub(cvxShareBefore)); - expect(ogvShareAfter).to.eq(ogvShareBefore); + expect(ognShareAfter).to.eq(ognShareBefore); expect(await cvxLocker.lockedBalanceOf(strategistAddr)).to.be.gte( lockedCVXBalanceBefore @@ -106,20 +110,20 @@ describe("ForkTest: OUSD Buyback", function () { }); }); - it("Should swap OUSD for OGV", async () => { - const { ousdBuyback, ousd, vault, ogv, rewardsSource, strategist } = + it("Should swap OUSD for OGN", async () => { + const { ousdBuyback, ousd, vault, ogn, rewardsSource, strategist } = fixture; const ousdBalanceBefore = await ousd.balanceOf(ousdBuyback.address); - const ogvShareBefore = await ousdBuyback.balanceForOGV(); + const ognShareBefore = await ousdBuyback.balanceForOGN(); const cvxShareBefore = await ousdBuyback.balanceForCVX(); - const rewardsBalanceBefore = await ogv.balanceOf(rewardsSource.address); + const rewardsBalanceBefore = await ogn.balanceOf(rewardsSource.address); let data = await getIInchSwapData({ vault: vault, fromAsset: ousd, - toAsset: ogv, - fromAmount: ogvShareBefore, + toAsset: ogn, + fromAmount: ognShareBefore, // 20%, just so that fork-tests don't fail on // CI randomly due to price volatility. slippage: 20, @@ -128,15 +132,15 @@ describe("ForkTest: OUSD Buyback", function () { await ousdBuyback .connect(strategist) - .swapForOGV(ogvShareBefore, ousdUnits("1"), data); + .swapForOGN(ognShareBefore, ousdUnits("1"), data); const ousdBalanceAfter = await ousd.balanceOf(ousdBuyback.address); - const ogvShareAfter = await ousdBuyback.balanceForOGV(); + const ognShareAfter = await ousdBuyback.balanceForOGN(); const cvxShareAfter = await ousdBuyback.balanceForCVX(); - const rewardsBalanceAfter = await ogv.balanceOf(rewardsSource.address); + const rewardsBalanceAfter = await ogn.balanceOf(rewardsSource.address); - expect(ogvShareAfter).to.eq(0); - expect(ousdBalanceAfter).to.eq(ousdBalanceBefore.sub(ogvShareBefore)); + expect(ognShareAfter).to.eq(0); + expect(ousdBalanceAfter).to.eq(ousdBalanceBefore.sub(ognShareBefore)); expect(cvxShareAfter).to.eq(cvxShareBefore); expect(rewardsBalanceAfter).to.be.gt(rewardsBalanceBefore); }); @@ -145,7 +149,7 @@ describe("ForkTest: OUSD Buyback", function () { const { ousdBuyback, ousd, vault, cvx, cvxLocker, strategist } = fixture; const ousdBalanceBefore = await ousd.balanceOf(ousdBuyback.address); - const ogvShareBefore = await ousdBuyback.balanceForOGV(); + const ognShareBefore = await ousdBuyback.balanceForOGN(); const cvxShareBefore = await ousdBuyback.balanceForCVX(); const strategistAddr = await strategist.getAddress(); const lockedCVXBalanceBefore = await cvxLocker.lockedBalanceOf( @@ -168,12 +172,12 @@ describe("ForkTest: OUSD Buyback", function () { .swapForCVX(cvxShareBefore, ousdUnits("0.01"), data); const ousdBalanceAfter = await ousd.balanceOf(ousdBuyback.address); - const ogvShareAfter = await ousdBuyback.balanceForOGV(); + const ognShareAfter = await ousdBuyback.balanceForOGN(); const cvxShareAfter = await ousdBuyback.balanceForCVX(); expect(cvxShareAfter).to.eq(0); expect(ousdBalanceAfter).to.eq(ousdBalanceBefore.sub(cvxShareBefore)); - expect(ogvShareAfter).to.eq(ogvShareBefore); + expect(ognShareAfter).to.eq(ognShareBefore); expect(await cvxLocker.lockedBalanceOf(strategistAddr)).to.be.gte( lockedCVXBalanceBefore diff --git a/contracts/test/buyback/buyback.js b/contracts/test/buyback/buyback.js index d039527969..38bb2aeb20 100644 --- a/contracts/test/buyback/buyback.js +++ b/contracts/test/buyback/buyback.js @@ -15,21 +15,21 @@ describe("Buyback", function () { fixture = await loadFixture(); }); - it("Should swap OETH for OGV", async () => { - const { oeth, ogv, oethBuyback, strategist, rewardsSource } = fixture; + it("Should swap OETH for OGN", async () => { + const { oeth, ogn, oethBuyback, strategist, rewardsSource } = fixture; await oethBuyback .connect(strategist) - .swapForOGV(oethUnits("1"), oethUnits("100000"), "0x00000000"); + .swapForOGN(oethUnits("1"), oethUnits("100000"), "0x00000000"); // Check balance after swap await expect(oethBuyback).to.have.a.balanceOf(oethUnits("2"), oeth); - expect(await oethBuyback.balanceForOGV()).to.equal(oethUnits("0.5")); + expect(await oethBuyback.balanceForOGN()).to.equal(oethUnits("0.5")); expect(await oethBuyback.balanceForCVX()).to.equal(oethUnits("1.5")); - // Ensure OGV went to RewardsSource contract - await expect(rewardsSource).to.have.balanceOf(oethUnits("100000"), ogv); + // Ensure OGN went to RewardsSource contract + await expect(rewardsSource).to.have.balanceOf(oethUnits("100000"), ogn); }); it("Should swap OETH for CVX", async () => { @@ -42,7 +42,7 @@ describe("Buyback", function () { // Check balance after swap await expect(oethBuyback).to.have.a.balanceOf(oethUnits("2"), oeth); - expect(await oethBuyback.balanceForOGV()).to.equal(oethUnits("1.5")); + expect(await oethBuyback.balanceForOGN()).to.equal(oethUnits("1.5")); expect(await oethBuyback.balanceForCVX()).to.equal(oethUnits("0.5")); @@ -53,21 +53,21 @@ describe("Buyback", function () { await expect(cvxLocker).to.have.balanceOf(oethUnits("100"), cvx); }); - it("Should swap OUSD for OGV", async () => { - const { ousd, ogv, ousdBuyback, strategist, rewardsSource } = fixture; + it("Should swap OUSD for OGN", async () => { + const { ousd, ogn, ousdBuyback, strategist, rewardsSource } = fixture; await ousdBuyback .connect(strategist) - .swapForOGV(ousdUnits("1250"), ousdUnits("100000"), "0x00000000"); + .swapForOGN(ousdUnits("1250"), ousdUnits("100000"), "0x00000000"); // Check balance after swap await expect(ousdBuyback).to.have.a.balanceOf(ousdUnits("1750"), ousd); - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("250")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("250")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); - // Ensure OGV went to RewardsSource contract - await expect(rewardsSource).to.have.balanceOf(ousdUnits("100000"), ogv); + // Ensure OGN went to RewardsSource contract + await expect(rewardsSource).to.have.balanceOf(ousdUnits("100000"), ogn); }); it("Should swap OUSD for CVX", async () => { @@ -80,7 +80,7 @@ describe("Buyback", function () { // Check balance after swap await expect(ousdBuyback).to.have.a.balanceOf(ousdUnits("2250"), ousd); - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("1500")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("1500")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("750")); @@ -91,13 +91,13 @@ describe("Buyback", function () { await expect(cvxLocker).to.have.balanceOf(ousdUnits("100"), cvx); }); - it("Should NOT swap OGV when called by someone else", async () => { + it("Should NOT swap OGN when called by someone else", async () => { const { anna, ousdBuyback } = fixture; const ousdAmount = ousdUnits("1000"); await expect( - ousdBuyback.connect(anna).swapForOGV(ousdAmount, 1, "0x00000000") + ousdBuyback.connect(anna).swapForOGN(ousdAmount, 1, "0x00000000") ).to.be.revertedWith("Caller is not the Strategist or Governor"); }); @@ -129,14 +129,14 @@ describe("Buyback", function () { const ousdAmount = ousdUnits("1000"); await expect( - ousdBuyback.connect(governor).swapForOGV(ousdAmount, 10, "0x00000000") + ousdBuyback.connect(governor).swapForOGN(ousdAmount, 10, "0x00000000") ).to.be.revertedWith("Swap Router not set"); }); it("Should NOT swap when min expected is zero", async () => { const { governor, ousdBuyback } = fixture; await expect( - ousdBuyback.connect(governor).swapForOGV(10, 0, "0x00000000") + ousdBuyback.connect(governor).swapForOGN(10, 0, "0x00000000") ).to.be.revertedWith("Invalid minAmount"); await expect( @@ -144,7 +144,7 @@ describe("Buyback", function () { ).to.be.revertedWith("Invalid minAmount"); }); - it("Should NOT swap OGV when RewardsSource isn't set", async () => { + it("Should NOT swap OGN when RewardsSource isn't set", async () => { const { governor, ousdBuyback } = fixture; // Set RewardsSource to zero @@ -155,17 +155,17 @@ describe("Buyback", function () { ); await expect( - ousdBuyback.connect(governor).swapForOGV(10, 10, "0x00000000") + ousdBuyback.connect(governor).swapForOGN(10, 10, "0x00000000") ).to.be.revertedWith("RewardsSource contract not set"); }); - it("Should NOT swap OGV/CVX when balance underflow", async () => { + it("Should NOT swap OGN/CVX when balance underflow", async () => { const { governor, ousdBuyback } = fixture; await expect( ousdBuyback .connect(governor) - .swapForOGV(ousdUnits("2000"), 10, "0x00000000") + .swapForOGN(ousdUnits("2000"), 10, "0x00000000") ).to.be.revertedWith("Balance underflow"); await expect( @@ -183,7 +183,7 @@ describe("Buyback", function () { await expect( ousdBuyback .connect(governor) - .swapForOGV(ousdUnits("100"), ousdUnits("1000"), "0x00000000") + .swapForOGN(ousdUnits("100"), ousdUnits("1000"), "0x00000000") ).to.be.revertedWith("Higher Slippage"); }); @@ -212,7 +212,7 @@ describe("Buyback", function () { }); it("Should revoke allowance on older Swap Router", async () => { - const { ousdBuyback, governor, mockSwapper, ousd, ogv, cvx } = fixture; + const { ousdBuyback, governor, mockSwapper, ousd, ogn, cvx } = fixture; const mockSigner = await impersonateAndFund(ousdBuyback.address); @@ -220,7 +220,7 @@ describe("Buyback", function () { .connect(mockSigner) .approve(mockSwapper.address, ousdUnits("10000")); - await ogv + await ogn .connect(mockSigner) .approve(mockSwapper.address, ousdUnits("12300")); @@ -231,7 +231,7 @@ describe("Buyback", function () { // Ensure allowance is removed expect( - await ogv.allowance(ousdBuyback.address, mockSwapper.address) + await ogn.allowance(ousdBuyback.address, mockSwapper.address) ).to.equal(0); expect( @@ -414,36 +414,36 @@ describe("Buyback", function () { const { ousdBuyback, ousd, josh, governor } = fixture; // Should have equal shares - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("1500")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("1500")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); - // Set OGV share to zero + // Set OGN share to zero await setStorageAt( ousdBuyback.address, "0x6e", "0x0000000000000000000000000000000000000000000000000000000000000000" ); - // Now contract has 1500 to be split between OGV and CVX + // Now contract has 1500 to be split between OGN and CVX await ousdBuyback.connect(governor).updateBuybackSplits(); // Ensure distribution - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("750")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("750")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("2250")); // When there's no unsplit balance, let it do its thing await ousdBuyback.connect(governor).updateBuybackSplits(); // Ensure no change distribution - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("750")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("750")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("2250")); // When there's only one wei extra await ousd.connect(josh).transfer(ousdBuyback.address, 1); await ousdBuyback.connect(governor).updateBuybackSplits(); - // Ensure OGV raised by 1 wei - expect(await ousdBuyback.balanceForOGV()).to.equal( + // Ensure OGN raised by 1 wei + expect(await ousdBuyback.balanceForOGN()).to.equal( ousdUnits("750").add("1") ); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("2250")); @@ -453,14 +453,14 @@ describe("Buyback", function () { const { ousdBuyback, ousd, josh, governor } = fixture; // Should have equal shares - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("1500")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("1500")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); expect( await ousdBuyback.connect(governor).setCVXShareBps(0) // 0% for CVX ); - // Set OGV share to zero (to mimic some unaccounted balance) + // Set OGN share to zero (to mimic some unaccounted balance) await setStorageAt( ousdBuyback.address, "0x6e", @@ -468,26 +468,26 @@ describe("Buyback", function () { ); // Now contract has 1500 unaccounted oToken - // and should allocate it all to OGV + // and should allocate it all to OGN await ousdBuyback.connect(governor).updateBuybackSplits(); // Ensure distribution - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("1500")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("1500")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); // When there's no unsplit balance, let it do its thing await ousdBuyback.connect(governor).updateBuybackSplits(); // Ensure no change distribution - expect(await ousdBuyback.balanceForOGV()).to.equal(ousdUnits("1500")); + expect(await ousdBuyback.balanceForOGN()).to.equal(ousdUnits("1500")); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); // When there's only one wei extra await ousd.connect(josh).transfer(ousdBuyback.address, 1); await ousdBuyback.connect(governor).updateBuybackSplits(); - // Ensure OGV raised by 1 wei - expect(await ousdBuyback.balanceForOGV()).to.equal( + // Ensure OGN raised by 1 wei + expect(await ousdBuyback.balanceForOGN()).to.equal( ousdUnits("1500").add("1") ); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("1500")); @@ -500,11 +500,11 @@ describe("Buyback", function () { ); // Now contract has 1500 unaccounted oToken - // and should allocate it all to OGV + // and should allocate it all to OGN await ousdBuyback.connect(governor).updateBuybackSplits(); // Ensure distribution - expect(await ousdBuyback.balanceForOGV()).to.equal( + expect(await ousdBuyback.balanceForOGN()).to.equal( ousdUnits("3000").add("1") ); expect(await ousdBuyback.balanceForCVX()).to.equal(ousdUnits("0"));