Beanstalk icon indicating copy to clipboard operation
Beanstalk copied to clipboard

Static convert estimate

Open silochad opened this issue 1 year ago • 0 comments

In this PR I attempt to refactor a few pieces of the Convert form & related components

Things are horribly tangled:

  • Three number libraries (BigNumber.js, ethers.BigNumber, TokenValue)
  • Three locations for convert logic (UI using BigNumber.js, UI using TokenValue inside FarmStep classes, SDK using TokenValue)

This successfully performs a static estimate of the convert when running the FarmStep, but the SDK doesn't expose a way to calculate the grown stalk given a season and token amount, so I paused implementing.

This also partially refactors the Convert form to move the handleQuote function into the form component so that it can update state variables like staticData.

silochad avatar Jun 14 '23 17:06 silochad