Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ERC4626 _deposit and _withdraw internal virtual #3504

Merged
merged 1 commit into from Jun 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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