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

Merge feat/audit into main branch #97

Merged
merged 82 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
f5fa3ae
chore: remove unused contracts
samparsky Aug 15, 2023
25930df
chore: remove unused contracts
samparsky Aug 15, 2023
cf8f49c
chore: rename folder waterfall => owr
samparsky Aug 15, 2023
342e503
chore: add comments
samparsky Aug 16, 2023
25cc603
chore: add solidity-metrics audit doc
samparsky Aug 16, 2023
3f7eeff
chore: remove unused splitter contracts
samparsky Aug 21, 2023
2c4aebc
chore: apply forge fmt
samparsky Aug 24, 2023
41c3761
chore: additional formatting contracts
samparsky Aug 24, 2023
8f295ad
chore: remove unused variables
samparsky Sep 8, 2023
de2efdc
chore: apply forge fmt
samparsky Sep 8, 2023
9312908
chore: add imsc implementation and test
samparsky Aug 24, 2023
3d4fda9
feat: udpate imsc implementation and tests
samparsky Aug 29, 2023
f825942
chore: remove commented code, update natspec
samparsky Aug 29, 2023
6862e4e
chore: add owner access to update split function
samparsky Sep 11, 2023
72bea10
chore: update tests to include owner
samparsky Sep 11, 2023
63bead3
test: add revert owner,split address checks
samparsky Sep 11, 2023
dbeddc1
chore: fix error imsc factory
samparsky Sep 11, 2023
eaa578c
test: add owner address check to imsc fuzz test
samparsky Sep 11, 2023
168081d
chore: add imsc deployment script
samparsky Sep 13, 2023
c07ddd0
chore: add imscfactory deployment script
samparsky Sep 13, 2023
6d21497
chore: add deployment addresses to readme
samparsky Sep 13, 2023
f7a172a
chore: remove array createOWRecipient
samparsky Sep 11, 2023
4fa8650
chore: rename threshold to amountOfStake
samparsky Sep 11, 2023
f08ee4d
chore: rename claimedTrancheFunds to claimedPrincipalFunds
samparsky Sep 11, 2023
4ef1c85
chore: update owr implementation
samparsky Sep 11, 2023
6764bb3
chore: apply forge fmt
samparsky Sep 11, 2023
864ce57
chore: update comments
samparsky Sep 11, 2023
906ac58
chore: update formatting
samparsky Sep 11, 2023
b9e4a55
chore: remove unused code
samparsky Sep 11, 2023
61e6a37
chore: apply forge fmt
samparsky Sep 12, 2023
441da0d
test: rename waterfall folder => owr
samparsky Sep 15, 2023
8f94f0f
chore: remove unused vars
samparsky Sep 15, 2023
3448002
chore: upgrade solidity version 0.8.17 => 0.8.19
samparsky Sep 15, 2023
fdc4758
chore: fix solidity pragma lidosplitfactory
samparsky Sep 15, 2023
1aba419
chore: apply forge fmt, 0.8.17 => 0.8.19
samparsky Sep 15, 2023
b2c2a9b
chore: add zero address check to imsc constructor arg
samparsky Sep 15, 2023
b08baa2
test: add zero address test
samparsky Sep 15, 2023
50ce277
chore: apply forge fmt
samparsky Sep 15, 2023
6f2beae
chore: add IMSC recipients array size check #73
samparsky Sep 24, 2023
08b424d
chore: add split balance check #78
samparsky Sep 24, 2023
b832f75
test: fix IMSC and IMSCFactory test cases; add additional test case
samparsky Sep 26, 2023
62d4219
chore: move stETH and wstETH addresses to LidoSplit
samparsky Sep 26, 2023
5057aeb
chore: add rescueETH function to LidoSplit
samparsky Sep 26, 2023
82c2ac5
chore: change rescueETH to rescueFunds to enable rescue of tokens
samparsky Sep 26, 2023
8dadd78
test: fix LidoSplit test suite; add rescueFunds test cases
samparsky Sep 26, 2023
58fd2e4
chore: enable rescueFunds for wstETH
samparsky Sep 27, 2023
b27ba37
test: fix testCannot_RescueLidoTokens test case
samparsky Sep 27, 2023
c1c4fb7
chore: remove token from OWRFactory
samparsky Sep 24, 2023
e247737
chore: remove token from OWR implementation
samparsky Sep 24, 2023
431dcc4
chore: apply forge fmt
samparsky Sep 24, 2023
7202e26
chore: remove distributedFunds variable from OWR - issue #80
samparsky Sep 24, 2023
ce9ff71
mend
samparsky Sep 24, 2023
4332623
mend
samparsky Sep 24, 2023
2b770d8
test: fix OWR and OWRFactory test cases
samparsky Sep 24, 2023
c18bae5
mend
samparsky Sep 24, 2023
6e69d5d
chore: add _fundsToBeDistributed check; test: add OWR distribution to…
samparsky Sep 27, 2023
4a18a8d
test: fix testCannot_distributeTooMuch test case
samparsky Sep 27, 2023
9353f28
chore: add remapping, update solady module version
samparsky Sep 28, 2023
2df88b6
chore: update Lido.rescueFunds natspec; change transfer to safetransfer
samparsky Sep 28, 2023
f6e9842
chore: change claimedPrinicipalFunds to uint128
samparsky Oct 2, 2023
49dce61
chore: add _principalPayout > 0 check
samparsky Oct 2, 2023
2f4f059
chore: remove unchecked block _fundsToBeDistributed
samparsky Oct 2, 2023
c28b4b7
chore: add reverse ens registrar to OWRFactory
samparsky Oct 2, 2023
e83ef75
test: fix OWRFactory test cases
samparsky Oct 4, 2023
2f0b5b4
test: mock Ensreverseregistrar calls
samparsky Oct 5, 2023
3539195
chore: add feeReceipient to lidosplit
samparsky Oct 5, 2023
ba58cb8
test: fix lido test cases
samparsky Oct 9, 2023
7eec2a8
chore: add wstETH check to rescueFunds; use balanceOf wstETH to calcu…
samparsky Oct 9, 2023
160fa7f
test: add lido fee test cases
samparsky Oct 9, 2023
2d4f7a2
test: add fuzz fee share lidoSplit test case
samparsky Oct 9, 2023
85badd1
chore: move IwSTETH to a separate file
samparsky Oct 9, 2023
be22fe0
chore: rename IwstETH.sol
samparsky Oct 9, 2023
e88212a
chore: fix IwstETH.sol path
samparsky Oct 9, 2023
0cadf7f
chore: fix IwstETH.sol path
samparsky Oct 9, 2023
e5e100e
chore: fix IwstETH.sol path
samparsky Oct 9, 2023
4a7a713
chore: rename lidosplit => obollidosplit
samparsky Oct 9, 2023
8e441a0
chore: update obollidosplit audit docs
samparsky Oct 16, 2023
45589b8
chore: change IMSC license
samparsky Oct 16, 2023
864f816
chore: change obollido licenses
samparsky Oct 16, 2023
ec6a5f6
chore: add fuzz fee recipient check to testFuzz_CanDistributeWithFee
samparsky Oct 16, 2023
136283f
chore: change fuzz runs to 100
samparsky Oct 16, 2023
b8ebdfd
chore: change test files licenses to gpl
samparsky Oct 16, 2023
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/vectorized/solady
branch = v0.0.92
branch = v0.0.123
[submodule "lib/splits-utils"]
path = lib/splits-utils
url = https://github.com/0xSplits/splits-utils
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"solidity.packageDefaultDependenciesContractsDirectory": "src",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.compileUsingRemoteVersion": "v0.8.17+commit.8df45f5f",
"solidity.compileUsingRemoteVersion": "v0.8.19",
"solidity.defaultCompiler": "remote"
}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ This repo can be deployed with `forge create` or running the deployment scripts.

#### Goerli

OptimisticWithdrawalRecipient: https://goerli.etherscan.io/address/0x7b4b2cbbdac4f9b70252503a411574f4ff960e68
OptimisticWithdrawalRecipient: https://goerli.etherscan.io/address/0xBB3b6CC2882B73eeFb32284Ecc9035839fb2C908

OptimisticWithdrawalRecipientFactory: https://goerli.etherscan.io/address/0xBB3b6CC2882B73eeFb32284Ecc9035839fb2C908
OptimisticWithdrawalRecipientFactory: https://goerli.etherscan.io/address/0x7b4b2cbbdac4f9b70252503a411574f4ff960e68

ImmutableSplitControllerFactory: https://goerli.etherscan.io/address/0x64a2c4A50B1f46c3e2bF753CFe270ceB18b5e18f

ImmutableSplitController: https://goerli.etherscan.io/address/0x009894cdA6cB6d99866ca8E04e8EDeabd625712F

### Versioning

Expand Down
272 changes: 272 additions & 0 deletions docs/audit/ObolLidoSplit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@

[<img width="200" alt="get in touch with Consensys Diligence" src="https://user-images.githubusercontent.com/2865694/56826101-91dcf380-685b-11e9-937c-af49c2510aa0.png">](https://diligence.consensys.net)<br/>
<sup>
[[ 🌐 ](https://diligence.consensys.net) [ 📩 ](mailto:[email protected]) [ 🔥 ](https://consensys.github.io/diligence/)]
</sup><br/><br/>



# Solidity Metrics for 'CLI'

## Table of contents

- [Scope](#t-scope)
- [Source Units in Scope](#t-source-Units-in-Scope)
- [Out of Scope](#t-out-of-scope)
- [Excluded Source Units](#t-out-of-scope-excluded-source-units)
- [Duplicate Source Units](#t-out-of-scope-duplicate-source-units)
- [Doppelganger Contracts](#t-out-of-scope-doppelganger-contracts)
- [Report Overview](#t-report)
- [Risk Summary](#t-risk)
- [Source Lines](#t-source-lines)
- [Inline Documentation](#t-inline-documentation)
- [Components](#t-components)
- [Exposed Functions](#t-exposed-functions)
- [StateVariables](#t-statevariables)
- [Capabilities](#t-capabilities)
- [Dependencies](#t-package-imports)
- [Totals](#t-totals)

## <span id=t-scope>Scope</span>

This section lists files that are in scope for the metrics report.

- **Project:** `'CLI'`
- **Included Files:**
- ``
- **Excluded Paths:**
- ``
- **File Limit:** `undefined`
- **Exclude File list Limit:** `undefined`

- **Workspace Repository:** `unknown` (`undefined`@`undefined`)

### <span id=t-source-Units-in-Scope>Source Units in Scope</span>

Source Units Analyzed: **`1`**<br>
Source Units in Scope: **`1`** (**100%**)

| Type | File | Logic Contracts | Interfaces | Lines | nLines | nSLOC | Comment Lines | Complex. Score | Capabilities |
| ---- | ------ | --------------- | ---------- | ----- | ------ | ----- | ------------- | -------------- | ------------ |
| 📝 | src/lido/ObolLidoSplit.sol | 1 | **** | 117 | 117 | 53 | 46 | 59 | **** |
| 📝 | **Totals** | **1** | **** | **117** | **117** | **53** | **46** | **59** | **** |

<sub>
Legend: <a onclick="toggleVisibility('table-legend', this)">[➕]</a>
<div id="table-legend" style="display:none">

<ul>
<li> <b>Lines</b>: total lines of the source unit </li>
<li> <b>nLines</b>: normalized lines of the source unit (e.g. normalizes functions spanning multiple lines) </li>
<li> <b>nSLOC</b>: normalized source lines of code (only source-code lines; no comments, no blank lines) </li>
<li> <b>Comment Lines</b>: lines containing single or block comments </li>
<li> <b>Complexity Score</b>: a custom complexity score derived from code statements that are known to introduce code complexity (branches, loops, calls, external interfaces, ...) </li>
</ul>

</div>
</sub>


#### <span id=t-out-of-scope>Out of Scope</span>

##### <span id=t-out-of-scope-excluded-source-units>Excluded Source Units</span>

Source Units Excluded: **`0`**

<a onclick="toggleVisibility('excluded-files', this)">[➕]</a>
<div id="excluded-files" style="display:none">
| File |
| ------ |
| None |

</div>


##### <span id=t-out-of-scope-duplicate-source-units>Duplicate Source Units</span>

Duplicate Source Units Excluded: **`0`**

<a onclick="toggleVisibility('duplicate-files', this)">[➕]</a>
<div id="duplicate-files" style="display:none">
| File |
| ------ |
| None |

</div>

##### <span id=t-out-of-scope-doppelganger-contracts>Doppelganger Contracts</span>

Doppelganger Contracts: **`0`**

<a onclick="toggleVisibility('doppelganger-contracts', this)">[➕]</a>
<div id="doppelganger-contracts" style="display:none">
| File | Contract | Doppelganger |
| ------ | -------- | ------------ |


</div>


## <span id=t-report>Report</span>

### Overview

The analysis finished with **`0`** errors and **`0`** duplicate files.





#### <span id=t-risk>Risk</span>

<div class="wrapper" style="max-width: 512px; margin: auto">
<canvas id="chart-risk-summary"></canvas>
</div>

#### <span id=t-source-lines>Source Lines (sloc vs. nsloc)</span>

<div class="wrapper" style="max-width: 512px; margin: auto">
<canvas id="chart-nsloc-total"></canvas>
</div>

#### <span id=t-inline-documentation>Inline Documentation</span>

- **Comment-to-Source Ratio:** On average there are`1.15` code lines per comment (lower=better).
- **ToDo's:** `0`

#### <span id=t-components>Components</span>

| 📝Contracts | 📚Libraries | 🔍Interfaces | 🎨Abstract |
| ------------- | ----------- | ------------ | ---------- |
| 1 | 0 | 0 | 0 |

#### <span id=t-exposed-functions>Exposed Functions</span>

This section lists functions that are explicitly declared public or payable. Please note that getter methods for public stateVars are not included.

| 🌐Public | 💰Payable |
| ---------- | --------- |
| 3 | 0 |

| External | Internal | Private | Pure | View |
| ---------- | -------- | ------- | ---- | ---- |
| 2 | 3 | 0 | 1 | 0 |

#### <span id=t-statevariables>StateVariables</span>

| Total | 🌐Public |
| ---------- | --------- |
| 7 | 4 |

#### <span id=t-capabilities>Capabilities</span>

| Solidity Versions observed | 🧪 Experimental Features | 💰 Can Receive Funds | 🖥 Uses Assembly | 💣 Has Destroyable Contracts |
| -------------------------- | ------------------------ | -------------------- | ---------------- | ---------------------------- |
| `0.8.19` | | **** | **** | **** |

| 📤 Transfers ETH | ⚡ Low-Level Calls | 👥 DelegateCall | 🧮 Uses Hash Functions | 🔖 ECRecover | 🌀 New/Create/Create2 |
| ---------------- | ----------------- | --------------- | ---------------------- | ------------ | --------------------- |
| **** | **** | **** | **** | **** | **** |

| ♻️ TryCatch | Σ Unchecked |
| ---------- | ----------- |
| **** | **** |

#### <span id=t-package-imports>Dependencies / External Imports</span>

| Dependency / Import Path | Count |
| ------------------------ | ------ |
| solady/utils/Clone.sol | 1 |
| solmate/tokens/ERC20.sol | 1 |
| solmate/utils/SafeTransferLib.sol | 1 |
| src/interfaces/IwstETH.sol | 1 |

#### <span id=t-totals>Totals</span>

##### Summary

<div class="wrapper" style="max-width: 90%; margin: auto">
<canvas id="chart-num-bar"></canvas>
</div>

##### AST Node Statistics

###### Function Calls

<div class="wrapper" style="max-width: 90%; margin: auto">
<canvas id="chart-num-bar-ast-funccalls"></canvas>
</div>

###### Assembly Calls

<div class="wrapper" style="max-width: 90%; margin: auto">
<canvas id="chart-num-bar-ast-asmcalls"></canvas>
</div>

###### AST Total

<div class="wrapper" style="max-width: 90%; margin: auto">
<canvas id="chart-num-bar-ast"></canvas>
</div>

##### Inheritance Graph

<a onclick="toggleVisibility('surya-inherit', this)">[➕]</a>
<div id="surya-inherit" style="display:none">
<div class="wrapper" style="max-width: 512px; margin: auto">
<div id="surya-inheritance" style="text-align: center;"></div>
</div>
</div>

##### CallGraph

<a onclick="toggleVisibility('surya-call', this)">[➕]</a>
<div id="surya-call" style="display:none">
<div class="wrapper" style="max-width: 512px; margin: auto">
<div id="surya-callgraph" style="text-align: center;"></div>
</div>
</div>

###### Contract Summary

<a onclick="toggleVisibility('surya-mdreport', this)">[➕]</a>
<div id="surya-mdreport" style="display:none">
Sūrya's Description Report

Files Description Table


| File Name | SHA-1 Hash |
|-------------|--------------|
| src/lido/ObolLidoSplit.sol | e60ac5c37593dd7b11dc04af62baa7b122e98ed5 |


Contracts Description Table


| Contract | Type | Bases | | |
|:----------:|:-------------------:|:----------------:|:----------------:|:---------------:|
| └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** |
||||||
| **ObolLidoSplit** | Implementation | Clone |||
| └ | <Constructor> | Public ❗️ | 🛑 |NO❗️ |
| └ | splitWallet | Public ❗️ | |NO❗️ |
| └ | distribute | External ❗️ | 🛑 |NO❗️ |
| └ | rescueFunds | External ❗️ | 🛑 |NO❗️ |


Legend

| Symbol | Meaning |
|:--------:|-----------|
| 🛑 | Function can modify state |
| 💵 | Function is payable |


</div>
____
<sub>
Thinking about smart contract security? We can provide training, ongoing advice, and smart contract auditing. [Contact us](https://diligence.consensys.net/contact/).
</sub>


Loading
Loading