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 AToken's initialize and _transfer functions virtual so they can be extended #774

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/protocol/tokenization/AToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
string calldata aTokenName,
string calldata aTokenSymbol,
bytes calldata params
) external override initializer {
) public virtual override initializer {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be public as well as virtual for extensions to be able to call super.initiailize(...)

require(initializingPool == POOL, Errors.POOL_ADDRESSES_DO_NOT_MATCH);
_setName(aTokenName);
_setSymbol(aTokenSymbol);
Expand Down Expand Up @@ -208,7 +208,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
address to,
uint256 amount,
bool validate
) internal {
) internal virtual {
address underlyingAsset = _underlyingAsset;

uint256 index = POOL.getReserveNormalizedIncome(underlyingAsset);
Expand All @@ -235,7 +235,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
address from,
address to,
uint128 amount
) internal override {
) internal virtual override {
_transfer(from, to, amount, true);
}

Expand Down