Skip to content

Commit 2332f45

Browse files
committed
updated gasprice tracking mechanism
1 parent 4c6e6f0 commit 2332f45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/relay/core/GasRelayBase.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ abstract contract GasRelayBase is GasRelayHelper {
418418
address _payee = gasAbstractionTracker.usingSessionKey ? gasAbstractionTracker.key : gasAbstractionTracker.owner;
419419

420420
if (gasAbstractionTracker.usingSessionKey && !gasAbstractionTracker.isTask) {
421-
uint256 _replacementAmount = gasAbstractionTracker.startingGasLeft * tx.gasprice;
421+
uint256 _gasPrice = tx.gasprice > block.basefee ? tx.gasprice : block.basefee;
422+
uint256 _replacementAmount = gasAbstractionTracker.startingGasLeft * _gasPrice;
422423
uint256 _deficitAmount = _sessionKeyBalanceDeficit(gasAbstractionTracker.key);
423424

424425
if (_deficitAmount > _replacementAmount) {

0 commit comments

Comments
 (0)