Skip to content

Commit

Permalink
Merge branch 'bip39-seedGauge' into bip39-seedGauge-remediations
Browse files Browse the repository at this point in the history
  • Loading branch information
Brean0 committed Apr 8, 2024
2 parents f0d0cea + 67ae965 commit c7e118c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 2 additions & 0 deletions protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ The Beanstalk contract is a multi-facet proxy that implements [EIP-2535](https:/
- You'll know you've installed nodejs right if you can run `node --version`and get an ouput like: `vx.x.x`
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/)
- You'll know you've installed yarn right if you can run `yarn --version` And get an output like: `x.x.x`
- Rosetta (Apple Silicon)
- You'll know you've installed Rosetta right if you can execute the solc 0.7.6 binary `.../solc-macosx-amd64-v0.7.6+commit.7338295f --version`

## Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pragma solidity =0.7.6;
pragma experimental ABIEncoderV2;

import {AppStorage, Storage, Account} from "contracts/beanstalk/AppStorage.sol";
import {LibBeanMetaCurve} from "contracts/libraries/Curve/LibBeanMetaCurve.sol";
import {LibLegacyTokenSilo} from "contracts/libraries/Silo/LibLegacyTokenSilo.sol";
import {LibSafeMath128} from "contracts/libraries/LibSafeMath128.sol";
import {LibGerminate} from "contracts/libraries/Silo/LibGerminate.sol";
Expand Down Expand Up @@ -148,7 +149,12 @@ contract SiloGettersFacet is ReentrancyGuard {
view
returns (uint256 _bdv)
{
_bdv = LibTokenSilo.beanDenominatedValue(token, amount);
// future dewhitelisted tokens should be added here.
if(token == C.CURVE_BEAN_METAPOOL) {
return LibBeanMetaCurve.bdv(amount);
} else {
return LibTokenSilo.beanDenominatedValue(token, amount);
}
}

//////////////////////// UTILTIES ////////////////////////
Expand Down
24 changes: 22 additions & 2 deletions protocol/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const {
mintEth,
getBeanstalk
} = require("./utils");
const { BEANSTALK, PUBLIUS, BEAN_3_CURVE, BEAN_ETH_WELL, UNRIPE_BEAN } = require("./test/utils/constants.js");
const { BEANSTALK, PUBLIUS, BEAN_3_CURVE, PRICE } = require("./test/utils/constants.js");
const { deployContract } = require("./scripts/contracts.js")
const { to6 } = require("./test/utils/helpers.js");
//const { replant } = require("./replant/replant.js")
const { task } = require("hardhat/config");
Expand Down Expand Up @@ -181,6 +182,22 @@ task("diamondABI", "Generates ABI file for diamond, includes all ABIs of facets"
console.log("ABI written to abi/Beanstalk.json");
});

task("deployBeanstalkPrice", async function () {
let json = fs.readFileSync(`./artifacts/contracts/ecosystem/price/BeanstalkPrice.sol/BeanstalkPrice.json`);
await network.provider.send("hardhat_setCode", [
PRICE,
JSON.parse(json).deployedBytecode,
]);
priceContract = await ethers.getContractAt('BeanstalkPrice', PRICE)
console.log("BeanstalkPrice deployed at: ", priceContract.address)
});

task("testPrice", async function () {
priceContract = await ethers.getContractAt('BeanstalkPrice', PRICE)
console.log("Price: ", (await priceContract.price()).toString())
});

// BIP //
task("marketplace", async function () {
const owner = await impersonateBeanstalkOwner();
await mintEth(owner.address);
Expand Down Expand Up @@ -220,10 +237,13 @@ task("beanstalkAdmin", async function () {
await mockBeanstalkAdmin();
});

task("deployBip39", async function () {
task("deploySeedGauge", async function () {
await bipSeedGauge();
});


/// EBIPS ///

task("ebip14", async function () {
await ebip14();
})
Expand Down

0 comments on commit c7e118c

Please sign in to comment.