revert: Revert control access of transfer back to LendingPool contract

This commit is contained in:
Hadrien Charlanes 2021-05-31 10:49:25 +02:00
parent 10c4cbac80
commit 992e026075
4 changed files with 4 additions and 3 deletions

View File

@ -718,6 +718,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
uint256 balanceFromBefore,
uint256 balanceToBefore
) external override whenNotPaused {
require(msg.sender == _reserves[asset].aTokenAddress, Errors.LP_CALLER_MUST_BE_AN_ATOKEN);
ValidationLogic.validateTransfer(_reserves[asset]);
uint256 reserveId = _reserves[asset].id;

View File

@ -86,7 +86,7 @@ library Errors {
string public constant LP_FAILED_COLLATERAL_SWAP = '60';
string public constant LP_INVALID_EQUAL_ASSETS_TO_SWAP = '61';
string public constant LP_REENTRANCY_NOT_ALLOWED = '62';
string public constant VL_CALLER_MUST_BE_AN_ATOKEN = '63';
string public constant LP_CALLER_MUST_BE_AN_ATOKEN = '63';
string public constant LP_IS_PAUSED = '64'; // 'Pool is paused'
string public constant LP_NO_MORE_RESERVES_ALLOWED = '65';
string public constant LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = '66';

View File

@ -475,7 +475,6 @@ library ValidationLogic {
* @param reserve The reserve object
*/
function validateTransfer(DataTypes.ReserveData storage reserve) internal view {
require(msg.sender == reserve.aTokenAddress, Errors.VL_CALLER_MUST_BE_AN_ATOKEN);
require(!reserve.configuration.getPaused(), Errors.VL_RESERVE_PAUSED);
}
}

View File

@ -167,7 +167,7 @@ export enum ProtocolErrors {
LP_FAILED_COLLATERAL_SWAP = '60',
LP_INVALID_EQUAL_ASSETS_TO_SWAP = '61',
LP_REENTRANCY_NOT_ALLOWED = '62',
VL_CALLER_MUST_BE_AN_ATOKEN = '63',
LP_CALLER_MUST_BE_AN_ATOKEN = '63',
LP_IS_PAUSED = '64', // 'Pool is paused'
LP_NO_MORE_RESERVES_ALLOWED = '65',
LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = '66',