Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: BS3 UI + SDK #1052

Merged
merged 15 commits into from
Sep 20, 2024
Merged

[WIP]: BS3 UI + SDK #1052

merged 15 commits into from
Sep 20, 2024

Conversation

Space-Bean
Copy link
Contributor

@Space-Bean Space-Bean commented Aug 28, 2024

Base Branch for UI + SDK changes for BS3

Setup

  1. From the project root, run yarn to install all new dependencies
  2. From ./protocol
    • a: in Invariable.sol, comment out all function contents except for _; for all function modifiers
      • fundsSafu()
      • noNetFlow()
      • noOutFlow()
      • noSupplyChange()
      • noSupplyIncrease()
    • b: run yarn compile and yarn generate to generate

image

  1. From the project root, run yarn all:build
  2. From ./projects/ui, run yarn & yarn ui:generate. You may need to run yarn as well
  3. From ./projects/dex-ui, run yarn & yarn generate. You may need to run yarn as well
  4. From projects/cli
    • create a .env file. In the .env, input the same parameters shown in .env.example.
      • We will use this to run anvil. Unsure if we will keep this here, or move it somewhere else, but this is how it's been set up for now. If you need the api key, let me know. Whichever key you use, just make sure that this is the same api key that is in the UI .env & dex-ui .env
    • you may be using the cli, so run yarn cli:build
  5. in projects/ui, input the necessary .env vars. If you need info on what these are, let me know and I will get these to you.
  6. in projects/dex-ui, input the necessary .env vars. Same as above. There are changes here from the previous .env variables, so make sure to update them.

Local Forks + Running the UI Locally

  1. To run an arbitrum fork, run yarn anvil-arbitrum from the project root
  2. To run an eth-mainnet fork, run yarn anvil-eth-mainnet from the project root
  3. To deploy the reseed script for L1, in ./protocol, run npx hardhat reseedL1 --network localhostL1. This should be done relatively quickly.
  4. To deploy the reseed script for L2, in ./protocol, run npx hardhat reseedL2 --network localhost. This will take anywhere from 10-20 mins, depending on your machine.
  5. To run Basin locally,
    • in ./projects/dex-ui, run yarn dev. Make sure you've installed dependencies and have run yarn install
    • Access Basin via http://localhost:2424
    1. To run Bean-UI locally,
    • in ./projects/ui, run yarn dev. Make sure you've installed dependencies and have run yarn install
    • Access Basin via http://localhost:8888

Misc + CLI Usage

  • Normally, you should be able to force call sunrise via the cli, (yarn g:bean sunrise -f) or (npx hardhat sunrise2 --network localhost from ./protocol) but this is not currently working. Therefore, it is recommended to use a wallet that already has deposits, pods, etc..

  • You can set your balance via the cli: yarn g:bean setbalance -a <wallet-address> -t <token-symbol-caps> -m <amount>

    • a: If you don't provide an address, it will set those balances for the default test acc.
    • m: defaults to 50,000.
    • t: defaults to ETH + all ERC20 tokens. Only specify if you want only 1 token specifically.
      • options for -t:
        • ETH, WETH, WSTETH, WEETH, WBTC, DAI, USDC, USDT
        • unripe: urBEAN, urBEANWSTETH
        • lp: BEANWETH, BEANWSTETH, BEANWEETH, BEANWBTC, BEANUSDC, BEANUSDT
  • Note that other functions in the CLI have not been updated, namely

    • setPrice,
    • setDeltaB

Testing

Bean-UI

Nav Bar

  • Price Button
    - Price should load a non-zero value
    - In dropdown, Instantaneous values are non-zero
    - In dropdown, TWA values are non-zero
  • Season Button
    • Season should load a non-zero value
      • SeasonsTable
        1. Next Season Forecast should have accurate values
        2. Seasons from the previous seasons should be displayed
  • Wallet Button
    • Ensure wallet connection Interactions are as expected & stable
  • Network Button
    • Ensure you can switch between networks w/ minimal Issues. There are times when requests get cut short b/c the chain-Id changes, but this should generally not be a problem.
    • Ensure you see all 4 networks (If Testnet Is available, 5).

Forecast Page

  • The following charts should load with L1 data:
    1. Price
    2. Pod Rate
    3. Liquidity
    4. MarketCap
  • Values for Bean Supply Pie chart should
    1. have non-zero values
    2. should break down properly w/ accurate data.
  • Stalk, Pods, and Sprout amounts should be similar to what Is on L1

Silo Page

  • Farmer Silo Chart
    • Ensure Deposits, Stalk, and Seeds data load properly (This should be coming from the L1 subgraph)
  • Rewards Bar
    • Ensure any claimable / plantable / enroot-able assets are accurately shown
    • Ensure you can claim, plant, and enroot, and mow as separate transactions
    • Ensure you can do the above In a single transaction.
  • Seed Gauge Details
    • Target Seasons To Catch Up Chart should render w/ data
    • Bean2MaxLPRatio
      • Ensure the MaxLP token Is the correct MaxLP token
      • Ensure that Inc/dec of the Bean2MaxLP scalar Is accurately depicted
      • Ensure the Inc/dec of Bean2MaxLP scalar Is correct
      • We should check the different cases here:
        • P > Q
        • P > 1
        • P < 1
    • Optimal Distribution of LP
      • Shows accurate data related to each LP token
      • Shows accurate expected Seed reward Inc/dec for the following season

Silo Token Page

  • Deposits
    • Amount shown under My Deposited {symbol} is correct
    • Ensure USD value of the above Is a non-zero value
    • Deposits Table
      • Ensure Each deposit entry accurately shows deposit data
  • Rewards
    • Ensure Stalk & Seed rewards for the whitelisted token are correct
    • Ensure links work
  • About Token
    • Ensure correct token address
    • Ensure Total value Deposited Is accurate
    • Ensure % of all value deposited In the Silo Is accurate
  • Transfer Deposits
    • Ensure deposit data Is correct
    • Ensure (Max) on the Transfer module on the left is equal to the sum of the deposit's amounts selected
    • Successfully transfers deposits
    • Transfers only selected deposits (If more than 1 selected)
    • Table data updates & form resets upon txn

UI - Broken

  • all analytics data is currently using the eth-mainnet subgraphs
  • Any price related data
  • Any Seed gauge related data
  • Any season related data
  • Interactions w/ the silo (except for depositing via whitelisted tokens)
  • Field will show as 0 soil
  • Barn. Will not be able to purchase fertilizer until price contract is working
  • Swaps are not yet available
  • Any seeds related features
  • grown stalk balances
  • lambda2lambda (table data is incorrect)

UI - Not available

  • lambda2lambda (contract integrations)
  • anti-lambda2lambda
  • swaps
  • gen-convert
  • tractor
  • silo deposit w/ non-whitelist token

Basin

L2

  • url/wells (Nav bar Liquidity)

    • View Wells
      • All wells should show up w/ expected values
      • Price should populate (once price contract debugging is complete)
      • Correct well Function names should show
    • My positions
      • Positions for each well should populate
  • url/wells/token

  • Switching networks doesn't cause the app to crash

  • All Well data should populate

  • Contract data should be up to date

  • Should be able to remove / add liquidity

  • Should be able to utilize create well flow.

  • swaps w/ 0 hops should work.

Basin - Broken

  • Swaps that require a hop
  • BEAN price not available.

Base automatically changed from reseed-misc to dr-t-remediations September 4, 2024 15:59
@Space-Bean Space-Bean changed the base branch from dr-t-remediations to reseed-final-fixes September 13, 2024 17:40
@Space-Bean Space-Bean changed the base branch from reseed-final-fixes to reseed-testnet-deployment September 19, 2024 18:32
@Brean0 Brean0 merged commit 6a8c6a8 into reseed-testnet-deployment Sep 20, 2024
3 of 4 checks passed
@Brean0 Brean0 deleted the beanstalk3-ui-sdks branch September 20, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants