From 2055385402fa1b7c1d375b26b45a3d97a6f1e621 Mon Sep 17 00:00:00 2001 From: Brean0 Date: Sun, 22 Sep 2024 13:08:01 -0500 Subject: [PATCH 1/2] update comments in LibWellMinting and update price contract. --- protocol/contracts/ecosystem/price/WellPrice.sol | 2 +- protocol/contracts/libraries/Minting/LibWellMinting.sol | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/protocol/contracts/ecosystem/price/WellPrice.sol b/protocol/contracts/ecosystem/price/WellPrice.sol index f94e07335..40ef455af 100644 --- a/protocol/contracts/ecosystem/price/WellPrice.sol +++ b/protocol/contracts/ecosystem/price/WellPrice.sol @@ -61,7 +61,7 @@ contract WellPrice { pool.tokens = [address(wellTokens[0]), address(wellTokens[1])]; uint256[] memory wellBalances = well.getReserves(); - pool.balances = [wellBalances[0], wellBalances[1]]; + if (wellBalances[0] == 0 || wellBalances[1] == 0) return pool; uint256 beanIndex = beanstalk.getBeanIndex(wellTokens); uint256 tknIndex = beanIndex == 0 ? 1 : 0; diff --git a/protocol/contracts/libraries/Minting/LibWellMinting.sol b/protocol/contracts/libraries/Minting/LibWellMinting.sol index 50f8f5d20..4005b19a9 100644 --- a/protocol/contracts/libraries/Minting/LibWellMinting.sol +++ b/protocol/contracts/libraries/Minting/LibWellMinting.sol @@ -120,11 +120,10 @@ library LibWellMinting { lastSnapshot ); - // Set the Well reserves in storage, so that it can be read when - // 1) set the USD price of the non bean token so that it can be read when - // calculating the price of Bean. See {LibEvaluate.evalPrice}. - // 2) When calculating the Bean reward for calling the Season (Bean:Eth Only). - // See {LibIncentive.determineReward}. + // Set the Well reserves in storage, so that it can be read when calculating the + // twa liquidty of the well when calculating the L2SR. + // set the USD price of the non bean token so that it can be read when + // calculating the price of Bean. See {LibEvaluate.evalPrice}. LibWell.setTwaReservesForWell(well, twaReserves); LibWell.setUsdTokenPriceForWell(well, ratios); emit WellOracle(s.sys.season.current, well, deltaB, s.sys.wellOracleSnapshots[well]); From cd0bed62bb7618ebf16bdc86c222cfe3334aee64 Mon Sep 17 00:00:00 2001 From: Brean0 Date: Sun, 22 Sep 2024 13:49:40 -0500 Subject: [PATCH 2/2] remove parameter. --- protocol/scripts/impersonate.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/protocol/scripts/impersonate.js b/protocol/scripts/impersonate.js index 672014ed1..1fcfb9332 100644 --- a/protocol/scripts/impersonate.js +++ b/protocol/scripts/impersonate.js @@ -148,9 +148,7 @@ async function impersonateContractOnPath(artifactPath, deployAddress) { } async function impersonateContract(contractName, deployAddress) { - contract = await ( - await ethers.getContractFactory(contractName) - ).deploy("0xD1A0060ba708BC4BCD3DA6C37EFa8deDF015FB70"); + contract = await await ethers.getContractFactory(contractName); await contract.deployed(); const bytecode = await ethers.provider.getCode(contract.address); await network.provider.send("hardhat_setCode", [deployAddress, bytecode]);