From d551c7aa19d9c6d5bee0be0c20bd12e1796a56f8 Mon Sep 17 00:00:00 2001 From: Skyge <1506186404li@gmail.com> Date: Mon, 23 Sep 2024 20:59:22 +0800 Subject: [PATCH 1/3] Fix typo in favor of. --- docs/modules/ROOT/pages/erc4626.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/erc4626.adoc b/docs/modules/ROOT/pages/erc4626.adoc index 977d8160632..79388c0a2e7 100644 --- a/docs/modules/ROOT/pages/erc4626.adoc +++ b/docs/modules/ROOT/pages/erc4626.adoc @@ -29,7 +29,7 @@ image::erc4626-rate-loglogext.png[More exchange rates in logarithmic scale] === The attack -When depositing tokens, the number of shares a user gets is rounded towards zero. This rounding takes away value from the user in favor or the vault (i.e. in favor of all the current share holders). This rounding is often negligible because of the amount at stake. If you deposit 1e9 shares worth of tokens, the rounding will have you lose at most 0.0000001% of your deposit. However if you deposit 10 shares worth of tokens, you could lose 10% of your deposit. Even worse, if you deposit <1 share worth of tokens, then you get 0 shares, and you basically made a donation. +When depositing tokens, the number of shares a user gets is rounded towards zero. This rounding takes away value from the user in favor of the vault (i.e. in favor of all the current share holders). This rounding is often negligible because of the amount at stake. If you deposit 1e9 shares worth of tokens, the rounding will have you lose at most 0.0000001% of your deposit. However if you deposit 10 shares worth of tokens, you could lose 10% of your deposit. Even worse, if you deposit <1 share worth of tokens, then you get 0 shares, and you basically made a donation. For a given amount of assets, the more shares you receive the safer you are. If you want to limit your losses to at most 1%, you need to receive at least 100 shares. From bdd02cf6e5ee1282de0c65d681e894cadc595be5 Mon Sep 17 00:00:00 2001 From: Skyge <1506186404li@gmail.com> Date: Mon, 23 Sep 2024 21:17:29 +0800 Subject: [PATCH 2/3] Add changelog entries. --- .changeset/ten-seahorses-whisper.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/ten-seahorses-whisper.md diff --git a/.changeset/ten-seahorses-whisper.md b/.changeset/ten-seahorses-whisper.md new file mode 100644 index 00000000000..55d33e83fd7 --- /dev/null +++ b/.changeset/ten-seahorses-whisper.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +Fix typo in erc4626 docs From 907b2ff04084bca735c5eaa707d18dd93cfdbe1f Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 23 Sep 2024 15:48:19 +0200 Subject: [PATCH 3/3] Delete .changeset/ten-seahorses-whisper.md --- .changeset/ten-seahorses-whisper.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/ten-seahorses-whisper.md diff --git a/.changeset/ten-seahorses-whisper.md b/.changeset/ten-seahorses-whisper.md deleted file mode 100644 index 55d33e83fd7..00000000000 --- a/.changeset/ten-seahorses-whisper.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'openzeppelin-solidity': minor ---- - -Fix typo in erc4626 docs