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

Internal review #21

Closed
wants to merge 366 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
366 commits
Select commit Hold shift + click to select a range
eac4724
feat: opt in and out of strategy rewards
haythemsellami May 29, 2024
b34d179
fix
haythemsellami May 29, 2024
079fc00
chore: lint
haythemsellami May 29, 2024
8656756
feat: claimStrategyReward()
haythemsellami May 29, 2024
3173f75
Merge pull request #13 from euler-xyz/feat/fees
haythemsellami May 29, 2024
aa9c869
Merge branch 'main' into feat/opt-in-strategy-rewards
haythemsellami May 29, 2024
266e804
chore: add natspec
haythemsellami May 30, 2024
700111d
test:
haythemsellami May 30, 2024
fdfdc17
chore: lint
haythemsellami May 30, 2024
ced8cc3
Merge pull request #14 from euler-xyz/feat/opt-in-strategy-rewards
haythemsellami May 30, 2024
10a6db8
feat: socialize negative yield
haythemsellami May 30, 2024
61a19e3
fix and tests'
haythemsellami May 31, 2024
5c4746b
decrease totalAllocated
haythemsellami May 31, 2024
034c2e5
fix
haythemsellami Jun 3, 2024
0262537
more gulping tests
haythemsellami Jun 3, 2024
0ce8f65
clean
haythemsellami Jun 3, 2024
d55d61b
more tests
haythemsellami Jun 3, 2024
970ead0
clean
haythemsellami Jun 3, 2024
69f74df
Merge pull request #15 from euler-xyz/feat/negative-yield-socialization
haythemsellami Jun 4, 2024
9545b5f
Add revert case
haythemsellami Jun 4, 2024
62cef9e
Push to withdrawalQueue
haythemsellami Jun 4, 2024
2eb3b23
Check that strategy is ERC4626
haythemsellami Jun 4, 2024
3de4aba
use SafeCast; other fixes
haythemsellami Jun 4, 2024
396afda
refactor _withdraw()
haythemsellami Jun 4, 2024
3320087
use max functions; ignore balance tracker hooks in self-transfer
haythemsellami Jun 4, 2024
c065a0d
update timestamp check
haythemsellami Jun 4, 2024
8ea4e4d
fix
haythemsellami Jun 5, 2024
f76a87a
fix
haythemsellami Jun 5, 2024
7d6186b
Merge pull request #17 from euler-xyz/fix/k-review
haythemsellami Jun 5, 2024
9956613
feat: add events
haythemsellami Jun 6, 2024
648affd
fix build
haythemsellami Jun 6, 2024
019ff45
add more events
haythemsellami Jun 6, 2024
6052b0d
Merge pull request #18 from euler-xyz/events
haythemsellami Jun 6, 2024
e5f9f3a
feat: init cap impl
haythemsellami Jun 7, 2024
e171136
add tests
haythemsellami Jun 10, 2024
2877e68
test: more tests
haythemsellami Jun 10, 2024
6e8192a
chore: natspec
haythemsellami Jun 10, 2024
40e0a02
Merge pull request #19 from euler-xyz/feat/balance-cap
haythemsellami Jun 10, 2024
fe7d604
feat: init hooks
haythemsellami Jun 10, 2024
c1fde1e
chore: lint
haythemsellami Jun 10, 2024
68457f0
feat: hooks implementation
haythemsellami Jun 10, 2024
981f2a2
chore: clean & rename
haythemsellami Jun 10, 2024
a09c8a3
test: init tests
haythemsellami Jun 10, 2024
43455a0
tests
haythemsellami Jun 11, 2024
3b0fa7f
chore: natspec
haythemsellami Jun 11, 2024
3bab3fa
chore: add reference
haythemsellami Jun 11, 2024
c8ab40b
add Rebalancer.sol
haythemsellami Jun 11, 2024
707ed8f
remove modifier
haythemsellami Jun 11, 2024
6791fad
more refactoring
haythemsellami Jun 11, 2024
a9631b7
Merge pull request #20 from euler-xyz/feat/hooks
haythemsellami Jun 11, 2024
7982101
Merge branch 'main' into reduce-bytecode-size
haythemsellami Jun 11, 2024
fdd19a2
chore: add bytecode size checks to CI
haythemsellami Jun 11, 2024
60356e3
move event
haythemsellami Jun 11, 2024
88daa43
remove rebalance hook
haythemsellami Jun 12, 2024
32e39cf
refactor
haythemsellami Jun 12, 2024
a436765
add event
haythemsellami Jun 12, 2024
b0f8889
remove cachedBalanceTracker
haythemsellami Jun 12, 2024
43f60e6
remove duplicate params
haythemsellami Jun 12, 2024
f591ebf
minor gas opt; remove account status check
haythemsellami Jun 12, 2024
b29462b
more fixes
haythemsellami Jun 12, 2024
ec792d7
clean
haythemsellami Jun 12, 2024
aa11e27
Merge pull request #22 from euler-xyz/reduce-bytecode-size
haythemsellami Jun 12, 2024
f3c2cf5
Merge branch 'main' into k-review2
haythemsellami Jun 12, 2024
6b7636e
refactor setHooksConfig()
haythemsellami Jun 12, 2024
b38c925
feat: pack hooks config in uint256
haythemsellami Jun 13, 2024
f5c5bd1
uncomment asserts
haythemsellami Jun 13, 2024
e43cff0
refactor
haythemsellami Jun 13, 2024
c048e42
revert on duplicate initial strategies
haythemsellami Jun 13, 2024
b0232f3
Merge pull request #24 from euler-xyz/k-review2
haythemsellami Jun 13, 2024
199ca17
accrue performance fee in underlying asset
haythemsellami Jun 14, 2024
d1329a3
lint
haythemsellami Jun 14, 2024
42832ad
use > instead of !=
haythemsellami Jun 14, 2024
82d3431
test: add asserts
haythemsellami Jun 14, 2024
46fc6e9
Merge pull request #25 from euler-xyz/update-performance-fee
haythemsellami Jun 14, 2024
a605265
refactor
haythemsellami Jun 14, 2024
81f619c
add files
haythemsellami Jun 14, 2024
f7886c3
forge install: openzeppelin-contracts-upgradeable
haythemsellami Jun 17, 2024
d019379
refactor
haythemsellami Jun 17, 2024
9ebd543
forge install: openzeppelin-contracts
haythemsellami Jun 17, 2024
0d8133c
unstructured storage
haythemsellami Jun 17, 2024
2ed5a5f
working version
haythemsellami Jun 17, 2024
8785df0
working version
haythemsellami Jun 17, 2024
9dd3080
working version
haythemsellami Jun 18, 2024
529aad6
working version
haythemsellami Jun 18, 2024
d6cbb57
working version
haythemsellami Jun 18, 2024
18756aa
working version
haythemsellami Jun 18, 2024
3282709
bytecode under limit
haythemsellami Jun 18, 2024
c6f29f2
clean
haythemsellami Jun 18, 2024
6e1a8fd
chore: rename roleS
haythemsellami Jun 18, 2024
133865d
add access control & last touches
haythemsellami Jun 18, 2024
7eaf524
Merge pull request #27 from euler-xyz/feat/clones
haythemsellami Jun 18, 2024
c4d83c2
chore: uncomment tests
haythemsellami Jun 18, 2024
680dd20
chore: natspec and renames
haythemsellami Jun 19, 2024
a475294
chore: renames
haythemsellami Jun 19, 2024
4c3c078
Merge pull request #26 from euler-xyz/refactor/withdraw
haythemsellami Jun 19, 2024
75fcb7f
fix RewardStreams integration
haythemsellami Jun 19, 2024
de41b89
clean
haythemsellami Jun 19, 2024
d864756
add natspec and use()
haythemsellami Jun 19, 2024
b09b8d8
clean
haythemsellami Jun 19, 2024
0c66c13
Merge pull request #28 from euler-xyz/fix/reward-streams-integration
haythemsellami Jun 19, 2024
da33430
update withdraw and redeem
haythemsellami Jun 20, 2024
5c726a5
Merge pull request #29 from euler-xyz/improve/withdraw
haythemsellami Jun 20, 2024
4a415dd
refactor
haythemsellami Jun 21, 2024
cf47798
feat: net yield/loss
haythemsellami Jun 23, 2024
54c5135
refactor
haythemsellami Jun 24, 2024
2661030
refactor and add tests
haythemsellami Jun 25, 2024
00c75b0
clean
haythemsellami Jun 25, 2024
59e8da5
clean
haythemsellami Jun 25, 2024
854f5e2
clean
haythemsellami Jun 25, 2024
293dc42
clean
haythemsellami Jun 25, 2024
1c6f7ff
Merge pull request #30 from euler-xyz/improve/harvest
haythemsellami Jun 27, 2024
c454c6e
rename
haythemsellami Jun 27, 2024
49fc1eb
separate core from plugin
haythemsellami Jun 27, 2024
b146b63
Merge pull request #31 from euler-xyz/chore/rename
haythemsellami Jun 27, 2024
e09ae62
remove dependency to the EVC
haythemsellami Jun 27, 2024
7a63756
feat: add setters for plugins
haythemsellami Jul 1, 2024
e4eb399
Merge pull request #32 from euler-xyz/plugins/setters
haythemsellami Jul 1, 2024
624b79e
forge install: erc4626-tests
haythemsellami Jul 1, 2024
5fbd9d8
test: a16z erc4626 property tests
haythemsellami Jul 1, 2024
bfbe585
clean
haythemsellami Jul 1, 2024
76bef1d
Merge pull request #33 from euler-xyz/test/a16z-tests
haythemsellami Jul 1, 2024
f8269f8
init basic invariants setup
haythemsellami Jul 1, 2024
c28a76c
improve setup; more invariants; fixes
haythemsellami Jul 2, 2024
28a1622
chore: add invariants run to github actions
haythemsellami Jul 2, 2024
980d117
more invariants; no removing strategy with allocated amount
haythemsellami Jul 2, 2024
d32af2a
lint:
haythemsellami Jul 2, 2024
1f23c58
fix CI
haythemsellami Jul 2, 2024
9c91401
more invariants; fix: reset cap when removing strategy
haythemsellami Jul 2, 2024
6ee42bc
lint
haythemsellami Jul 2, 2024
361e930
invariants
haythemsellami Jul 3, 2024
95a5896
more invariants
haythemsellami Jul 3, 2024
4a9c003
add gulp to handler
haythemsellami Jul 3, 2024
e61207f
fix: minor comments from certora
haythemsellami Jul 3, 2024
bb260c2
forge install: properties
haythemsellami Jul 3, 2024
6ef8f03
add echidna properties tests
haythemsellami Jul 3, 2024
e0d0e5c
update echidna config
haythemsellami Jul 3, 2024
49e5891
update echidna config
haythemsellami Jul 3, 2024
24db103
update echidna config
haythemsellami Jul 3, 2024
e8ed3a9
update echidna config
haythemsellami Jul 3, 2024
54fc8ff
update echidna config
haythemsellami Jul 3, 2024
183e275
update echidna config
haythemsellami Jul 3, 2024
8ee4b59
update echidna config
haythemsellami Jul 3, 2024
3eba2f3
update
haythemsellami Jul 3, 2024
25a2739
update
haythemsellami Jul 4, 2024
327729e
invariants: gulp
haythemsellami Jul 4, 2024
788a096
update config
haythemsellami Jul 4, 2024
22552d5
Merge pull request #34 from euler-xyz/invariants-test
haythemsellami Jul 4, 2024
9369073
rename to Euler Aggregation Vault
haythemsellami Jul 4, 2024
9f7e14e
Merge pull request #35 from euler-xyz/rename
haythemsellami Jul 4, 2024
0994bab
gulp only if min amount is minted
haythemsellami Jul 5, 2024
6b7546f
add invariant
haythemsellami Jul 5, 2024
4bda9ba
gulp fuzzing
haythemsellami Jul 5, 2024
59c4590
Merge pull request #36 from euler-xyz/fix/min-amount-to-gulp
haythemsellami Jul 5, 2024
85a99db
test: gulp fuzzing
haythemsellami Jul 5, 2024
0d16a98
add invariant and comments
haythemsellami Jul 5, 2024
cb4951b
feat: whitelisted withdrawal queue
haythemsellami Jul 8, 2024
298c6ab
fix
haythemsellami Jul 8, 2024
79788a7
clean; add events
haythemsellami Jul 8, 2024
d0d1c96
add slither
haythemsellami Jul 8, 2024
d889ad0
clean
haythemsellami Jul 8, 2024
a88bc5a
clean
haythemsellami Jul 8, 2024
384afb8
Merge pull request #37 from euler-xyz/feat/whitelisted-withdrawal-que…
haythemsellami Jul 8, 2024
1fc4174
chore: delete slither.db.json
haythemsellami Jul 9, 2024
04e1fea
clean; add invariants tests
haythemsellami Jul 9, 2024
d29a1ef
Merge pull request #38 from euler-xyz/clean
haythemsellami Jul 10, 2024
da4f193
feat: do not harvest or rebalance in-active strategies
haythemsellami Jul 10, 2024
9c43041
chore: lint
haythemsellami Jul 10, 2024
735fdd0
circuit-breaker
haythemsellami Jul 10, 2024
2faacf8
chore: lint
haythemsellami Jul 10, 2024
3aeadbf
merge strategy added and remover into strategy operator
haythemsellami Jul 10, 2024
9522d10
add startegy status
haythemsellami Jul 10, 2024
20bfc1c
refactor
haythemsellami Jul 11, 2024
bafa48e
deduct losses when set strategy in emergency mode
haythemsellami Jul 12, 2024
1093fd8
fix
haythemsellami Jul 12, 2024
2abe33a
refactor
haythemsellami Jul 12, 2024
80b8a19
improve invariants
haythemsellami Jul 12, 2024
cff5495
lint
haythemsellami Jul 12, 2024
3b2ff39
more tests
haythemsellami Jul 12, 2024
599a5a2
rename to StrategyModule; add tests
haythemsellami Jul 15, 2024
15c965f
chore: lint
haythemsellami Jul 15, 2024
6708cb0
set allocated to maxWithdraw()
haythemsellami Jul 16, 2024
c993480
Merge pull request #39 from euler-xyz/feat/circuit-breaker
haythemsellami Jul 17, 2024
f7cc381
fix fuzz tests
haythemsellami Jul 17, 2024
5a30dbb
fix role setup
haythemsellami Jul 17, 2024
18bb998
remove --sizes from CI
haythemsellami Jul 17, 2024
efa5eda
test: voting power invariant
haythemsellami Jul 18, 2024
fc2fcad
Rebalance module
haythemsellami Jul 18, 2024
ba90148
refactor: remove Rebalancer plugin and add Rebalance module
haythemsellami Jul 19, 2024
3fe8e39
clean
haythemsellami Jul 19, 2024
299949e
update modifiers order
haythemsellami Jul 19, 2024
daaa6bd
add _gulp() into Shared.sol
haythemsellami Jul 19, 2024
55ea44f
remove whitelisting of WithdrawalQueue
haythemsellami Jul 21, 2024
f61b867
Refactor factory
haythemsellami Jul 21, 2024
0c95eb2
chore: add echidna to CI
haythemsellami Jul 21, 2024
94b5414
add gulping
haythemsellami Jul 22, 2024
585bce3
fix
haythemsellami Jul 22, 2024
0ab9e1c
update
haythemsellami Jul 22, 2024
45ff916
fix invariant_votingPower
haythemsellami Jul 22, 2024
c3fd0d1
fix
haythemsellami Jul 22, 2024
ba95957
chore: update CI
haythemsellami Jul 23, 2024
668c73e
chore: update CI
haythemsellami Jul 23, 2024
f9fe32a
chore: update CI
haythemsellami Jul 23, 2024
2e52990
chore: update CI
haythemsellami Jul 23, 2024
fce8181
chore: update CI
haythemsellami Jul 23, 2024
f53a553
use default testLimit
haythemsellami Jul 23, 2024
6af81ca
Refactor factory
haythemsellami Jul 23, 2024
4bc449c
refactor
haythemsellami Jul 23, 2024
4c93aec
fit Strategy struct in one slot
haythemsellami Jul 23, 2024
d8b9144
refactor
haythemsellami Jul 24, 2024
07f0cd4
Merge pull request #43 from euler-xyz/fix/refactor-codebase
haythemsellami Jul 24, 2024
5052879
add sizes check to CI
haythemsellami Jul 24, 2024
5507358
clean
haythemsellami Jul 24, 2024
2e0e155
Merge pull request #41 from euler-xyz/feat/erc20votes
haythemsellami Jul 24, 2024
d8b61d5
Merge branch 'main' into chore/add-echidna-CI
haythemsellami Jul 24, 2024
db658b2
Merge pull request #44 from euler-xyz/chore/add-echidna-CI
haythemsellami Jul 24, 2024
d581e67
Remove plugin
haythemsellami Jul 25, 2024
8a5283a
import WithdrawalQueueModule
haythemsellami Jul 25, 2024
bde1183
clean
haythemsellami Jul 25, 2024
7392b00
refactor
haythemsellami Jul 25, 2024
a632098
refactor hooks storage
haythemsellami Jul 25, 2024
d74f60e
Merge pull request #45 from euler-xyz/remove-plugin
haythemsellami Jul 25, 2024
3de0031
Refactor _deductLoss()
haythemsellami Jul 25, 2024
a18db08
clean
haythemsellami Jul 26, 2024
4ee8e24
lint
haythemsellami Jul 26, 2024
44b7b47
clean
haythemsellami Jul 26, 2024
9a6c460
clean
haythemsellami Jul 26, 2024
b808a39
Merge pull request #46 from euler-xyz/refactor-deduct-loss
haythemsellami Jul 26, 2024
fcade52
Feat: mint fee shares
haythemsellami Jul 30, 2024
5e3f1bd
fix test:
haythemsellami Jul 30, 2024
7c26e98
fix invariants
haythemsellami Jul 30, 2024
5c05f3d
fix
haythemsellami Jul 30, 2024
b8f1162
fix
haythemsellami Jul 30, 2024
1237522
fix
haythemsellami Jul 30, 2024
a50bfef
fix
haythemsellami Jul 30, 2024
7751a08
fix
haythemsellami Jul 30, 2024
7041292
fix
haythemsellami Jul 30, 2024
cf6851c
Merge pull request #48 from euler-xyz/fix/ci
haythemsellami Jul 31, 2024
25ea7d0
chore: commentS
haythemsellami Jul 31, 2024
2bfb7a9
Merge pull request #47 from euler-xyz/feat/mint-fee
haythemsellami Jul 31, 2024
53de3ac
Change performanceFee to uint96
haythemsellami Jul 31, 2024
a0c696f
feat: harvest cooldown
haythemsellami Aug 1, 2024
f4c2caf
remove gulp after withdraW
haythemsellami Aug 1, 2024
e660347
improve invariants
haythemsellami Aug 1, 2024
1a5ee69
update test:
haythemsellami Aug 5, 2024
ea8f01e
Merge pull request #49 from euler-xyz/feat/harvest-interval
haythemsellami Aug 5, 2024
1fe9f9d
chore: update EVC dependency
haythemsellami Aug 5, 2024
9be83cd
feat: EVC integration
haythemsellami Aug 5, 2024
542d1d3
Add onlyEVCAccountOwner() modifier
haythemsellami Aug 6, 2024
4fcc7fe
chore: update dependency
haythemsellami Aug 6, 2024
4f3c54b
Merge pull request #50 from euler-xyz/evc-integration
haythemsellami Aug 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/echidna.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Echidna Test

on:
push:
branches:
- main
pull_request:

env:
FOUNDRY_PROFILE: ci

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Compile contracts
run: |
forge build --build-info

- name: Run Echidna
uses: crytic/echidna-action@v2
with:
files: .
contract: CryticERC4626TestsHarness
# crytic-args: --ignore-compile
config: test/echidna/config/echidna.config.yaml
31 changes: 31 additions & 0 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Slither Analysis

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Run Slither
uses: crytic/[email protected]
id: slither
with:
node-version: 16
sarif: results.sarif
fail-on: high
continue-on-error : true
70 changes: 39 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
name: test
name: Foundry

on: workflow_dispatch

env:
FOUNDRY_PROFILE: ci
on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run foundry build
run: forge build --force --skip test --sizes

- name: Run foundry fmt check
run: forge fmt --check

- name: Run foundry tests
run: FOUNDRY_PROFILE=test forge test

- name: Run foundry fuzzing
run: FOUNDRY_PROFILE=ci_fuzz forge test

- name: Run foundry coverage
run: FOUNDRY_PROFILE=coverage forge coverage --report summary

- name: Run foundry invariants
run: forge clean && FOUNDRY_PROFILE=invariant forge test
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,17 @@ docs/

# Dotenv file
.env

# coverage
lcov.info
coverage

# gas
.gas-snapshot

# echidna
crytic-export/
/test/echidna/_corpus/

# slither
slither.db.json
25 changes: 25 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/ethereum-vault-connector"]
path = lib/ethereum-vault-connector
url = https://github.com/euler-xyz/ethereum-vault-connector
[submodule "lib/euler-vault-kit"]
path = lib/euler-vault-kit
url = https://github.com/euler-xyz/euler-vault-kit

[submodule "lib/reward-streams"]
path = lib/reward-streams
url = https://github.com/euler-xyz/reward-streams
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests
[submodule "lib/properties"]
path = lib/properties
url = https://github.com/crytic/properties
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,8 @@ $ forge fmt
$ forge snapshot
```

### Anvil
### Run Echidna

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
$ echidna test/echidna/CryticERC4626TestsHarness.t.sol --contract CryticERC4626TestsHarness --config test/echidna/config/echidna.config.yaml
```
36 changes: 36 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Make sure this script is executable. On Unix based systems, run "chmod +x coverage.sh".
# To run this script, type "./coverage.sh".

#!/bin/bash

set -e # exit on error

# check if lcov is installed, if not, execute installation
if ! command -v lcov &>/dev/null; then
echo "lcov is not installed. Installing..."
# check if its macos or linux.
if [ "$(uname)" == "Darwin" ]; then
brew install lcov

else
sudo apt-get install lcov
fi
fi
lcov --version

# generates lcov.info
FOUNDRY_PROFILE=coverage forge coverage --report lcov

# Generate summary
lcov \
--rc branch_coverage=1 \
--ignore-errors inconsistent \
--list lcov.info

# Open more granular breakdown in browser
genhtml \
--ignore-errors category \
--rc branch_coverage=1 \
--output-directory coverage \
lcov.info
open coverage/index.html
69 changes: 69 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,74 @@
src = "src"
out = "out"
libs = ["lib"]
test = 'test'
optimizer = true
optimizer_runs = 200
solc = "0.8.24"
gas_reports = ["*"]
fs_permissions = [{ access = "read", path = "./"}]

[profile.default.fmt]
line_length = 120
tab_width = 4
bracket_spacing = false
int_types = "long"
quote_style = "double"
number_underscore = "preserve"
override_spacing = true
ignore = [
"src/core/lib/StorageLib.sol"
]

[profile.test]
no_match_test = "(Fuzz|invariant_)"
no_match_contract = "(Fuzz|CryticERC4626TestsHarness)"
gas_reports = ["*"]

[profile.fuzz]
runs = 1000
max_local_rejects = 1024
max_global_rejects = 65536
seed = '0x3e8'
dictionary_weight = 100
include_storage = true
include_push_bytes = true
match_test = "Fuzz"
match_contract = "Fuzz"

[profile.ci_fuzz]
runs = 50000
max_local_rejects = 1024
max_global_rejects = 65536
seed = '0x3e8'
dictionary_weight = 100
include_storage = true
include_push_bytes = true
match_test = "Fuzz"
match_contract = "Fuzz"

[profile.invariant]
runs = 256
depth = 500
fail_on_revert = false
call_override = false
dictionary_weight = 80
include_storage = true
include_push_bytes = true
match_test = "invariant_"

[profile.coverage]
via_ir = true
no_match_test = "(invariant_)"
no_match_contract = "(Script|CryticERC4626TestsHarness)"
no_match_coverage= "(script|test|fuzz|e2e)"

[profile.coverage.optimizer_details]
constantOptimizer = true
yul = true

[profile.coverage.optimizer_details.yulDetails]
stackAllocation = true
optimizerSteps = ''

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 1 addition & 0 deletions lib/erc4626-tests
Submodule erc4626-tests added at 8b1d7c
1 change: 1 addition & 0 deletions lib/ethereum-vault-connector
1 change: 1 addition & 0 deletions lib/euler-vault-kit
Submodule euler-vault-kit added at f6fd0e
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at 52715a
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at dbb610
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
1 change: 1 addition & 0 deletions lib/properties
Submodule properties added at bb1b78
1 change: 1 addition & 0 deletions lib/reward-streams
Submodule reward-streams added at 66aafc
9 changes: 9 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
erc4626-tests/=lib/erc4626-tests/
ethereum-vault-connector/=lib/ethereum-vault-connector/src/
forge-std/=lib/forge-std/src/
evk/=lib/euler-vault-kit/
reward-streams=lib/reward-streams/src
openzeppelin-contracts/=lib/reward-streams/lib/openzeppelin-contracts/contracts
@openzeppelin/=lib/openzeppelin-contracts/
@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
crytic-properties/=lib/properties/contracts/
12 changes: 0 additions & 12 deletions script/Counter.s.sol

This file was deleted.

Loading
Loading