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

chore: linea diffs #48

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions diffs/ARBITRUM_LINEA/AAVE_PROTOCOL_DATA_PROVIDER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/ARBITRUM/AAVE_PROTOCOL_DATA_PROVIDER.sol b/./downloads/LINEA/AAVE_PROTOCOL_DATA_PROVIDER.sol
index 8142191..9b34753 100644
--- a/./downloads/ARBITRUM/AAVE_PROTOCOL_DATA_PROVIDER.sol
+++ b/./downloads/LINEA/AAVE_PROTOCOL_DATA_PROVIDER.sol

```
7 changes: 7 additions & 0 deletions diffs/ARBITRUM_LINEA/ACL_MANAGER_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/ARBITRUM/ACL_MANAGER.sol b/./downloads/LINEA/ACL_MANAGER.sol
index 9ff4476..c45f49c 100644
--- a/./downloads/ARBITRUM/ACL_MANAGER.sol
+++ b/./downloads/LINEA/ACL_MANAGER.sol

```
7 changes: 7 additions & 0 deletions diffs/ARBITRUM_LINEA/BORROW_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/ARBITRUM/BORROW_LOGIC.sol b/./downloads/LINEA/BORROW_LOGIC.sol
index 58a8929..9ef522e 100644
--- a/./downloads/ARBITRUM/BORROW_LOGIC.sol
+++ b/./downloads/LINEA/BORROW_LOGIC.sol

```
7 changes: 7 additions & 0 deletions diffs/ARBITRUM_LINEA/BRIDGE_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```diff
diff --git a/./downloads/ARBITRUM/BRIDGE_LOGIC.sol b/./downloads/LINEA/BRIDGE_LOGIC.sol
index 9220f63..ffa3a45 100644
--- a/./downloads/ARBITRUM/BRIDGE_LOGIC.sol
+++ b/./downloads/LINEA/BRIDGE_LOGIC.sol

```
31 changes: 31 additions & 0 deletions diffs/ARBITRUM_LINEA/COLLECTOR_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```diff
diff --git a/./downloads/ARBITRUM/COLLECTOR_IMPL.sol b/./downloads/LINEA/COLLECTOR_IMPL.sol
index 752e048..80c907f 100644
--- a/./downloads/ARBITRUM/COLLECTOR_IMPL.sol
+++ b/./downloads/LINEA/COLLECTOR_IMPL.sol

-// downloads/ARBITRUM/COLLECTOR_IMPL/Collector/src/contracts/Collector.sol
+// downloads/LINEA/COLLECTOR_IMPL/Collector/src/contracts/treasury/Collector.sol

/**
* @title Collector
@@ -903,8 +782,6 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
_nextStreamId = nextStreamId;
}

- // can be removed after first deployment
- _initGuard();
_setFundsAdmin(fundsAdmin);
}

@@ -1021,9 +898,6 @@ contract Collector is VersionedInitializable, ICollector, ReentrancyGuard {
}
}

- /// @dev needed in order to receive ETH from the Aave v1 ecosystem reserve
- receive() external payable {}
-
/// @inheritdoc ICollector
function setFundsAdmin(address admin) external onlyFundsAdmin {
_setFundsAdmin(admin);
```
134 changes: 134 additions & 0 deletions diffs/ARBITRUM_LINEA/CONFIGURATOR_LOGIC_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
```diff
diff --git a/./downloads/ARBITRUM/CONFIGURATOR_LOGIC.sol b/./downloads/LINEA/CONFIGURATOR_LOGIC.sol
index b92a1a1..22e067d 100644
--- a/./downloads/ARBITRUM/CONFIGURATOR_LOGIC.sol
+++ b/./downloads/LINEA/CONFIGURATOR_LOGIC.sol

-// downloads/ARBITRUM/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/core/contracts/protocol/libraries/logic/ConfiguratorLogic.sol
+// downloads/LINEA/CONFIGURATOR_LOGIC/ConfiguratorLogic/src/contracts/protocol/libraries/logic/ConfiguratorLogic.sol

/**
* @title ConfiguratorLogic library
@@ -2917,11 +2862,6 @@ library ConfiguratorLogic {
address indexed proxy,
address indexed implementation
);
- event StableDebtTokenUpgraded(
- address indexed asset,
- address indexed proxy,
- address indexed implementation
- );
event VariableDebtTokenUpgraded(
address indexed asset,
address indexed proxy,
@@ -2929,7 +2869,7 @@ library ConfiguratorLogic {
);

/**
- * @notice Initialize a reserve by creating and initializing aToken, stable debt token and variable debt token
+ * @notice Initialize a reserve by creating and initializing aToken and variable debt token
* @dev Emits the `ReserveInitialized` event
* @param pool The Pool in which the reserve will be initialized
* @param input The needed parameters for the initialization
@@ -2957,20 +2897,6 @@ library ConfiguratorLogic {
)
);

- address stableDebtTokenProxyAddress = _initTokenWithProxy(
- input.stableDebtTokenImpl,
- abi.encodeWithSelector(
- IInitializableDebtToken.initialize.selector,
- pool,
- input.underlyingAsset,
- input.incentivesController,
- underlyingAssetDecimals,
- input.stableDebtTokenName,
- input.stableDebtTokenSymbol,
- input.params
- )
- );
-
address variableDebtTokenProxyAddress = _initTokenWithProxy(
input.variableDebtTokenImpl,
abi.encodeWithSelector(
@@ -2988,7 +2914,6 @@ library ConfiguratorLogic {
pool.initReserve(
input.underlyingAsset,
aTokenProxyAddress,
- stableDebtTokenProxyAddress,
variableDebtTokenProxyAddress,
input.interestRateStrategyAddress
);
@@ -3012,7 +2937,7 @@ library ConfiguratorLogic {
emit ReserveInitialized(
input.underlyingAsset,
aTokenProxyAddress,
- stableDebtTokenProxyAddress,
+ address(0),
variableDebtTokenProxyAddress,
input.interestRateStrategyAddress
);
@@ -3030,7 +2955,7 @@ library ConfiguratorLogic {
) external {
DataTypes.ReserveDataLegacy memory reserveData = cachedPool.getReserveData(input.asset);

- (, , , uint256 decimals, , ) = cachedPool.getConfiguration(input.asset).getParams();
+ (, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParams();

bytes memory encodedCall = abi.encodeWithSelector(
IInitializableAToken.initialize.selector,
@@ -3049,44 +2974,6 @@ library ConfiguratorLogic {
emit ATokenUpgraded(input.asset, reserveData.aTokenAddress, input.implementation);
}

- /**
- * @notice Updates the stable debt token implementation and initializes it
- * @dev Emits the `StableDebtTokenUpgraded` event
- * @param cachedPool The Pool containing the reserve with the stable debt token
- * @param input The parameters needed for the initialize call
- */
- function executeUpdateStableDebtToken(
- IPool cachedPool,
- ConfiguratorInputTypes.UpdateDebtTokenInput calldata input
- ) external {
- DataTypes.ReserveDataLegacy memory reserveData = cachedPool.getReserveData(input.asset);
-
- (, , , uint256 decimals, , ) = cachedPool.getConfiguration(input.asset).getParams();
-
- bytes memory encodedCall = abi.encodeWithSelector(
- IInitializableDebtToken.initialize.selector,
- cachedPool,
- input.asset,
- input.incentivesController,
- decimals,
- input.name,
- input.symbol,
- input.params
- );
-
- _upgradeTokenImplementation(
- reserveData.stableDebtTokenAddress,
- input.implementation,
- encodedCall
- );
-
- emit StableDebtTokenUpgraded(
- input.asset,
- reserveData.stableDebtTokenAddress,
- input.implementation
- );
- }
-
/**
* @notice Updates the variable debt token implementation and initializes it
* @dev Emits the `VariableDebtTokenUpgraded` event
@@ -3099,7 +2986,7 @@ library ConfiguratorLogic {
) external {
DataTypes.ReserveDataLegacy memory reserveData = cachedPool.getReserveData(input.asset);

- (, , , uint256 decimals, , ) = cachedPool.getConfiguration(input.asset).getParams();
+ (, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParams();

bytes memory encodedCall = abi.encodeWithSelector(
IInitializableDebtToken.initialize.selector,
```
158 changes: 158 additions & 0 deletions diffs/ARBITRUM_LINEA/DEFAULT_A_TOKEN_IMPL_DIFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
```diff
diff --git a/./downloads/ARBITRUM/DEFAULT_A_TOKEN_IMPL.sol b/./downloads/LINEA/DEFAULT_A_TOKEN_IMPL.sol
index efb0fd4..fd9dc66 100644
--- a/./downloads/ARBITRUM/DEFAULT_A_TOKEN_IMPL.sol
+++ b/./downloads/LINEA/DEFAULT_A_TOKEN_IMPL.sol

-// downloads/ARBITRUM/DEFAULT_A_TOKEN_IMPL/AToken/lib/aave-v3-core/contracts/protocol/tokenization/base/IncentivizedERC20.sol
+// downloads/LINEA/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/protocol/tokenization/base/IncentivizedERC20.sol

/**
* @title IncentivizedERC20
@@ -2563,8 +2719,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed {
/**
* @dev UserState - additionalData is a flexible field.
* ATokens and VariableDebtTokens use this field store the index of the
- * user's last supply/withdrawal/borrow/repayment. StableDebtTokens use
- * this field to store the user's stable rate.
+ * user's last supply/withdrawal/borrow/repayment.
*/
struct UserState {
uint128 balance;
@@ -2587,15 +2742,15 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed {
/**
* @dev Constructor.
* @param pool The reference to the main Pool contract
- * @param name The name of the token
- * @param symbol The symbol of the token
- * @param decimals The number of decimals of the token
+ * @param name_ The name of the token
+ * @param symbol_ The symbol of the token
+ * @param decimals_ The number of decimals of the token
*/
- constructor(IPool pool, string memory name, string memory symbol, uint8 decimals) {
+ constructor(IPool pool, string memory name_, string memory symbol_, uint8 decimals_) {
_addressesProvider = pool.ADDRESSES_PROVIDER();
- _name = name;
- _symbol = symbol;
- _decimals = decimals;
+ _name = name_;
+ _symbol = symbol_;
+ _decimals = decimals_;
POOL = pool;
}

@@ -2756,7 +2911,7 @@ abstract contract IncentivizedERC20 is Context, IERC20Detailed {
}
}

/**
* @title Aave ERC20 AToken
* @author Aave
* @notice Implementation of the interest bearing token for the Aave protocol
*/
-contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, IAToken {
+abstract contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, IAToken {
using WadRayMath for uint256;
using SafeCast for uint256;
using GPv2SafeERC20 for IERC20;
@@ -2982,16 +3137,9 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
bytes32 public constant PERMIT_TYPEHASH =
keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');

- uint256 public constant ATOKEN_REVISION = 0x2;
-
address internal _treasury;
address internal _underlyingAsset;

- /// @inheritdoc VersionedInitializable
- function getRevision() internal pure virtual override returns (uint256) {
- return ATOKEN_REVISION;
- }
-
/**
* @dev Constructor.
* @param pool The address of the Pool contract
@@ -3012,29 +3160,7 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
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
- );
- }
+ ) public virtual;

/// @inheritdoc IAToken
function mint(
@@ -3208,3 +3334,50 @@ contract AToken is VersionedInitializable, ScaledBalanceTokenBase, EIP712Base, I
IERC20(token).safeTransfer(to, amount);
}
}
+
+// downloads/LINEA/DEFAULT_A_TOKEN_IMPL/ATokenInstance/src/contracts/instances/ATokenInstance.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
+ );
+ }
+}
```
Loading
Loading