forked from aave-dao/aave-v3-origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATokenInstance.sol
49 lines (41 loc) · 1.35 KB
/
ATokenInstance.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import {AToken, IPool, IAaveIncentivesController, IInitializableAToken, Errors, VersionedInitializable} from '../protocol/tokenization/AToken.sol';
contract ATokenInstance is AToken {
uint256 public constant ATOKEN_REVISION = 1;
constructor(IPool pool) AToken(pool) {}
/// @inheritdoc VersionedInitializable
function getRevision() internal pure virtual override returns (uint256) {
return ATOKEN_REVISION;
}
/// @inheritdoc IInitializableAToken
function initialize(
IPool initializingPool,
address treasury,
address underlyingAsset,
IAaveIncentivesController incentivesController,
uint8 aTokenDecimals,
string calldata aTokenName,
string calldata aTokenSymbol,
bytes calldata params
) public virtual override initializer {
require(initializingPool == POOL, Errors.POOL_ADDRESSES_DO_NOT_MATCH);
_setName(aTokenName);
_setSymbol(aTokenSymbol);
_setDecimals(aTokenDecimals);
_treasury = treasury;
_underlyingAsset = underlyingAsset;
_incentivesController = incentivesController;
_domainSeparator = _calculateDomainSeparator();
emit Initialized(
underlyingAsset,
address(POOL),
treasury,
address(incentivesController),
aTokenDecimals,
aTokenName,
aTokenSymbol,
params
);
}
}