Skip to content

Commit 0b238a5

Browse files
pcaversaccioAmxx
authored andcommitted
Minor wording fixes ERC4626 contract (#3510)
(cherry picked from commit b159b3f) Signed-off-by: Hadrien Croubois <[email protected]>
1 parent e4748fb commit 0b238a5

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

contracts/token/ERC20/extensions/ERC4626.sol

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,67 +35,67 @@ abstract contract ERC4626 is ERC20, IERC4626 {
3535
_asset = asset_;
3636
}
3737

38-
/** @dev See {IERC4262-asset} */
38+
/** @dev See {IERC4262-asset}. */
3939
function asset() public view virtual override returns (address) {
4040
return address(_asset);
4141
}
4242

43-
/** @dev See {IERC4262-totalAssets} */
43+
/** @dev See {IERC4262-totalAssets}. */
4444
function totalAssets() public view virtual override returns (uint256) {
4545
return _asset.balanceOf(address(this));
4646
}
4747

48-
/** @dev See {IERC4262-convertToShares} */
48+
/** @dev See {IERC4262-convertToShares}. */
4949
function convertToShares(uint256 assets) public view virtual override returns (uint256 shares) {
5050
return _convertToShares(assets, Math.Rounding.Down);
5151
}
5252

53-
/** @dev See {IERC4262-convertToAssets} */
53+
/** @dev See {IERC4262-convertToAssets}. */
5454
function convertToAssets(uint256 shares) public view virtual override returns (uint256 assets) {
5555
return _convertToAssets(shares, Math.Rounding.Down);
5656
}
5757

58-
/** @dev See {IERC4262-maxDeposit} */
58+
/** @dev See {IERC4262-maxDeposit}. */
5959
function maxDeposit(address) public view virtual override returns (uint256) {
6060
return _isVaultCollateralized() ? type(uint256).max : 0;
6161
}
6262

63-
/** @dev See {IERC4262-maxMint} */
63+
/** @dev See {IERC4262-maxMint}. */
6464
function maxMint(address) public view virtual override returns (uint256) {
6565
return type(uint256).max;
6666
}
6767

68-
/** @dev See {IERC4262-maxWithdraw} */
68+
/** @dev See {IERC4262-maxWithdraw}. */
6969
function maxWithdraw(address owner) public view virtual override returns (uint256) {
7070
return _convertToAssets(balanceOf(owner), Math.Rounding.Down);
7171
}
7272

73-
/** @dev See {IERC4262-maxRedeem} */
73+
/** @dev See {IERC4262-maxRedeem}. */
7474
function maxRedeem(address owner) public view virtual override returns (uint256) {
7575
return balanceOf(owner);
7676
}
7777

78-
/** @dev See {IERC4262-previewDeposit} */
78+
/** @dev See {IERC4262-previewDeposit}. */
7979
function previewDeposit(uint256 assets) public view virtual override returns (uint256) {
8080
return _convertToShares(assets, Math.Rounding.Down);
8181
}
8282

83-
/** @dev See {IERC4262-previewMint} */
83+
/** @dev See {IERC4262-previewMint}. */
8484
function previewMint(uint256 shares) public view virtual override returns (uint256) {
8585
return _convertToAssets(shares, Math.Rounding.Up);
8686
}
8787

88-
/** @dev See {IERC4262-previewWithdraw} */
88+
/** @dev See {IERC4262-previewWithdraw}. */
8989
function previewWithdraw(uint256 assets) public view virtual override returns (uint256) {
9090
return _convertToShares(assets, Math.Rounding.Up);
9191
}
9292

93-
/** @dev See {IERC4262-previewRedeem} */
93+
/** @dev See {IERC4262-previewRedeem}. */
9494
function previewRedeem(uint256 shares) public view virtual override returns (uint256) {
9595
return _convertToAssets(shares, Math.Rounding.Down);
9696
}
9797

98-
/** @dev See {IERC4262-deposit} */
98+
/** @dev See {IERC4262-deposit}. */
9999
function deposit(uint256 assets, address receiver) public virtual override returns (uint256) {
100100
require(assets <= maxDeposit(receiver), "ERC4626: deposit more than max");
101101

@@ -105,7 +105,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
105105
return shares;
106106
}
107107

108-
/** @dev See {IERC4262-mint} */
108+
/** @dev See {IERC4262-mint}. */
109109
function mint(uint256 shares, address receiver) public virtual override returns (uint256) {
110110
require(shares <= maxMint(receiver), "ERC4626: mint more than max");
111111

@@ -115,7 +115,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
115115
return assets;
116116
}
117117

118-
/** @dev See {IERC4262-withdraw} */
118+
/** @dev See {IERC4262-withdraw}. */
119119
function withdraw(
120120
uint256 assets,
121121
address receiver,
@@ -129,7 +129,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
129129
return shares;
130130
}
131131

132-
/** @dev See {IERC4262-redeem} */
132+
/** @dev See {IERC4262-redeem}. */
133133
function redeem(
134134
uint256 shares,
135135
address receiver,
@@ -144,7 +144,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
144144
}
145145

146146
/**
147-
* @dev Internal convertion function (from assets to shares) with support for rounding direction
147+
* @dev Internal conversion function (from assets to shares) with support for rounding direction.
148148
*
149149
* Will revert if assets > 0, totalSupply > 0 and totalAssets = 0. That corresponds to a case where any asset
150150
* would represent an infinite amout of shares.
@@ -158,7 +158,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
158158
}
159159

160160
/**
161-
* @dev Internal convertion function (from shares to assets) with support for rounding direction
161+
* @dev Internal conversion function (from shares to assets) with support for rounding direction.
162162
*/
163163
function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256 assets) {
164164
uint256 supply = totalSupply();
@@ -169,7 +169,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
169169
}
170170

171171
/**
172-
* @dev Deposit/mint common workflow
172+
* @dev Deposit/mint common workflow.
173173
*/
174174
function _deposit(
175175
address caller,
@@ -191,7 +191,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
191191
}
192192

193193
/**
194-
* @dev Withdraw/redeem common workflow
194+
* @dev Withdraw/redeem common workflow.
195195
*/
196196
function _withdraw(
197197
address caller,
@@ -204,7 +204,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
204204
_spendAllowance(owner, caller, shares);
205205
}
206206

207-
// If _asset is ERC777, `transfer` can trigger trigger a reentrancy AFTER the transfer happens through the
207+
// If _asset is ERC777, `transfer` can trigger a reentrancy AFTER the transfer happens through the
208208
// `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,
209209
// calls the vault, which is assumed not malicious.
210210
//

0 commit comments

Comments
 (0)