From 4e319bfffe85550139145e60604381819b8df236 Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Mon, 16 Oct 2023 15:10:01 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20vote:=20get=20power=20from=20beefy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/real-dolls-shout.md | 5 + .gas-snapshot | 2 +- contracts/periphery/VotePreviewer.sol | 27 ++- deploy/Previewers.ts | 9 +- deployments/optimism/BeefyEXA.json | 259 +++++++++++++++++++++ deployments/optimism/BeefyEXABoost.json | 296 ++++++++++++++++++++++++ test/VotePreviewer.t.sol | 13 +- 7 files changed, 606 insertions(+), 5 deletions(-) create mode 100644 .changeset/real-dolls-shout.md create mode 100644 deployments/optimism/BeefyEXA.json create mode 100644 deployments/optimism/BeefyEXABoost.json diff --git a/.changeset/real-dolls-shout.md b/.changeset/real-dolls-shout.md new file mode 100644 index 000000000..56aa0205a --- /dev/null +++ b/.changeset/real-dolls-shout.md @@ -0,0 +1,5 @@ +--- +"@exactly/protocol": patch +--- + +✨ vote: get power from beefy diff --git a/.gas-snapshot b/.gas-snapshot index 98648f3af..30a9b50a4 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -401,4 +401,4 @@ SwapperTest:testSwapWithKeepEqualToValue() (gas: 41783) SwapperTest:testSwapWithKeepHigherThanValue() (gas: 41804) SwapperTest:testSwapWithPermit() (gas: 566299) SwapperTest:testSwapWithPermit2() (gas: 560666) -VotePreviewerTest:testExternalVotes() (gas: 97572) \ No newline at end of file +VotePreviewerTest:testExternalVotes() (gas: 243041) \ No newline at end of file diff --git a/contracts/periphery/VotePreviewer.sol b/contracts/periphery/VotePreviewer.sol index 47300a3e6..36790259b 100644 --- a/contracts/periphery/VotePreviewer.sol +++ b/contracts/periphery/VotePreviewer.sol @@ -16,23 +16,44 @@ contract VotePreviewer { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable IERC20 public immutable gauge; /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + IBeefyVault public immutable beefyVault; + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable + IERC20 public immutable beefyBoost; + /// @custom:oz-upgrades-unsafe-allow state-variable-immutable IExtraLending public immutable extraLending; /// @custom:oz-upgrades-unsafe-allow state-variable-immutable uint256 public immutable extraReserveId; /// @custom:oz-upgrades-unsafe-allow constructor - constructor(address exa_, IPool pool_, IERC20 gauge_, IExtraLending extraLending_, uint256 extraReserveId_) { + constructor( + address exa_, + IPool pool_, + IERC20 gauge_, + IBeefyVault beefyVault_, + IERC20 beefyBoost_, + IExtraLending extraLending_, + uint256 extraReserveId_ + ) { exa = exa_; pool = pool_; gauge = gauge_; + beefyVault = beefyVault_; + beefyBoost = beefyBoost_; extraLending = extraLending_; extraReserveId = extraReserveId_; } function externalVotes(address account) external view returns (uint256 votes) { + // velodrome uint256 liquidity = pool.balanceOf(account) + gauge.balanceOf(account); votes += liquidity.mulDivDown(exa == pool.token0() ? pool.reserve0() : pool.reserve1(), pool.totalSupply()); + // beefy + votes += beefyVault.getPricePerFullShare().mulWadDown( + beefyVault.balanceOf(account) + beefyBoost.balanceOf(account) + ); + + // extra uint256[] memory reserveIds = new uint256[](1); reserveIds[0] = extraReserveId; IExtraLending.PositionStatus[] memory e = extraLending.getPositionStatus(reserveIds, account); @@ -48,6 +69,10 @@ interface IPool is IERC20 { function reserve1() external view returns (uint256); } +interface IBeefyVault is IERC20 { + function getPricePerFullShare() external view returns (uint256); +} + interface IExtraLending { struct PositionStatus { uint256 reserveId; diff --git a/deploy/Previewers.ts b/deploy/Previewers.ts index e91aa6595..06135118e 100644 --- a/deploy/Previewers.ts +++ b/deploy/Previewers.ts @@ -19,6 +19,8 @@ const func: DeployFunction = async ({ { address: exa }, { address: exaPool }, { address: exaGauge }, + { address: beefyEXA }, + { address: beefyEXABoost }, { address: priceFeedETH }, { address: extraLending }, { deployer }, @@ -28,6 +30,8 @@ const func: DeployFunction = async ({ get("EXA"), getOrNull("EXAPool").then((d) => d ?? { address: AddressZero }), getOrNull("EXAGauge").then((d) => d ?? { address: AddressZero }), + getOrNull("BeefyEXA").then((d) => d ?? { address: AddressZero }), + getOrNull("BeefyEXABoost").then((d) => d ?? { address: AddressZero }), getOrNull("PriceFeedETH").then((d) => d ?? { address: AddressZero }), getOrNull("ExtraLending").then((d) => d ?? { address: AddressZero }), getNamedAccounts(), @@ -47,7 +51,10 @@ const func: DeployFunction = async ({ if (periphery.extraReserve == null) return; await validateUpgrade( "VotePreviewer", - { args: [exa, exaPool, exaGauge, extraLending, periphery.extraReserve], envKey: "VOTE_PREVIEWER" }, + { + args: [exa, exaPool, exaGauge, beefyEXA, beefyEXABoost, extraLending, periphery.extraReserve], + envKey: "VOTE_PREVIEWER", + }, async (name, opts) => deploy(name, { ...opts, proxy: { proxyContract: "TransparentUpgradeableProxy" }, from: deployer, log: true }), ); diff --git a/deployments/optimism/BeefyEXA.json b/deployments/optimism/BeefyEXA.json new file mode 100644 index 000000000..aba3da4ba --- /dev/null +++ b/deployments/optimism/BeefyEXA.json @@ -0,0 +1,259 @@ +{ + "address": "0xdD84190aF336Ee2831eea88B6783958e8F269de9", + "abi": [ + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "implementation", "type": "address" }], + "name": "NewStratCandidate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "implementation", "type": "address" }], + "name": "UpgradeStrat", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approvalDelay", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "available", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "balance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "depositAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { "inputs": [], "name": "earn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "getPricePerFullShare", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }], + "name": "inCaseTokensGetStuck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract IStrategyV7", "name": "_strategy", "type": "address" }, + { "internalType": "string", "name": "_name", "type": "string" }, + { "internalType": "string", "name": "_symbol", "type": "string" }, + { "internalType": "uint256", "name": "_approvalDelay", "type": "uint256" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_implementation", "type": "address" }], + "name": "proposeStrat", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "stratCandidate", + "outputs": [ + { "internalType": "address", "name": "implementation", "type": "address" }, + { "internalType": "uint256", "name": "proposedTime", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "strategy", + "outputs": [{ "internalType": "contract IStrategyV7", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "upgradeStrat", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "want", + "outputs": [{ "internalType": "contract IERC20Upgradeable", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_shares", "type": "uint256" }], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "withdrawAll", "outputs": [], "stateMutability": "nonpayable", "type": "function" } + ] +} diff --git a/deployments/optimism/BeefyEXABoost.json b/deployments/optimism/BeefyEXABoost.json new file mode 100644 index 000000000..47c6e2933 --- /dev/null +++ b/deployments/optimism/BeefyEXABoost.json @@ -0,0 +1,296 @@ +{ + "address": "0xd50f954e456d1eb53AE9C44860db99c6cDDa78cb", + "abi": [ + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" }], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } + ], + "name": "RewardPaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Staked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "closePreStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "duration", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "earned", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "exit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { "inputs": [], "name": "getReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "_token", "type": "address" }], + "name": "inCaseTokensGetStuck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_token", "type": "address" }, + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "inCaseTokensGetStuck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_stakedToken", "type": "address" }, + { "internalType": "address", "name": "_rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "_duration", "type": "uint256" }, + { "internalType": "address", "name": "_manager", "type": "address" }, + { "internalType": "address", "name": "_treasury", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isPreStake", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastTimeRewardApplicable", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastUpdateTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "notifiers", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "notifyAlreadySent", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "notifyAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "openPreStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "periodFinish", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "rewardBalance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardPerToken", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardPerTokenStored", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "rewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_notifier", "type": "address" }, + { "internalType": "bool", "name": "_enable", "type": "bool" } + ], + "name": "setNotifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_duration", "type": "uint256" }], + "name": "setRewardDuration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_treasury", "type": "address" }], + "name": "setTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_fee", "type": "uint256" }], + "name": "setTreasuryFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakedToken", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryFee", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userRewardPerTokenPaid", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/test/VotePreviewer.t.sol b/test/VotePreviewer.t.sol index 51c209ff8..56563091c 100644 --- a/test/VotePreviewer.t.sol +++ b/test/VotePreviewer.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.17; import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import { FixedPointMathLib } from "solmate/src/utils/FixedPointMathLib.sol"; -import { VotePreviewer, IERC20, IPool, IExtraLending } from "../contracts/periphery/VotePreviewer.sol"; +import { VotePreviewer, IERC20, IPool, IBeefyVault, IExtraLending } from "../contracts/periphery/VotePreviewer.sol"; import { ForkTest } from "./Fork.t.sol"; contract VotePreviewerTest is ForkTest { @@ -12,6 +12,8 @@ contract VotePreviewerTest is ForkTest { address internal exa; IPool internal pool; IERC20 internal gauge; + IBeefyVault internal beefyVault; + IERC20 internal beefyBoost; IExtraLending internal extraLending; VotePreviewer internal previewer; @@ -21,13 +23,20 @@ contract VotePreviewerTest is ForkTest { exa = deployment("EXA"); pool = IPool(deployment("EXAPool")); gauge = IERC20(deployment("EXAGauge")); + beefyVault = IBeefyVault(deployment("BeefyEXA")); + beefyBoost = IERC20(deployment("BeefyEXABoost")); extraLending = IExtraLending(deployment("ExtraLending")); previewer = VotePreviewer( - address(new ERC1967Proxy(address(new VotePreviewer(exa, pool, gauge, extraLending, 50)), "")) + address( + new ERC1967Proxy(address(new VotePreviewer(exa, pool, gauge, beefyVault, beefyBoost, extraLending, 50)), "") + ) ); + vm.label(address(previewer), "VotePreviewer"); } function testExternalVotes() external { assertEq(previewer.externalVotes(0x23fD464e0b0eE21cEdEb929B19CABF9bD5215019), 27401932247383718289362); + assertEq(previewer.externalVotes(0x1283D47A121f903D9BD73f0f8E83728c488969f5), 1559177426053281144); + assertEq(previewer.externalVotes(0x4cd45E3Fef61079Ee67cbB9e9e230641A4Ae2f87), 368157682632212466); } }