From 1551a986c9584e75136ed38353ad0b1e3953322d Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Wed, 3 Nov 2021 13:34:45 +0100 Subject: [PATCH] fix: Fix PermissionedWethGateway to work for all market users --- contracts/misc/PermissionedWETHGateway.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/misc/PermissionedWETHGateway.sol b/contracts/misc/PermissionedWETHGateway.sol index 8d83eb0d..1042660f 100644 --- a/contracts/misc/PermissionedWETHGateway.sol +++ b/contracts/misc/PermissionedWETHGateway.sol @@ -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); }