Skip to content

Commit 9afc1d0

Browse files
committed
Add Initialized event at aToken and Debt Token Base to match interfaces in newer versions of Aave Protocol.
1 parent ee04de7 commit 9afc1d0

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed

contracts/interfaces/IAToken.sol

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ interface IAToken is IERC20, IScaledBalanceToken {
1414
**/
1515
event Mint(address indexed from, uint256 value, uint256 index);
1616

17+
/**
18+
* @dev Emitted when an aToken is initialized
19+
* @param underlyingAsset The address of the underlying asset
20+
* @param pool The address of the associated lending pool
21+
* @param treasury The address of the treasury
22+
* @param incentivesController The address of the incentives controller for this aToken
23+
* @param aTokenDecimals the decimals of the underlying
24+
* @param aTokenName the name of the aToken
25+
* @param aTokenSymbol the symbol of the aToken
26+
* @param params A set of encoded parameters for additional initialization
27+
**/
28+
event Initialized(
29+
address indexed underlyingAsset,
30+
address indexed pool,
31+
address treasury,
32+
address incentivesController,
33+
uint8 aTokenDecimals,
34+
string aTokenName,
35+
string aTokenSymbol,
36+
bytes params
37+
);
38+
1739
/**
1840
* @dev Mints `amount` aTokens to `user`
1941
* @param user The address receiving the minted tokens
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: agpl-3.0
2+
pragma solidity 0.6.12;
3+
4+
interface IDebtTokenBase {
5+
/**
6+
* @dev Emitted when a debt token is initialized
7+
* @param underlyingAsset The address of the underlying asset
8+
* @param pool The address of the associated lending pool
9+
* @param incentivesController The address of the incentives controller for this aToken
10+
* @param debtTokenDecimals the decimals of the debt token
11+
* @param debtTokenName the name of the debt token
12+
* @param debtTokenSymbol the symbol of the debt token
13+
* @param params A set of encoded parameters for additional initialization
14+
**/
15+
event Initialized(
16+
address indexed underlyingAsset,
17+
address indexed pool,
18+
address incentivesController,
19+
uint8 debtTokenDecimals,
20+
string debtTokenName,
21+
string debtTokenSymbol,
22+
bytes params
23+
);
24+
}

contracts/protocol/tokenization/AToken.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
8484
_setName(tokenName);
8585
_setSymbol(tokenSymbol);
8686
_setDecimals(underlyingAssetDecimals);
87+
88+
emit Initialized(
89+
UNDERLYING_ASSET_ADDRESS,
90+
address(POOL),
91+
RESERVE_TREASURY_ADDRESS,
92+
address(_incentivesController),
93+
underlyingAssetDecimals,
94+
tokenName,
95+
tokenSymbol,
96+
''
97+
);
8798
}
8899

89100
/**

contracts/protocol/tokenization/base/DebtTokenBase.sol

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity 0.6.12;
33

44
import {ILendingPool} from '../../../interfaces/ILendingPool.sol';
55
import {ICreditDelegationToken} from '../../../interfaces/ICreditDelegationToken.sol';
6+
import {IDebtTokenBase} from '../../../interfaces/IDebtTokenBase.sol';
67
import {
78
VersionedInitializable
89
} from '../../libraries/aave-upgradeability/VersionedInitializable.sol';
@@ -18,7 +19,8 @@ import {Errors} from '../../libraries/helpers/Errors.sol';
1819
abstract contract DebtTokenBase is
1920
IncentivizedERC20,
2021
VersionedInitializable,
21-
ICreditDelegationToken
22+
ICreditDelegationToken,
23+
IDebtTokenBase
2224
{
2325
address public immutable UNDERLYING_ASSET_ADDRESS;
2426
ILendingPool public immutable POOL;
@@ -62,6 +64,16 @@ abstract contract DebtTokenBase is
6264
_setName(name);
6365
_setSymbol(symbol);
6466
_setDecimals(decimals);
67+
68+
emit Initialized(
69+
UNDERLYING_ASSET_ADDRESS,
70+
address(POOL),
71+
address(_incentivesController),
72+
decimals,
73+
name,
74+
symbol,
75+
''
76+
);
6577
}
6678

6779
/**

0 commit comments

Comments
 (0)