Skip to content

Commit

Permalink
BIP–48: Whitelist BEANwstETH and Migrate Unripe Liquidity (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Jul 26, 2024
2 parents 0204c71 + af78b9a commit 1b456b2
Show file tree
Hide file tree
Showing 198 changed files with 6,708 additions and 2,667 deletions.
6 changes: 4 additions & 2 deletions projects/cli/src/commands/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { table } from "table";

export const balance = async (sdk, { account, symbol }) => {
console.log(`${chalk.bold.whiteBright("Account:")} ${chalk.greenBright(account)}`);
let res = [[chalk.bold("Token"), chalk.bold("Internal"), chalk.bold("External"), chalk.bold("Total")]];
let res = [
[chalk.bold("Token"), chalk.bold("Internal"), chalk.bold("External"), chalk.bold("Total")]
];

if (symbol) {
res.push(await getBal(sdk, symbol, account));
Expand All @@ -18,7 +20,7 @@ export const balance = async (sdk, { account, symbol }) => {
"DAI",
"CRV3",
"UNRIPE_BEAN",
"UNRIPE_BEAN_WETH",
"UNRIPE_BEAN_wstETH",
"BEAN_CRV3_LP",
"BEAN_ETH_WELL_LP",
"ROOT"
Expand Down
21 changes: 18 additions & 3 deletions projects/cli/src/commands/setbalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,30 @@ export const setbalance = async (sdk, chain, { account, symbol, amount }) => {
if (!symbol) {
await chain.setAllBalances(account, amount);
} else {
const symbols = ["ETH", "WETH", "BEAN", "USDT", "USDC", "DAI", "CRV3", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "ROOT"];
const symbols = [
"ETH",
"WETH",
"BEAN",
"USDT",
"USDC",
"DAI",
"CRV3",
"BEAN3CRV",
"BEANWETH",
"urBEAN",
"urBEANwstETH",
"ROOT"
];
if (!symbols.includes(symbol)) {
console.log(`${chalk.bold.red("Error")} - ${chalk.bold.white(symbol)} is not a valid token. Valid options are: `);
console.log(
`${chalk.bold.red("Error")} - ${chalk.bold.white(symbol)} is not a valid token. Valid options are: `
);
console.log(symbols.map((s) => chalk.green(s)).join(", "));
process.exit(-1);
}
let t = sdk.tokens[symbol] as Token;
if (symbol === "urBEAN") t = sdk.tokens.UNRIPE_BEAN;
if (symbol === "urBEANWETH") t = sdk.tokens.UNRIPE_BEAN_WETH;
if (symbol === "urBEANwstETH") t = sdk.tokens.UNRIPE_BEAN_WSTETH;
if (symbol === "BEAN3CRV") t = sdk.tokens.BEAN_CRV3_LP;
if (symbol === "BEANWETH") t = sdk.tokens.BEAN_ETH_WELL_LP;
if (typeof chain[`set${symbol}Balance`] !== "function")
Expand Down
5 changes: 4 additions & 1 deletion projects/cli/src/commands/sunrise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const sunrise = async (sdk, chain, { force }) => {
}

await callSunrise(sdk);
await sdk.provider.send("evm_mine", []);

if (diff > 1) {
console.log(`You are still behind by ${diff - 1} seasons. May need to call it again.`);
Expand All @@ -27,7 +28,9 @@ async function callSunrise(sdk: BeanstalkSDK) {
const res = await sdk.contracts.beanstalk.sunrise();
await res.wait();
const season = await sdk.contracts.beanstalk.season();
console.log(`${chalk.bold.greenBright("sunrise()")} called. New season is ${chalk.bold.yellowBright(season)}`);
console.log(
`${chalk.bold.greenBright("sunrise()")} called. New season is ${chalk.bold.yellowBright(season)}`
);
} catch (err: any) {
console.log(`sunrise() call failed: ${err.reason}`);
}
Expand Down
8 changes: 8 additions & 0 deletions projects/dex-ui/src/assets/images/tokens/BEANwstETHCP2w.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions projects/dex-ui/src/assets/images/tokens/wstETH.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useMemo } from "react";
import BeanstalkFarmsLogo from "src/assets/images/beanstalk-farms.png";
import HalbornLogo from "src/assets/images/halborn-logo.png";
import {
MULTI_FLOW_PUMP_ADDRESS,
CONSTANT_PRODUCT_2_ADDRESS,
WELL_DOT_SOL_ADDRESS,
toAddressMap
toAddressMap,
MULTI_FLOW_PUMP_V_1PT1_ADDRESS,
CONSTANT_PRODUCT_2_V2_ADDRESS
} from "src/utils/addresses";
import BrendanTwitterPFP from "src/assets/images/brendan-twitter-pfp.png";
import CyrfinLogo from "src/assets/images/cyrfin-logo.svg";
Expand Down Expand Up @@ -110,10 +110,10 @@ const WellDotSol: WellComponentInfo = {
};

const MultiFlowPump: WellComponentInfo = {
address: MULTI_FLOW_PUMP_ADDRESS,
address: MULTI_FLOW_PUMP_V_1PT1_ADDRESS,
component: {
name: "Multi Flow",
fullName: "Multi Flow Pump",
fullName: "Multi Flow Pump V1.1",
summary: "An inter-block MEV manipulation resistant oracle implementation.",
description: [
"Comprehensive multi-block MEV manipulation-resistant oracle implementation which serves up Well pricing data with an EMA for instantaneous prices and a TWAP for weighted averages over time."
Expand All @@ -136,14 +136,14 @@ const MultiFlowPump: WellComponentInfo = {
{ label: "Audited by", value: basinAuditInfo }
],
links: {
etherscan: `https://etherscan.io/address/${MULTI_FLOW_PUMP_ADDRESS}`,
etherscan: `https://etherscan.io/address/${MULTI_FLOW_PUMP_V_1PT1_ADDRESS}`,
github: "https://github.com/BeanstalkFarms/Basin/blob/master/src/pumps/MultiFlowPump.sol",
learnMore: "https://github.com/BeanstalkFarms/Basin/blob/master/src/pumps/MultiFlowPump.sol"
}
};

const ConstantProduct2: WellComponentInfo = {
address: CONSTANT_PRODUCT_2_ADDRESS,
address: CONSTANT_PRODUCT_2_V2_ADDRESS,
component: {
name: "Constant Product 2",
summary: "A standard x*y = k token pricing function for two tokens.",
Expand All @@ -162,7 +162,7 @@ const ConstantProduct2: WellComponentInfo = {
{ label: "Audited by", value: basinAuditInfo }
],
links: {
etherscan: `https://etherscan.io/address/${CONSTANT_PRODUCT_2_ADDRESS}`,
etherscan: `https://etherscan.io/address/${CONSTANT_PRODUCT_2_V2_ADDRESS}`,
github:
"https://github.com/BeanstalkFarms/Basin/blob/master/src/functions/ConstantProduct2.sol",
learnMore:
Expand Down
Loading

0 comments on commit 1b456b2

Please sign in to comment.