Skip to content

Commit

Permalink
Make ERC4626 _deposit and _withdraw internal virtual (#3504)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7473872)
  • Loading branch information
Amxx authored and frangio committed Jun 24, 2022
1 parent 4307d74 commit b971092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/token/ERC20/extensions/ERC4626.sol
Expand Up @@ -176,7 +176,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
address receiver,
uint256 assets,
uint256 shares
) private {
) internal virtual {
// If _asset is ERC777, `transferFrom` can trigger a reenterancy BEFORE the transfer happens through the
// `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,
// calls the vault, which is assumed not malicious.
Expand All @@ -199,7 +199,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
address owner,
uint256 assets,
uint256 shares
) private {
) internal virtual {
if (caller != owner) {
_spendAllowance(owner, caller, shares);
}
Expand Down

0 comments on commit b971092

Please sign in to comment.