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-X: Secure Beanstalk #796

Closed
wants to merge 782 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
782 commits
Select commit Hold shift + click to select a range
e51ea80
update abis
funderbrker May 17, 2024
6b26c52
ignore abi changes. distracting
funderbrker May 17, 2024
212e19e
shipment routes getter
funderbrker May 17, 2024
803a6fa
Comment out incompatible imports
pizzaman1337 May 17, 2024
7090b77
Fix remaining file to 0.8.20
pizzaman1337 May 17, 2024
234e8c9
Cleanup calculateSopPerWell
pizzaman1337 May 17, 2024
66ab92b
Event checking, add fuzzing to tests
pizzaman1337 May 17, 2024
ebfd03b
Comment cleanup
pizzaman1337 May 17, 2024
197321a
Remove unnecessary test
pizzaman1337 May 18, 2024
2c9388f
Add view modifier to various tests, cleanup unused vars
pizzaman1337 May 18, 2024
97ef0c2
Natspec for AppStorage changes
pizzaman1337 May 18, 2024
96a7045
Only allow claimPlenty if plenty available is greater than zero
pizzaman1337 May 18, 2024
a8d3357
flood test QOL
Brean0 May 18, 2024
1fb7486
flood test QOL (#872)
pizzaman1337 May 18, 2024
7bddb9d
Merge branch 'gen-flood' into gen-flood-rev-1
pizzaman1337 May 18, 2024
f4b3608
Support internal/external transfer mode on claim plenty
pizzaman1337 May 18, 2024
e1f698c
Author
pizzaman1337 May 18, 2024
f34835e
floodPodline natspec, remove console import, remove comment
pizzaman1337 May 18, 2024
3d79f71
Remove returning largest liquid well from evaluateBeanstalk
pizzaman1337 May 18, 2024
d8e33ce
Merge branch 'secure-beanstalk' into reseed
Brean0 May 18, 2024
968cd87
ReseedL2Migration
Brean0 May 18, 2024
f4d3e64
transfer all balance.
Brean0 May 18, 2024
7dc0688
Skeleton
Brean0 May 18, 2024
47d608f
comment out replants.
Brean0 May 18, 2024
31a8835
reseedField
Brean0 May 18, 2024
2df56f5
reseedSilo
Brean0 May 18, 2024
f9bff0f
remove contract amount/bdv due to inability to guarantee amount.
Brean0 May 19, 2024
b867ccc
reseedBean.
Brean0 May 19, 2024
b3a0c16
internalBalances init
Brean0 May 19, 2024
1c52d73
Remove unused import
pizzaman1337 May 19, 2024
156a9fc
Use current deltaB for flood amounts rather than capped
pizzaman1337 May 19, 2024
f38d922
Natspec to constant and struct
pizzaman1337 May 19, 2024
3f0c567
No revert on total positive deltaB being less than total negative
pizzaman1337 May 19, 2024
ccbb718
Remove an iteration through wells by combining calculating well stats…
pizzaman1337 May 19, 2024
4a7d2da
Remove old calculateSop function
pizzaman1337 May 19, 2024
4bb95df
Test when twaDeltaB is positive, but the instanteous deltaB is negative
pizzaman1337 May 19, 2024
f64c3b7
ReseedInternalBalances.
Brean0 May 19, 2024
cc3d8a5
reseedBarn.
Brean0 May 19, 2024
6c33552
Remove unnecessary positiveDeltaBCount check
pizzaman1337 May 19, 2024
b2ce174
ReseedSun.
Brean0 May 19, 2024
986741d
ReseedBarn.
Brean0 May 20, 2024
b9c4fae
L2ContractMigrationFacet
Brean0 May 20, 2024
d1245ed
Merge branch 'reseed' into L2ContractMigrationFacet
Brean0 May 20, 2024
d04d0e8
L2ContractMigrationFacet (#873)
Brean0 May 20, 2024
4878c8a
add field id to sow and harvest events
funderbrker May 20, 2024
22e7ac9
expand field tests
funderbrker May 20, 2024
e6a93cf
field writers. use id==index
funderbrker May 20, 2024
1c333ea
external setting of planner addr
funderbrker May 20, 2024
1f4c09c
small test / demo of shipments
funderbrker May 20, 2024
0575d33
move cancel pod listing into lib
funderbrker May 20, 2024
d5c6b3c
clean up init
funderbrker May 20, 2024
b340aa3
Calc sop algo wip
pizzaman1337 May 20, 2024
bc04fee
Remove comment in ICappedReservesPump
pizzaman1337 May 20, 2024
0b27aa1
Deprecate sopWell var in AppStorage, rename var
pizzaman1337 May 20, 2024
7701fc8
Remove unused IInstantaneousPump import
pizzaman1337 May 20, 2024
7922b24
Remove shouldTurnOnMinting check
pizzaman1337 May 20, 2024
f06a7d5
In cappedReservesDeltaB use isWell check
pizzaman1337 May 20, 2024
15baa20
Add natspec to getNonBeanIndex
pizzaman1337 May 20, 2024
4c0c880
Update some stalk penalty tests
pizzaman1337 May 20, 2024
b9dff49
Merge branch 'secure-beanstalk' into pipeline-convert
pizzaman1337 May 20, 2024
d822ae8
i - 1 -> (i-1)
Brean0 May 20, 2024
9aec7fc
Add isSoppable to whitelist data
pizzaman1337 May 20, 2024
29d7421
Implement List for UI.
Brean0 May 20, 2024
5de9bd9
Update Reseed files to initialize lists.
Brean0 May 20, 2024
b1f921e
update getters.
Brean0 May 20, 2024
a951f5d
Stack too deep.
Brean0 May 20, 2024
ae19fe2
Update invariant to include sop token amount stored per well
pizzaman1337 May 21, 2024
e20514a
Fix getSoppableWellLpTokens to include previously-soppable wells
pizzaman1337 May 21, 2024
4884035
Add PodList tests
Brean0 May 21, 2024
8dc4309
Merge branch 'gen-flood-calc-sop-algo' into gen-flood-rev-1
pizzaman1337 May 21, 2024
e2ea394
Cleanup calculateSopPerWell
pizzaman1337 May 21, 2024
f0fbb61
Remove reductionAmount in in-mem struct and re-use deltaB var
pizzaman1337 May 21, 2024
e6411f8
Silo DepositID Tests
Brean0 May 21, 2024
7ea86b8
comments
funderbrker May 21, 2024
df003a4
remove more old unused inits
funderbrker May 21, 2024
7962a1c
rename AppStorage.Storage
funderbrker May 21, 2024
e0b6dd3
remove unused/deprecated tests + scripts
funderbrker May 21, 2024
01548b6
rm curve. contract side and tests
funderbrker May 21, 2024
00e9c17
following comment instructions from brean migration
funderbrker May 21, 2024
cf32467
rm migrated bdv counter
funderbrker May 21, 2024
9774541
AppStorage change
Brean0 May 21, 2024
fca0624
Author
Brean0 May 21, 2024
08b54d8
natspec plotTransfer
Brean0 May 21, 2024
c59a191
shadows an existing declaration
Brean0 May 21, 2024
84a37e4
pure
Brean0 May 21, 2024
6140f99
silo test natspec
Brean0 May 21, 2024
6ccddb1
field test
Brean0 May 21, 2024
2cf4432
Remove unused MiscHelperContract
pizzaman1337 May 21, 2024
5ab12b4
add transferPlots function.
Brean0 May 21, 2024
681eb15
Token deposit/plots list (#875)
Brean0 May 21, 2024
1039f85
Merge remote-tracking branch 'origin/reseed' into tokenDeposit/plotsL…
Brean0 May 21, 2024
13d839c
tokenDeposit/plotsList-rev (#877)
Brean0 May 21, 2024
d537e0e
Test that uses either remaining convert capacity or amount user has
pizzaman1337 May 21, 2024
8818495
Remove console logs
pizzaman1337 May 21, 2024
c072e56
remove copy
Brean0 May 22, 2024
a770d33
prepareStalkPenaltyCalculation natspec
Brean0 May 22, 2024
d455199
scaledOverallInstantaneousDeltaB natspec
Brean0 May 22, 2024
22083b2
toBdv
Brean0 May 22, 2024
711a4e8
uncomment
Brean0 May 22, 2024
4204571
AppStorage
Brean0 May 22, 2024
6d34393
calculateAmountAgainstPeg
Brean0 May 22, 2024
7797fee
applyStalkPenalty
Brean0 May 22, 2024
fcc8760
DeltaBStorage struct, PipelineConvertData struct
Brean0 May 22, 2024
0908c6b
update StalkPenaltyData Struct
Brean0 May 22, 2024
3864b87
cleanup
Brean0 May 22, 2024
64e4fd3
use DeltaBStorage struct in calculateConvertedTowardsPeg
Brean0 May 22, 2024
a72f6a8
wraps LP scaling in isWell
Brean0 May 22, 2024
64d2a2f
use data in initialLpSupply instead of querying twice.
Brean0 May 22, 2024
99c4a1c
pipeline-convert-rev (#878)
Brean0 May 22, 2024
baa029a
initWhitelistTokens
Brean0 May 22, 2024
a3f3c51
Correct stalk penalty application
pizzaman1337 May 22, 2024
ee6eabb
Actually fix the math in penalty application, thanks Brean
pizzaman1337 May 22, 2024
f5ca0ea
Pull out functions into LibDeltaB and LibPipelineConvert
pizzaman1337 May 22, 2024
78fac2b
instantaneousDeltaB -> currentDeltaB
pizzaman1337 May 22, 2024
3a18f47
Expose scaledDeltaB in ConvertFacet
pizzaman1337 May 22, 2024
6329e92
Put shared deltaB population into LibPipelineConvert function
pizzaman1337 May 22, 2024
b9b2a4a
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 23, 2024
1b2b02b
set weather on update
funderbrker May 23, 2024
376997d
different defaults for weather
funderbrker May 23, 2024
d65b6ba
pr comments. fix test
funderbrker May 23, 2024
85fecec
comment update
funderbrker May 23, 2024
f95dc82
restructure storage
funderbrker May 22, 2024
535eabd
ignore abi changes
funderbrker May 23, 2024
4235c87
Update calculateConvertCapacityPenalty logic
pizzaman1337 May 23, 2024
d891405
Combine code into calculatePerWellCapacity function
pizzaman1337 May 23, 2024
5199219
move getters into convertGettersFacet, move functions to lib
Brean0 May 23, 2024
f965cd0
move getters into convertGettersFacet, move functions to lib (#886)
pizzaman1337 May 23, 2024
e883e94
Pipeline convert early review (#835)
pizzaman1337 May 23, 2024
94be1fe
One test fixed, one remaining
pizzaman1337 May 23, 2024
48e4d68
Combine season of plenty data at account level into shared struct
pizzaman1337 May 23, 2024
8d553e9
fix remaining test
Brean0 May 23, 2024
f7513e0
baa029ae0 initWhitelistTokens
Brean0 May 23, 2024
7a179e4
Combine system-level sop data into shared struct
pizzaman1337 May 23, 2024
13c127c
reseedDeployL2Beanstalk
Brean0 May 23, 2024
81ac3f4
On claimPLenty, add secure beanstalk invariant modifiers
pizzaman1337 May 23, 2024
9069ad2
Add isWell check on _claimPlenty
pizzaman1337 May 23, 2024
71da343
Make weather's quicksort private
pizzaman1337 May 23, 2024
ed3adec
Update comments
pizzaman1337 May 23, 2024
ae53a10
vs recommended extensions
funderbrker May 24, 2024
1bf3d9e
LibUniswapOracle support
Brean0 May 24, 2024
b7eb5a1
remove legacy silos
funderbrker May 24, 2024
64acb22
rm two more storage vars
funderbrker May 24, 2024
f5f341b
fix germination storage + odd/even structure. attn @brean
funderbrker May 24, 2024
1c266b9
t => temp
funderbrker May 24, 2024
f3a95b0
add buffers
funderbrker May 24, 2024
555a229
small touches on storage;
funderbrker May 24, 2024
ff7162d
rm seeds. breaks mocks
funderbrker May 24, 2024
daf594b
Move oracle implementation to AppStorage level
pizzaman1337 May 24, 2024
5ddf1a7
In calcGaugePoints, no selector is provided, use defaultGaugePointFun…
pizzaman1337 May 24, 2024
a4ae201
WIP test_whitelistTokenWithExternalImplmenation
pizzaman1337 May 24, 2024
f5351e4
Fix spelling of implementation
pizzaman1337 May 24, 2024
c012d4f
Working whitelistTokenWithExternalImplementation test
pizzaman1337 May 24, 2024
b3b9752
reseed: L2 migration
Brean0 May 24, 2024
4787ee3
reseed2 removed.
Brean0 May 24, 2024
de9fe8a
reseed3: initialize field.
Brean0 May 24, 2024
7106752
reseed 4: initialize + distribute fert, initialize state.
Brean0 May 24, 2024
b4fe36f
reseed5: reinitialize deposits.
Brean0 May 24, 2024
08bc4b0
L2 beanstalk console log
Brean0 May 24, 2024
687b7e8
reseed6: re-initialize internal balances.
Brean0 May 24, 2024
67da501
reseed5: separate deposit jsons.
Brean0 May 24, 2024
7ae80b1
reseed6: generalize internal balances, add unripe assets.
Brean0 May 24, 2024
47c63b1
reseed 7: deploy new bean and wells.
Brean0 May 24, 2024
25c46fe
reseed7: update owner
Brean0 May 24, 2024
d7efb6b
reseed9: deploy and add facets.
Brean0 May 24, 2024
ab3d678
reseed8: whitelist tokens
Brean0 May 24, 2024
eeb844a
reseed 7 <> 8, swap ordering.
Brean0 May 24, 2024
511e20a
reseed8: optimize.
Brean0 May 24, 2024
128cedb
L2 Migration Facet, L1 Receiver Facet.
Brean0 May 24, 2024
210bc35
Comment update.
Brean0 May 24, 2024
3b9013d
remove mock functions.
Brean0 May 25, 2024
15a1efd
fix remaining silo tests
Brean0 May 25, 2024
1d2d4f3
Fix tests
pizzaman1337 May 25, 2024
8bfa314
Optimize conditional in calculateSopPerWell
pizzaman1337 May 25, 2024
6b55d95
Add comment on loop in calculateSopPerWell
pizzaman1337 May 25, 2024
649b7ba
Remove comment
pizzaman1337 May 25, 2024
ea6787d
Remove unused imports
pizzaman1337 May 25, 2024
992fe83
enroot.test.js
Brean0 May 25, 2024
17cb41a
unripeBdvRemoval.test.js
Brean0 May 25, 2024
1f1d487
Initial shot of constants to state, breaks tests
pizzaman1337 May 25, 2024
1fc78b7
initializeSeedGaugeSettings
Brean0 May 25, 2024
4db1db8
Better support well sop tokens in the secure beanstalk invariable
pizzaman1337 May 25, 2024
e4c65f2
add external functions
Brean0 May 25, 2024
6b44195
add seedGauge change test
Brean0 May 25, 2024
0c4510c
rm-old-silos-brean (#895)
funderbrker May 26, 2024
4764837
Merge branch 'rm-old-silos' into storage-update
funderbrker May 26, 2024
dc2c265
Merge branch 'storage-update' of https://github.com/BeanstalkFarms/Be…
funderbrker May 26, 2024
8ac8479
shipping & receiving (#860)
funderbrker May 26, 2024
6cf2d4d
shorten system and accounts names
funderbrker May 26, 2024
6288bed
merge storage updates and field updates into secure beanstalk. existi…
funderbrker May 26, 2024
ac32bca
storage update (#862)
funderbrker May 26, 2024
ebd014a
Remove old hardhat farm tests
pizzaman1337 May 26, 2024
b1cc70b
WIP fixing WellConvert hardhat test
pizzaman1337 May 26, 2024
5102a5e
remove references.
Brean0 May 26, 2024
2b0d32e
add reseed field example.
Brean0 May 26, 2024
301f9ba
optimize reseedBarn and add barn raise implementation example
Brean0 May 26, 2024
45e2700
optimize reseedSilo and include example
Brean0 May 26, 2024
646347d
update shipping events
funderbrker May 27, 2024
ac9d6c6
add example deposit jsons.
Brean0 May 27, 2024
7e16595
add initReseed.
Brean0 May 27, 2024
7611b89
Add Internal Farm balances.
Brean0 May 27, 2024
ae32a3c
add whitelists.
Brean0 May 27, 2024
ef6b842
Add initial supplys.
Brean0 May 27, 2024
be651a8
update style.
Brean0 May 27, 2024
31f0184
update reseedField to set temp and demand for soil.
Brean0 May 27, 2024
9120d4b
add interfaces to initReseed.
Brean0 May 27, 2024
71759e3
Add additional initializations.
Brean0 May 27, 2024
592855e
can i interest you in some leftover beans
funderbrker May 27, 2024
d3b475a
fix forge tests
funderbrker May 27, 2024
abe7360
incl leftovers in invariant entitlements
funderbrker May 27, 2024
62247ce
Field secure fixes (#900)
funderbrker May 27, 2024
e365107
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 27, 2024
842ba5a
WIP fixing test
pizzaman1337 May 27, 2024
930ba44
LibIncentive change
Brean0 May 27, 2024
a34f308
Fix enroot test
pizzaman1337 May 27, 2024
1ac69c3
update incentive
Brean0 May 27, 2024
3a47d62
Fix well convert tests
pizzaman1337 May 27, 2024
44f6199
Update libDibbler to use L2 block times.
Brean0 May 27, 2024
6fbb830
Fix final test
pizzaman1337 May 27, 2024
8f91eef
Remove console logs
pizzaman1337 May 27, 2024
b3bd745
Secure beanstalk pizza fix (#904)
Brean0 May 27, 2024
87c93d7
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 27, 2024
715b6df
fix abi.
Brean0 May 27, 2024
91594d0
Update BeanL1RecieverFacet, and BeanL2MigrationFacet.
Brean0 May 27, 2024
4e283d9
Merge branch 'secure-beanstalk' into reseed
Brean0 May 28, 2024
0d623c7
fix errors from merging.
Brean0 May 28, 2024
f33b9ea
fix hardhat tests.
Brean0 May 28, 2024
5604834
move marketplace mine.
Brean0 May 28, 2024
653587a
Merge branch 'secure-beanstalk' into gen-flood
pizzaman1337 May 28, 2024
c634e36
Gen Flood early review (#870)
pizzaman1337 May 28, 2024
26b1ced
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 28, 2024
4576ae9
add L1 migration test.
Brean0 May 28, 2024
f08c71a
Fix various hardhat tests
pizzaman1337 May 28, 2024
67c1517
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 28, 2024
fe8e13d
Remove .only
pizzaman1337 May 28, 2024
472b205
Remove .only
pizzaman1337 May 28, 2024
9e4b892
Fixing hardhat tests
pizzaman1337 May 28, 2024
eb0c814
L1TokenFacet.
Brean0 May 28, 2024
d015337
Fix usd oracle test
pizzaman1337 May 28, 2024
e027eb0
add ability to replace facets, add L2BeanMigration to facets.
Brean0 May 28, 2024
d8b05d1
Remove .only
pizzaman1337 May 28, 2024
90b0683
Fix invariants on wrap/unwrap weth
pizzaman1337 May 28, 2024
be0b7cb
tweak naming for compiler
funderbrker May 29, 2024
68f1a4d
Merge branch 'secure-beanstalk' into whitelistV1.1
pizzaman1337 May 29, 2024
49f3ec9
whitelist V1.1 (#841)
pizzaman1337 May 29, 2024
d8038c2
Merge remote-tracking branch 'origin/secure-beanstalk' into reseed
Brean0 May 29, 2024
c608564
Mock beanstalk Interface.
Brean0 May 29, 2024
68ed4bd
separate pipelineConvert into facet.
Brean0 May 29, 2024
4282467
clean up.
Brean0 May 29, 2024
ed76a03
Merge branch 'reseed' into secure-beanstalk
Brean0 May 29, 2024
d19f88d
make burnGerminatingStalk external
Brean0 May 29, 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
  •  
  •  
  •  
24 changes: 22 additions & 2 deletions .github/workflows/ci.protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,34 @@ 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 prettier-plugin-solidity
# - run: shopt -s globstar; yarn dlx -p prettier prettier --write --config .prettierrc --plugin=prettier-plugin-solidity protocol/**/*.sol || true
- 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
- name: Protocol Tests
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "18"
- name: Cache Node Modules
id: node-modules-cache
uses: actions/cache@v3
Expand All @@ -23,7 +43,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --no-immutable
run: yarn install --immutable
- run: yarn generate
working-directory: protocol
- run: yarn test
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ node_modules
# Local Netlify folder
.netlify

protocol/lib/forge-std
# 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
19 changes: 17 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,20 @@
"printWidth": 100,
"singleQuote": false,
"semi": true,
"trailingComma": "none"
}
"trailingComma": "none",

"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
}
]
}
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"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"jest": "29.2.2",
"jest-serial-runner": "1.2.1",
"lint-staged": "13.1.0",
"prettier": "2.7.1",
"prettier": "3.2.5",
"ts-jest": "29.0.3",
"ts-node": "10.9.1",
"typescript": "4.8.4"
Expand Down Expand Up @@ -47,5 +47,8 @@
"ex": "yarn workspace @beanstalk/examples x",
"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.3.1"
}
}
16 changes: 1 addition & 15 deletions projects/sdk/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,7 @@ Available contracts:
```javascript
sdk.contracts = {
beanstalk: Beanstalk,
curve: {
pools: {
pool3: Curve3Pool,
tricrypto2: CurveTriCrypto2Pool,
beanCrv3: CurveMetaPool,
[k: string]: BaseContract // allows getting a contract by address
},
registries: {
poolRegistry: CurveRegistry,
metaFactory: CurveMetaFactory,
cryptoFactory: CurveCryptoFactory,
[k: string]: BaseContract, // allows getting a contract by address
},
zap: CurveZap,
},
.....
};
```

Expand Down
1 change: 1 addition & 0 deletions projects/sdk/src/lib/silo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ beforeAll(async () => {

await sdk.silo.deposit(sdk.tokens.BEAN, sdk.tokens.BEAN, amount, 0.1, account);
});

describe("Silo Balance loading", () => {
describe("getBalance", function () {
it("returns an empty object", async () => {
Expand Down
18 changes: 0 additions & 18 deletions projects/subgraph-beanstalk/src/FieldHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Address, BigDecimal, BigInt, log } from "@graphprotocol/graph-ts";
import {
FundFundraiser,
Harvest,
PlotTransfer,
Sow,
Expand Down Expand Up @@ -474,23 +473,6 @@ export function handleSupplyNeutral(event: SupplyNeutral): void {
);
}

export function handleFundFundraiser(event: FundFundraiser): void {
// Account for the fact thta fundraiser sow using no soil.
let beanstalk = loadBeanstalk(event.address);
updateFieldTotals(
event.address,
beanstalk.lastSeason,
ZERO_BI,
ZERO_BI.minus(event.params.amount),
ZERO_BI,
ZERO_BI,
ZERO_BI,
ZERO_BI,
event.block.timestamp,
event.block.number
);
}

function updateFieldTotals(
account: Address,
season: i32,
Expand Down
2 changes: 0 additions & 2 deletions projects/subgraph-beanstalk/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ dataSources:
handler: handleSupplyDecrease
- event: SupplyNeutral(indexed uint256,int256)
handler: handleSupplyNeutral
- event: FundFundraiser(indexed address,indexed uint32,uint256)
handler: handleFundFundraiser
file: ./src/FieldHandler.ts
- kind: ethereum/contract
name: Season
Expand Down
1 change: 0 additions & 1 deletion projects/subgraph-beanstalk/tests/event-mocking/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ export function createPlotTransferEvent(from: string, to: string, id: BigInt, po
export function createSupplyIncreaseEvent(season: BigInt, price: BigInt, newHarvestable: BigInt, newSilo: BigInt, issuedSoil: i32): void { }
export function createSupplyDecreaseEvent(season: BigInt, price: BigInt, issuedSoil: i32): void { }
export function createSupplyNeutralEvent(season: BigInt, issuedSoil: i32): void { }
export function createFundFundraiserEvent(id: BigInt, fundraiser: string, token: string, amount: BigInt): void { }
4 changes: 1 addition & 3 deletions protocol/.solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ module.exports = {
'./libraries/LibSafeMath128.sol',
'./libraries/Decimal.sol',
'./libraries/LibDiamond.sol',
'./facets/DiamondLoupeFacet.sol',
'./libraries/Convert/LibPlainCurveConvert.sol',
'./libraries/Curve/LibBeanLUSDCurve.sol'
'./facets/DiamondLoupeFacet.sol'
]

};
7 changes: 7 additions & 0 deletions protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ yarn hardhat compile

### Testing

#### Hardhat
1. Ensure you are in the `protocol` directory
2. Have a [FORKING_RPC](https://hardhat.org/hardhat-network/docs/guides/forking-other-networks) as an [environment variable](https://www.npmjs.com/package/dotenv) pointing to ETH Mainnet.
1. _We fork ETH Mainnet to run our test suite locally. Note, this will make a large number of API calls to your `FORKING_RPC`_
Expand All @@ -76,6 +77,12 @@ yarn test
yarn hardhat coverage
```

#### Foundry
1. Ensure you are in the `protocol` directory
2. Install foundry with `foundryup` - instructions [here](https://book.getfoundry.sh/getting-started/installation)
3. `forge install foundry-rs/forge-std --no-commit`
4. `forge test`

### Forking Mainnet Locally

We elect to use `anvil` instead of `hardhat` for local node forking as `anvil` is considerably faster than `hardhat` and properly caches the blockchain locally.
Expand Down
Loading
Loading