Skip to content

Commit

Permalink
Make ERC4626 _deposit and _withdraw internal virtual (OpenZeppelin#3504)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronhuafeng committed Sep 9, 2022
1 parent 6930321 commit 8ea4f56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/token/ERC20/extensions/ERC4626.sol
Expand Up @@ -175,7 +175,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 @@ -198,7 +198,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 8ea4f56

Please sign in to comment.