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

BIP-50: Reseed Beanstalk #909

Merged
merged 2,253 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
2253 commits
Select commit Hold shift + click to select a range
712c367
feat: return pipe calls from quote
Space-Bean Sep 23, 2024
cbd6571
feat: update pipelineconvert + basinWell sdk
Space-Bean Sep 23, 2024
5dc7859
feat: update sdk pools
Space-Bean Sep 23, 2024
33c3454
fix pipe convert in UI
Space-Bean Sep 23, 2024
9862d19
feat: remove pipeline convert class from ui
Space-Bean Sep 23, 2024
50692ad
feat: pipeconvert integration finish
Space-Bean Sep 23, 2024
1bf7494
[WIP]: Converts (#1108)
Space-Bean Sep 23, 2024
df10214
Add a low liquidity convert test (#1112)
Brean0 Sep 23, 2024
d1ebf4e
Reseed testnet deployment (#1110)
Brean0 Sep 23, 2024
c3406d3
Dr-t-Remediations (#1056)
Brean0 Sep 23, 2024
312e363
DR remediations (#1047)
Brean0 Sep 23, 2024
811c93d
Beanstalk3 codehawks remediations (#980)
Brean0 Sep 23, 2024
65428ba
Beanstalk3 remediations (#970)
Brean0 Sep 23, 2024
9de7d79
feat: update deposit convert table
Space-Bean Sep 23, 2024
d0234b3
feat: add console log messages
Space-Bean Sep 23, 2024
17a15ca
Spaebean/bs3/UI updates (#1113)
Space-Bean Sep 23, 2024
bfd2c9a
feat: fix infinite loop
Space-Bean Sep 23, 2024
2c854dd
reduce bean reward to 1 Bean.
Brean0 Sep 23, 2024
f4b9e60
update reseed jsons.
Brean0 Sep 23, 2024
470204c
feat: add debug info
Space-Bean Sep 23, 2024
32ed1ad
Merge remote-tracking branch 'origin/beanstalk-3' into beanstalk-3
Brean0 Sep 24, 2024
a93b502
Test for lp to lp convert using live data
pizzaman1337 Sep 24, 2024
a3059ea
modify emitting of event
nickkatsios Sep 24, 2024
91019ed
refactor reseed script to not deploy any diamond contracts
nickkatsios Sep 24, 2024
4b30544
add comment.
Brean0 Sep 24, 2024
83985ea
Test LP to LP convert using live data (#1114)
Brean0 Sep 24, 2024
665db92
revert sunrise.
Brean0 Sep 24, 2024
e0775d1
Merge branch 'reentrant-guard-pipeline' into beanstalk-3
Brean0 Sep 24, 2024
c3b379f
Merge branch 'beanstalk-3' into diamond-deployment-redisign
Brean0 Sep 24, 2024
594fc83
update hardhat config
nickkatsios Sep 24, 2024
1f1926b
update MigratedAccountStatus event
nickkatsios Sep 24, 2024
1cf59e7
feat: update lambda convert ui
Space-Bean Sep 24, 2024
e31a666
prettier auto formatting changes
nickkatsios Sep 24, 2024
b712b15
fix edge case by returning gracefully.
Brean0 Sep 24, 2024
fa3166a
feat: update l2l converts
Space-Bean Sep 24, 2024
52c2d2e
feat: update token deposits context
Space-Bean Sep 24, 2024
372aef0
feat: fix l2l conv
Space-Bean Sep 24, 2024
aeac7f6
Merge branch 'beanstalk-3' into spacebean/bs3/l2l-convert
Space-Bean Sep 24, 2024
691394f
L2L convert (#1117)
Space-Bean Sep 24, 2024
a1f8526
fix edge case by returning gracefully. (#1118)
Brean0 Sep 24, 2024
6c46261
Reciever -> Receiver
Brean0 Sep 25, 2024
d0eab49
Update comment in System.sol.
Brean0 Sep 25, 2024
3c66006
rename Facets and test.
Brean0 Sep 25, 2024
437ade5
update LibPipelineConvert message.
Brean0 Sep 25, 2024
794e225
remove uneeded add facets task
nickkatsios Sep 25, 2024
eb1dbb0
Update Reseed Account Status Events (#1116)
nickkatsios Sep 25, 2024
0a1177f
delete unused ReseedSun
nickkatsios Sep 25, 2024
bc718fa
scale sunriseBlock to uint64
nickkatsios Sep 25, 2024
d958c52
Liqudity -> Liquidity
Brean0 Sep 25, 2024
7019a63
Reseed Deployment Redesign (#1115)
nickkatsios Sep 26, 2024
c31a781
feat: add bottlneck npm package to ui
Space-Bean Sep 26, 2024
abf9599
feat: move pipeline convert class to ui
Space-Bean Sep 26, 2024
19406cf
feat: update pipeline convert
Space-Bean Sep 26, 2024
a99aa84
feat: remove logs
Space-Bean Sep 26, 2024
a7769f4
feat: cleanup + remove logs
Space-Bean Sep 26, 2024
2992ce9
Merge branch 'beanstalk-3' into spacebean/bs3/pipeline-convert
Space-Bean Sep 26, 2024
5eacbca
Pipeline convert (#1121)
Space-Bean Sep 26, 2024
f706727
Cast `sunriseBlock` to uint64. (#1120)
nickkatsios Sep 26, 2024
49ee631
remove withdrwalSeasond in System.sol, update comments
nickkatsios Sep 26, 2024
4795b7b
update various comments, remove deprecated UnripeBean3crv.sol
nickkatsios Sep 26, 2024
79fafac
misc cleanups
nickkatsios Sep 26, 2024
ce1ab16
remove withdrawSeasons from mock beanstalk
nickkatsios Sep 26, 2024
33562a3
prettier auto formatting changes
nickkatsios Sep 26, 2024
fa757ca
add l2 bcm in reseed bean
nickkatsios Sep 26, 2024
366678d
Merge branch 'misc-protocol-fixes' of https://github.com/BeanstalkFar…
nickkatsios Sep 26, 2024
a4153c9
prettier auto formatting changes
nickkatsios Sep 26, 2024
8a6b294
update comments, remove todo
nickkatsios Sep 26, 2024
aa21749
remove todo
nickkatsios Sep 26, 2024
9ab6689
Merge branch 'misc-protocol-fixes' of https://github.com/BeanstalkFar…
nickkatsios Sep 26, 2024
951fb50
prettier auto formatting changes
nickkatsios Sep 26, 2024
44d837c
feat: update sun implementation
Space-Bean Sep 26, 2024
abab1fe
feat: update sun updater
Space-Bean Sep 27, 2024
cb9b391
feat: update morning calculations
Space-Bean Sep 27, 2024
a35bd0e
feat: implement field except chart
Space-Bean Sep 27, 2024
bcdca63
feat: update morning chart
Space-Bean Sep 27, 2024
1ed5326
Morning + Sun (#1123)
Space-Bean Sep 27, 2024
c9d7343
Fix grown stalk from stems calculation
pizzaman1337 Sep 27, 2024
77af644
feat: fix delta blocks calculation + change names
Space-Bean Sep 27, 2024
9fead02
feat: update useTemperature + morning
Space-Bean Sep 27, 2024
4789e86
feat: update dependencies of useTemperature
Space-Bean Sep 27, 2024
85cefe7
feat: update gql schame
Space-Bean Sep 27, 2024
1f423ca
feat: fix 0.5 seconds inaccuracy
Space-Bean Sep 27, 2024
5d1beb1
feat: update morning components
Space-Bean Sep 27, 2024
1976e4a
Fix: Field Morning (#1124)
Space-Bean Sep 27, 2024
9bcca23
feat: remove logs
Space-Bean Sep 27, 2024
dd0c06d
update well upgr owner
nickkatsios Sep 29, 2024
017a650
remove owner
nickkatsios Sep 29, 2024
80cea02
remove test function.
Brean0 Sep 29, 2024
2cb48f6
Misc Protocol Cleanup (#1122)
nickkatsios Sep 29, 2024
d94f021
update salts and addresses.
Brean0 Sep 29, 2024
5e9260a
update global jsons
Brean0 Sep 29, 2024
7cb300c
update invalid Address.
Brean0 Sep 29, 2024
d8fc50c
remove withdraw seasons in convert global.js
Brean0 Sep 29, 2024
ec34e7f
update addresses in reseedBean.
Brean0 Sep 30, 2024
5ee92bb
Implement new Pump Data, mine for new addresses.
Brean0 Sep 30, 2024
579061d
update l2 facet addresses
nickkatsios Sep 30, 2024
ae235d2
reuse deployed init scripts, set deployed shippment planner
nickkatsios Sep 30, 2024
51095d6
update addresses in sdk.
Brean0 Sep 30, 2024
131145a
update json I
Brean0 Sep 30, 2024
21aa67b
Add Event emissions.
Brean0 Sep 30, 2024
0368e0c
update beanstalk selectors for migration.
Brean0 Sep 30, 2024
639cf8f
update the reseedL1 to remove siloFacet first.
Brean0 Sep 30, 2024
480a163
add updated storage variables.
Brean0 Sep 30, 2024
2ca225a
update beanstalkSelectors.
Brean0 Sep 30, 2024
af2e57e
update with marketplace
Brean0 Oct 1, 2024
0ada499
Verifies all contracts are able to migrate deposits within arb gas li…
pizzaman1337 Oct 1, 2024
faa0ec6
MFP v1.2. (#1125)
Brean0 Oct 1, 2024
667bcc7
exclude smart contract stalk and roots from globals
nickkatsios Oct 1, 2024
409aa7e
update token gauge points
nickkatsios Oct 1, 2024
02b5870
feat: v0 of beanswap
Space-Bean Oct 1, 2024
7c1eb82
feat: update well component addresses
Space-Bean Oct 1, 2024
a743777
feat: add bottleneck to sdk
Space-Bean Oct 1, 2024
dccde48
feat: update zeroX implementation in sdk
Space-Bean Oct 1, 2024
ed2e57b
feat: update zerox + pipeline convert
Space-Bean Oct 1, 2024
6aec91b
implement chunking for problematic accounts, reuse deployed reseed bean
nickkatsios Oct 2, 2024
571df39
add option to save diamond cut in upgradeWithDeployedFacets
nickkatsios Oct 2, 2024
316c7af
revert flag
nickkatsios Oct 2, 2024
6f609ec
feat: add utils to swap
Space-Bean Oct 2, 2024
a0871f2
Merge branch 'spaebean/bs3/swap' into spacebean/bs3/swap
Space-Bean Oct 2, 2024
ee24b59
feat: add utils + update ui schema
Space-Bean Oct 2, 2024
6f0b48a
feat: sdk swapV2 v0
Space-Bean Oct 3, 2024
7e2c801
add deployL1ReceiverFacet and addFacetsToDiamond hh tasks
nickkatsios Oct 4, 2024
1d19d81
add flag in reseed10
nickkatsios Oct 4, 2024
60e3ef4
manual migration wip
uncoolzero Oct 4, 2024
df5e2a0
update abis
uncoolzero Oct 5, 2024
efb3af4
migration wip
uncoolzero Oct 5, 2024
2a9aa42
feat: refactor beanswap. Create swapstep class
Space-Bean Oct 4, 2024
4e8b3d6
feat: clean up swap steps
Space-Bean Oct 4, 2024
ff9fa21
feat: remove unused imports
Space-Bean Oct 4, 2024
37a0cb3
feat: remove old implementations
Space-Bean Oct 5, 2024
e3442ea
feat: create new swapnode implementation
Space-Bean Oct 5, 2024
29f7647
feat: remove old implementations
Space-Bean Oct 5, 2024
d245c0c
feat: price cache class
Space-Bean Oct 5, 2024
60a3622
feat: new quoter implementation
Space-Bean Oct 5, 2024
f26d38c
feat: new quoteBuilder implementation
Space-Bean Oct 5, 2024
ad32cf3
feat: new beanswap implementation
Space-Bean Oct 5, 2024
9a32b74
feat: update residual classes + imports
Space-Bean Oct 5, 2024
9b87754
copy tweaks
uncoolzero Oct 6, 2024
77d63c6
fix
uncoolzero Oct 6, 2024
16c1280
feat: refactor some parts of beanswap
Space-Bean Oct 6, 2024
73cdb6d
feat: remove sdk exports
Space-Bean Oct 6, 2024
f27e7fa
feat: remove exports
Space-Bean Oct 6, 2024
72021e9
update exports
nickkatsios Oct 6, 2024
5d105ed
feat: fix bugs
Space-Bean Oct 6, 2024
7c55167
clean up reseed state tests, fix paths, add offset option when parsin…
nickkatsios Oct 6, 2024
0360fdd
prettier auto formatting changes
nickkatsios Oct 6, 2024
a5c0929
feat: update sdk swap
Space-Bean Oct 7, 2024
269c90f
feat: update UI swap
Space-Bean Oct 7, 2024
35427d4
feat: update actions to use combined token instances
Space-Bean Oct 7, 2024
33479e3
feat: update text field props
Space-Bean Oct 7, 2024
d5e621a
feat: fix BeanSwapOperation sdk init
Space-Bean Oct 7, 2024
4219748
feat: update some swap
Space-Bean Oct 7, 2024
6837809
Update l2 weth address in C.sol and LibWeth.sol
nickkatsios Oct 7, 2024
573eaa4
Merge branch 'exclude-smart-contract-stalk' of https://github.com/Bea…
nickkatsios Oct 7, 2024
bce8ca6
move reseed functionality tests to new file, remove deposit withdraw …
nickkatsios Oct 7, 2024
b122f47
add safety check for external holders comparison
nickkatsios Oct 7, 2024
3761f49
weth fix
nickkatsios Oct 7, 2024
ccb24c2
add L1/L2 WETH support.
Brean0 Oct 7, 2024
1a8def6
fix hardhat tests.
Brean0 Oct 7, 2024
000670e
Weth constant fix (#1128)
Brean0 Oct 7, 2024
4c9ac99
Exclude Smart Contract Stalk + Reseed Data Changes (#1126)
Brean0 Oct 7, 2024
b09418e
Amend C.sol
Brean0 Oct 7, 2024
de9d65d
Deploy with new L2 TokenFacet.
Brean0 Oct 7, 2024
d5ffd6b
Merge branch 'beanstalk-3' into spacebean/bs3/swap
Space-Bean Oct 7, 2024
56c16e6
BeanSwap (#1127)
Space-Bean Oct 7, 2024
d92ebab
feat: update seed gauge to disallow BEAN from being max LP
Space-Bean Oct 7, 2024
a3282ec
feat: update missing expected reward inc / dec
Space-Bean Oct 7, 2024
3f673e2
feat: update seed gauge query
Space-Bean Oct 8, 2024
8299872
feat: update conversion paths
Space-Bean Oct 8, 2024
79a0879
feat: fix useAvgSeedsPerBDV
Space-Bean Oct 8, 2024
215e50d
feat: fix chart ts
Space-Bean Oct 8, 2024
c5d251f
Merge branch 'beanstalk-3' into spacebean/bs3/seed-gauge
Space-Bean Oct 8, 2024
ccc28df
bs3-ui seed gauge (#1129)
Space-Bean Oct 8, 2024
18a35b1
refactoring
uncoolzero Oct 8, 2024
d8a7b55
localstorage fix
uncoolzero Oct 8, 2024
d6a39be
feat: re-add sdk changes
Space-Bean Oct 8, 2024
e88d78b
feat: re-add ui changes
Space-Bean Oct 8, 2024
7c4d0b6
feat: add deposit.tsx
Space-Bean Oct 8, 2024
991fe5a
minor tweaks
uncoolzero Oct 8, 2024
d1659b9
Merge branch 'beanstalk-3' into spacebean/bs3/swap-x-deposit
Space-Bean Oct 8, 2024
116c8af
Spacebean/bs3/swap x deposit (#1131)
Space-Bean Oct 8, 2024
a2295e5
fix import
uncoolzero Oct 8, 2024
2972218
modify tasks for deployment
nickkatsios Oct 8, 2024
d03c780
feat: fix buy fertilizer
Space-Bean Oct 8, 2024
7846ac2
disabled condition
uncoolzero Oct 8, 2024
989fea0
Final L2 deployment Tasks (#1132)
Brean0 Oct 8, 2024
1ee002d
cleanup
uncoolzero Oct 8, 2024
d49fb7c
remove routes for initial stages of migration
uncoolzero Oct 8, 2024
220dd7d
feat: fix sow
Space-Bean Oct 8, 2024
c6675a2
feat: remove logs from sow
Space-Bean Oct 8, 2024
514b756
feat: add migration message
Space-Bean Oct 8, 2024
3b4152b
merge master
Space-Bean Oct 8, 2024
68ad5ae
better state tracking
uncoolzero Oct 8, 2024
608f03e
navbar
uncoolzero Oct 8, 2024
ccbb54f
chain switch button
uncoolzero Oct 8, 2024
bbafb47
build fix (temp)
uncoolzero Oct 8, 2024
e9e88b7
copy tweak
uncoolzero Oct 8, 2024
dd9794e
parse data from block 20921737
Brean0 Oct 8, 2024
ec616d1
restore navbar
uncoolzero Oct 8, 2024
33b721f
copy
uncoolzero Oct 8, 2024
ef20268
update links
uncoolzero Oct 8, 2024
7a09893
feat: buy sow deposit changes
Space-Bean Oct 8, 2024
079baf9
Update merkles and wip contract state verifications
pizzaman1337 Oct 8, 2024
9853646
Implement revised scripts.
Brean0 Oct 9, 2024
5494ab9
update ReseedSilo such that `AddMigratedDeposit` is emitted on all cases
Brean0 Oct 9, 2024
b7b7284
feat: add cid to dex-ui
Space-Bean Oct 9, 2024
b2ac801
Update Contract Names.
Brean0 Oct 9, 2024
2cd5d32
feat: update basin links
Space-Bean Oct 9, 2024
06c3ca7
update contract names.
Brean0 Oct 9, 2024
1415e36
update reseed with new jsons and reseed scripts.
Brean0 Oct 9, 2024
02c8bca
Fix ReseedContract tests to support fork testing
pizzaman1337 Oct 9, 2024
c17d4f8
Remove logs
pizzaman1337 Oct 9, 2024
e052f5e
Merge branch 'reseed-revised' into contract-state-verification
pizzaman1337 Oct 9, 2024
3137b64
Update merkles
pizzaman1337 Oct 9, 2024
535aaa7
Contract state verification update (#1137)
Brean0 Oct 9, 2024
9f68dd2
feat: update basin ticker api
Space-Bean Oct 9, 2024
dc9c1d3
feat: hide anti l2l converts for now
Space-Bean Oct 9, 2024
05f435a
feat: update forecast + seasonsquery
Space-Bean Oct 9, 2024
97160b8
feat: more updates to charts
Space-Bean Oct 9, 2024
e13f3c8
feat: change analytics + silo charts to be l1 only
Space-Bean Oct 9, 2024
cd852c3
push revised deposit test to not depend on order.
Brean0 Oct 9, 2024
008febb
feat: update tokens to l1 tokens on analytics
Space-Bean Oct 9, 2024
1dc1531
update index
Brean0 Oct 9, 2024
f3e7e85
feat: fetch all bs subgraph
Space-Bean Oct 9, 2024
e81f559
Spacebean/bs3/UI passthrough (#1139)
Space-Bean Oct 9, 2024
9b54371
update reseedState to only check potential deposits
Brean0 Oct 9, 2024
d9aca49
update test_AccountPlots.
Brean0 Oct 9, 2024
347025e
Merge branch 'Reseed-revised' into beanstalk-3
Brean0 Oct 9, 2024
5691fc1
feat: migrate
Space-Bean Oct 8, 2024
442af09
fix errs new message
Space-Bean Oct 8, 2024
1898502
feat: schema json
Space-Bean Oct 8, 2024
aa4912a
feat: update silo balance query
Space-Bean Oct 8, 2024
d7eed7b
feat: fix message v3
Space-Bean Oct 8, 2024
fe7228d
merge master 2
Space-Bean Oct 9, 2024
669db5b
merge master 3
Space-Bean Oct 9, 2024
512b6a3
fix ui build errors
Space-Bean Oct 9, 2024
034c210
feat: restore ui navbar
Space-Bean Oct 9, 2024
6e36df2
update L1 Receiver facet with updated deployed address.
Brean0 Oct 9, 2024
fee04a6
feat update seeds chart
Space-Bean Oct 9, 2024
4aa9f6f
feat: fix buy fert
Space-Bean Oct 9, 2024
362fac1
feat: remove migration preview tab
Space-Bean Oct 9, 2024
fdd5245
add Update OracleImplementation
Brean0 Oct 9, 2024
637ed46
feat: fix unripe underlying
Space-Bean Oct 9, 2024
90df440
update l1 receiver facet
nickkatsios Oct 9, 2024
611920e
update ReseedAddLiquidityAndTransfer.
Brean0 Oct 10, 2024
47ee49e
feat: remove pre silov3 claimable
Space-Bean Oct 10, 2024
b9c8d9f
feat: update dex-ui link
Space-Bean Oct 10, 2024
8376732
feat: clean up env
Space-Bean Oct 10, 2024
db026db
feat update routes
Space-Bean Oct 10, 2024
707e472
add routes
uncoolzero Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 22 additions & 6 deletions .github/workflows/ci.protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,27 @@ on:
- "protocol/**"

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: "18"
- run: yarn add prettier
- run: yarn add prettier-plugin-solidity
- run: shopt -s globstar; yarn prettier --write --config .prettierrc --plugin=prettier-plugin-solidity protocol/**/*.sol || true
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: prettier auto formatting changes
branch: ${{ github.head_ref }}
- name: check format
run: shopt -s globstar; yarn prettier --check --config .prettierrc --plugin=prettier-plugin-solidity protocol/**/*.sol
test:
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -25,12 +45,8 @@ jobs:

- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --no-immutable

- name: Generate (with cache)
id: generate-with-cache
continue-on-error: true
run: yarn generate
run: yarn install --immutable
- run: yarn generate
working-directory: protocol

- name: Clear cache and reinstall on generate failure
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ node_modules
# Local Netlify folder
.netlify

# forge libraries.
protocol/lib/

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "protocol/lib/forge-std"]
path = protocol/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "protocol/lib/solmate"]
path = protocol/lib/solmate
url = https://github.com/transmissions11/solmate
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
"singleQuote": false,
"semi": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "projects/subgraph-*/**",
"options": {
Expand Down
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode",
"juanblanco.solidity"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"solidity.formatter": "prettier"
}
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"jest": "29.2.2",
"jest-serial-runner": "1.2.1",
"lint-staged": "13.3.0",
"prettier": "3.2.5",
"prettier": "3.3.3",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"typescript": "5.3.3"
Expand All @@ -42,13 +42,22 @@
"sdk:prettier": "yarn prettier projects/sdk -w",
"sdk:publish": "yarn workspace @beanstalk/sdk publish",
"sdk:version": "yarn workspace @beanstalk/sdk version",
"dex-ui:dev": "yarn workspace dex-ui dev",
"dex-ui:build": "yarn workspace dex-ui build",
"dex-ui:generate": "yarn workspace dex-ui generate",
"ui:generate": "yarn workspace ui generate",
"ui:dev": "yarn workspace ui dev",
"ui:start": "yarn workspace ui start",
"ui:build": "yarn workspace ui build",
"ui:test": "yarn workspace ui test",
"test:browser": "yarn workspace tests test:browser",
"ex": "yarn workspace @beanstalk/examples x",
"anvil-arbitrum": "yarn cli:anvil-arbitrum",
"anvil-eth-mainnet": "yarn cli:anvil-eth-mainnet",
"anvil": "anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/5ubn94zT7v7DnB5bNW1VOnoIbX5-AG2N --chain-id 1337",
"anvil4tests": "anvil --fork-url https://eth-mainnet.g.alchemy.com/v2/Kk7ktCQL5wz4v4AG8bR2Gun8TAASQ-qi --chain-id 1337 --fork-block-number 18629000"
},
"dependencies": {
"prettier-plugin-solidity": "1.4.1"
}
}
5 changes: 5 additions & 0 deletions projects/cli/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DEV API key
DEV_ALCHEMY_API_KEY=""

# Test API key
DEV_TEST_ALCHEMY_API_KEY=""
2 changes: 2 additions & 0 deletions projects/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
build

.env
48 changes: 48 additions & 0 deletions projects/cli/anvil.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

source .env

# Set variables based on arguments
keyType="$1"
chainIdType="$2"

# Set chain IDs
mainnet_local_chain_id=1338

arbitrum_local_chain_id=1337

# Determine which API key to use
if [ "$keyType" = "test" ]; then
apiKey="$DEV_TEST_ALCHEMY_API_KEY"
else
apiKey="$DEV_ALCHEMY_API_KEY"
fi

# Determine which chain ID to use. Defaults to arbitrum local host
if [ "$chainIdType" = "eth-mainnet" ]; then
chainId=$mainnet_local_chain_id
prefix="eth"
port=9545
else
chainId=$arbitrum_local_chain_id
prefix="arb"
port=8545
fi

# Check if required variables are set
if [ -z "$prefix" ] || [ -z "$apiKey" ] || [ -z "$chainId" ]; then
echo "Error: Missing required variables. Please set keyType and chainIdType."
exit 1
fi

anvil \
--fork-url "https://$prefix-mainnet.g.alchemy.com/v2/$apiKey" \
--chain-id "$chainId" \
--port "$port" \
"${@:3}"

# Check if Anvil exited with an error
if [ $? -ne 0 ]; then
echo "Error: Anvil exited with a non-zero status."
exit 1
fi
8 changes: 6 additions & 2 deletions projects/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@beanstalk/cli",
"version": "0.0.10",
"version": "0.0.20",
"description": "Beanstalk protocol development cli tool",
"license": "MIT",
"repository": {
Expand All @@ -16,7 +16,11 @@
"scripts": {
"cli:publish": "yarn cli:build && yarn npm publish --access public",
"cli:build": "rimraf build && tsc && chmod u+x build/cli.js",
"g:bean": "yarn ts-node-esm src/cli.ts"
"g:bean": "yarn ts-node-esm src/cli.ts",
"cli:anvil-eth-mainnet": "bash anvil.sh dev eth-mainnet",
"cli:anvil-arbitrum": "bash anvil.sh dev arbitrum-mainnet",
"cli:anvil4tests-mainnet": "bash anvil.sh test eth-mainnet --fork-block-number 18629000",
"cli:anvil4tests-arbitrum": "bash anvil.sh test arbitrum-mainnet --fork-block-number 18629000"
},
"devDependencies": {
"@types/command-line-args": "^5.2.3",
Expand Down
33 changes: 24 additions & 9 deletions projects/cli/src/commands/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ export const balance = async (sdk, { account, symbol }) => {
[
"ETH",
"WETH",
"WSTETH",
"WEETH",
"WBTC",
"BEAN",
"USDT",
"USDC",
"DAI",
"CRV3",
"UNRIPE_BEAN",
"UNRIPE_BEAN_wstETH",
"BEAN_CRV3_LP",
"BEAN_ETH_WELL_LP",
"ROOT"
"USDC",
"USDT",
"urBEAN",
"urBEANWSTETH",
"BEANWETH",
"BEANWEETH",
"BEANWEETH",
"BEANWBTC",
"BEANUSDC",
"BEANUSDT"
].map((s) => getBal(sdk, s, account))
);
res.push(...bals);
Expand All @@ -32,7 +37,17 @@ export const balance = async (sdk, { account, symbol }) => {
};

async function getBal(sdk, symbol: string, account: string) {
const token = sdk.tokens[symbol];
let token = sdk.tokens[symbol];
if (!token) {
if (symbol === "urBEAN") token = sdk.tokens.UNRIPE_BEAN;
if (symbol === "urBEANWSTETH") token = sdk.tokens.UNRIPE_BEAN_WSTETH;
if (symbol === "BEANWETH") token = sdk.tokens.BEAN_ETH_WELL_LP;
if (symbol === "BEANWEETH") token = sdk.tokens.BEAN_WEETH_WELL_LP;
if (symbol === "BEANWSTETH") token = sdk.tokens.BEAN_WSTETH_WELL_LP;
if (symbol === "BEANWBTC") token = sdk.tokens.BEAN_WBTC_WELL_LP;
if (symbol === "BEANUSDC") token = sdk.tokens.BEAN_USDC_WELL_LP;
if (symbol === "BEANUSDT") token = sdk.tokens.BEAN_USDT_WELL_LP;
}
if (!token) throw new Error(`No token found: ${symbol}`);

try {
Expand Down
33 changes: 22 additions & 11 deletions projects/cli/src/commands/setbalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ export const setbalance = async (sdk, chain, { account, symbol, amount }) => {
const symbols = [
"ETH",
"WETH",
"WSTETH",
"WEETH",
"WBTC",
"BEAN",
"USDT",
"USDC",
"DAI",
"CRV3",
"BEAN3CRV",
"BEANWETH",
"USDC",
"USDT",
"urBEAN",
"urBEANwstETH",
"ROOT"
"urBEANWSTETH",
"BEANWETH",
"BEANWSTETH",
"BEANWEETH",
"BEANWBTC",
"BEANUSDC",
"BEANUSDT"
];
if (!symbols.includes(symbol)) {
console.log(
Expand All @@ -33,10 +38,16 @@ export const setbalance = async (sdk, chain, { account, symbol, amount }) => {
process.exit(-1);
}
let t = sdk.tokens[symbol] as Token;
if (symbol === "urBEAN") t = sdk.tokens.UNRIPE_BEAN;
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 (!t) {
if (symbol === "urBEAN") t = sdk.tokens.UNRIPE_BEAN;
if (symbol === "urBEANWSTETH") t = sdk.tokens.UNRIPE_BEAN_WSTETH;
if (symbol === "BEANWETH") t = sdk.tokens.BEAN_ETH_WELL_LP;
if (symbol === "BEANWEETH") t = sdk.tokens.BEAN_WEETH_WELL_LP;
if (symbol === "BEANWSTETH") t = sdk.tokens.BEAN_WSTETH_WELL_LP;
if (symbol === "BEANWBTC") t = sdk.tokens.BEAN_WBTC_WELL_LP;
if (symbol === "BEANUSDC") t = sdk.tokens.BEAN_USDC_WELL_LP;
if (symbol === "BEANUSDT") t = sdk.tokens.BEAN_USDT_WELL_LP;
}
if (typeof chain[`set${symbol}Balance`] !== "function")
throw new Error(`${symbol} is not a valid token or the method ${chalk.bold.whiteBright("")}`);

Expand Down
14 changes: 7 additions & 7 deletions projects/cli/src/commands/setprice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ export const setPrice = async (sdk: BeanstalkSDK, chain: TestUtils.BlockchainUti
console.log(beanInput, crv3Input);

const newBeanAmount = (beanInput ? beanInput : 20) * 1_000_000;
const newCrv3Amount = (crv3Input ? crv3Input : beanInput ? beanInput : 20) * 1_000_000;
// const newCrv3Amount = (crv3Input ? crv3Input : beanInput ? beanInput : 20) * 1_000_000;

const newBean = sdk.tokens.BEAN.amount(newBeanAmount);
const newCrv3 = sdk.tokens.CRV3.amount(newCrv3Amount);
// const newBean = sdk.tokens.BEAN.amount(newBeanAmount);
// const newCrv3 = sdk.tokens.CRV3.amount(newCrv3Amount);

////// Set the new balance
console.log(`New Balances: ${newBean.toHuman()} ${newCrv3.toHuman()}`);
// console.log(`New Balances: ${newBean.toHuman()} ${newCrv3.toHuman()}`);
// update the array tracking balances
await setBalance(sdk, POOL_ADDRESS, BALANCE_SLOT, newBean, newCrv3);
// await setBalance(sdk, POOL_ADDRESS, BALANCE_SLOT, newBean, newCrv3);
// actually give the pool the ERC20's
await chain.setBEANBalance(POOL_ADDRESS, newBean);
await chain.setCRV3Balance(POOL_ADDRESS, newCrv3);
// await chain.setBEANBalance(POOL_ADDRESS, newBean);
// await chain.setCRV3Balance(POOL_ADDRESS, newCrv3);

// Curve also keeps track of the previous balance, so we just copy the existing current to old.
await setBalance(sdk, POOL_ADDRESS, PREV_BALANCE_SLOT, currentBean, currentCrv3);
Expand Down
8 changes: 5 additions & 3 deletions projects/dex-ui/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
VITE_AQUIFER_ADDRESS=local/fork deployed address
VITE_AQUIFER_ADDRESS_ETH="deployed address here"
VITE_AQUIFER_ADDRESS_ARBITRUM="deployed address here"
VITE_ALCHEMY_API_KEY="your key here"
VITE_THEGRAPH_API_KEY="your key here"
VITE_WALLET_CONNECT_PROJECT_ID="project key here"
VITE_WELLS_ORIGIN_BLOCK=17138465
VITE_LOAD_HISTORY_FROM_GRAPH=0
VITE_WALLET_CONNECT_PROJECT_ID="project key here"
VITE_LOAD_HISTORY_FROM_GRAPH=0
7 changes: 6 additions & 1 deletion projects/dex-ui/.env.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// DO NOT ACTUALLY SAVE THINGS HERE
// ONLY USE THIS FILE TO TRACK WHAT ENV VARS NEED TO
// BE ADDED TO NETLIFY CONFIG
VITE_AQUIFER_ADDRESS_ETH=""
VITE_AQUIFER_ADDRESS_ARBITRUM=""
VITE_ALCHEMY_API_KEY=""
VITE_WALLET_CONNECT_PROJECT_ID=""
VITE_THEGRAPH_API_KEY=""
VITE_WALLET_CONNECT_PROJECT_ID=""
VITE_WELLS_ORIGIN_BLOCK=""
VITE_LOAD_HISTORY_FROM_GRAPH=""
Loading
Loading