Merge pull request #241 from aave/fix/permissioned-market-gateway-fix

Fix PermissionedWethGateway to work for all market users
This commit is contained in:
The-3D 2021-11-03 16:10:46 +00:00 committed by GitHub
commit 40d008acc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ contract PermissionedWETHGateway is WETHGateway {
ILendingPool pool = ILendingPool(lendingPool);
require(
_isInRoleAndValidPermissionAdmin(msg.sender, DataTypes.Roles.DEPOSITOR, pool),
_isInRoleAndValidPermissionAdmin(onBehalfOf, DataTypes.Roles.DEPOSITOR, pool),
Errors.PLP_USER_UNAUTHORIZED
);
@ -60,7 +60,7 @@ contract PermissionedWETHGateway is WETHGateway {
) public payable override {
ILendingPool pool = ILendingPool(lendingPool);
require(_isInRole(msg.sender, DataTypes.Roles.BORROWER, pool), Errors.PLP_USER_UNAUTHORIZED);
require(_isInRole(onBehalfOf, DataTypes.Roles.BORROWER, pool), Errors.PLP_USER_UNAUTHORIZED);
super.repayETH(lendingPool, amount, rateMode, onBehalfOf);
}