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]); 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]);