Skip to content

Commit 5099a78

Browse files
committed
Update weird characters
1 parent c8487a9 commit 5099a78

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

packages/nextjs/guides/erc-4626-vaults.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ image: "/assets/guides/erc4626-vaults.jpg"
66

77
## TL;DR:
88

9-
- **ERC4626 standardizes tokenized vaults**: deposit assets, mint shares; redeem shares for assets.
9+
- **ERC4626 standardizes tokenized vaults**: deposit assets, mint shares, then redeem shares for assets.
1010
- **Security hinges on `totalAssets()`**: it drives pricing for `convertToShares`/`convertToAssets`.
1111
- **Top risks**: first-depositor inflation, reentrancy, fee-on-transfer/rebasing tokens, oracle manipulation, rounding drift.
12-
- **Custom features** (fees, caps, queues, RBAC) add complexity—design cautiously, test heavily.
12+
- **Custom features** (fees, caps, queues, RBAC) add complexity. Design cautiously, test heavily.
1313
- **Build with audited libs**, implement CEI + reentrancy guards, and write invariants/fuzz tests.
1414

1515
---
@@ -29,7 +29,7 @@ Core interface highlights:
2929
3030
![ERC4626 asset/share flow with strategy yield loop](/assets/guides/erc4626-asset-share-flow-diagram.png)
3131

32-
_Figure: ERC4626 flowdeposit assets to mint shares; redeem shares to withdraw assets; strategies feed yield back to the vault._
32+
_Figure: ERC4626 flow: deposit assets to mint shares, redeem shares to withdraw assets, and strategies feed yield back to the vault._
3333

3434
---
3535

@@ -51,7 +51,7 @@ Best practices:
5151

5252
![Sequence: deposit/redeem using totalAssets with oracle sanity checks](/assets/guides/erc4626-totalassets-oracle-sequence-diagram.png)
5353

54-
_Figure: totalAssets() drives conversions; oracle reads should be sanity-checked and resistant to manipulation._
54+
_Figure: totalAssets() drives conversions, and oracle reads should be sanity-checked and resistant to manipulation._
5555

5656
---
5757

@@ -70,62 +70,62 @@ _Figure: totalAssets() drives conversions; oracle reads should be sanity-checked
7070
<tr>
7171
<td><strong>Share Price Manipulation</strong></td>
7272
<td>First depositor mints 1 share, then sends large assets directly</td>
73-
<td>Subsequent users get tiny shares; attacker exits with most assets</td>
74-
<td>Seed with non-trivial liquidity; virtual shares/assets; min deposit; make `totalAssets()` robust</td>
73+
<td>Subsequent users get tiny shares and the attacker exits with most assets</td>
74+
<td>Seed with non-trivial liquidity, use virtual shares/assets, require a minimum deposit, and make `totalAssets()` robust</td>
7575
</tr>
7676
<tr>
7777
<td><strong>Direct Transfers to Vault</strong></td>
7878
<td>Assets sent to vault address outside `deposit()`</td>
7979
<td>Skews `totalAssets()` and share pricing if not reconciled</td>
80-
<td>Reconcile external transfers; ignore unsolicited assets or treat via controlled accounting</td>
80+
<td>Reconcile external transfers, ignore unsolicited assets, or handle them with controlled accounting</td>
8181
</tr>
8282
<tr>
8383
<td><strong>Reentrancy</strong></td>
8484
<td>ERC777 hooks or external calls inside hooks</td>
8585
<td>State corruption, theft</td>
86-
<td>CEI pattern; `nonReentrant`; minimize/guard external calls</td>
86+
<td>Follow CEI and `nonReentrant`, and minimize or guard external calls</td>
8787
</tr>
8888
<tr>
8989
<td><strong>Hook-based Reentrancy</strong></td>
9090
<td>Custom `beforeWithdraw`/`afterDeposit` hooks call out</td>
9191
<td>Cross-function reentry into sensitive logic</td>
92-
<td>Avoid external calls in hooks; or guard hook paths with `nonReentrant` and strict CEI</td>
92+
<td>Avoid external calls in hooks, or guard hook paths with `nonReentrant` and strict CEI</td>
9393
</tr>
9494
<tr>
9595
<td><strong>Non-standard Assets</strong></td>
9696
<td>Fee-on-transfer or rebasing tokens</td>
9797
<td>Price drift, accounting mismatches</td>
98-
<td>Use actual-received amounts; adapt math to rebasing; prefer wrapped or disallow</td>
98+
<td>Use actual-received amounts, adapt math to rebasing, and prefer wrapped tokens or disallow incompatible assets</td>
9999
</tr>
100100
<tr>
101101
<td><strong>Oracle Manipulation</strong></td>
102102
<td>Spot price manipulation or downtime</td>
103103
<td>Cheap mints / expensive redemptions</td>
104-
<td>Decentralized oracles; TWAPs; deviation checks; circuit breakers</td>
104+
<td>Use decentralized oracles, TWAPs, deviation checks, and circuit breakers</td>
105105
</tr>
106106
<tr>
107107
<td><strong>Rounding & Precision</strong></td>
108108
<td>Integer division in conversions</td>
109109
<td>Dust accumulation, unfairness</td>
110-
<td>Multiply before divide; conservative rounding; fuzz tests</td>
110+
<td>Multiply before divide, use conservative rounding, and add fuzz tests</td>
111111
</tr>
112112
<tr>
113113
<td><strong>DoS & Gas</strong></td>
114114
<td>Complex strategies in deposit/withdraw</td>
115115
<td>TX failures under load</td>
116-
<td>Optimize strategies; isolate heavy ops; profile gas</td>
116+
<td>Optimize strategies, isolate heavy operations, and profile gas</td>
117117
</tr>
118118
<tr>
119119
<td><strong>Malicious Token Behavior</strong></td>
120120
<td>Tokens revert/blacklist on `transfer/transferFrom`</td>
121121
<td>Deposits/withdrawals can brick</td>
122-
<td>Vet assets; use `SafeERC20`; allow admin to disable/unwrap problematic tokens</td>
122+
<td>Vet assets, use `SafeERC20`, and allow admins to disable or unwrap problematic tokens</td>
123123
</tr>
124124
<tr>
125125
<td><strong>MEV Timing / Front-running</strong></td>
126126
<td>Front-running deposits before a large, profitable `harvest()` and back-running withdrawals immediately after</td>
127127
<td>Attacker captures yield without long-term risk, diluting returns for legitimate LPs</td>
128-
<td>Smooth accruals over time; use private transactions for harvests (e.g., Flashbots); short-term withdrawal lockups/fees</td>
128+
<td>Smooth accruals over time, use private transactions for harvests (for example, Flashbots), and consider short-term withdrawal lockups or fees</td>
129129
</tr>
130130
</tbody>
131131
</table>
@@ -144,7 +144,7 @@ _Figure: totalAssets() drives conversions; oracle reads should be sanity-checked
144144

145145
![Customization flow: caps, harvest, fee accrual/sweep, RBAC controls](/assets/guides/erc4626-customization-caps-fees-rbac-diagram.png)
146146

147-
_Figure: Customization flow with caps, fee accrual/sweep, and RBAC controls._
147+
_Figure: Customization flow with caps, fee accrual and sweep, and RBAC controls._
148148

149149
## 5. Solidity Example: Guarded Deposit/Withdraw Skeleton
150150

@@ -198,7 +198,7 @@ contract SecureVault is ReentrancyGuard {
198198

199199
![CEI + nonReentrant deposit/withdraw with previews and token transfers](/assets/guides/erc4626-cei-nonreentrant-sequence-diagram.png)
200200

201-
_Figure: CEI + nonReentrant skeletonpreviews drive pricing; token transfers occur after state calculations._
201+
_Figure: CEI + nonReentrant skeleton: previews drive pricing, and token transfers occur after state calculations._
202202

203203
### Mini Snippets: Roles and Fee Sweep (Illustrative)
204204

0 commit comments

Comments
 (0)