From 74c86b21d38418d94272e9110a859c02e9c2e664 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 24 Jan 2024 01:41:28 -0800 Subject: [PATCH] added a generic function to pay a fee to a specific validator --- contracts/auction-handler/FastLaneAuctionHandler.sol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contracts/auction-handler/FastLaneAuctionHandler.sol b/contracts/auction-handler/FastLaneAuctionHandler.sol index bfa9e71..e493c7c 100644 --- a/contracts/auction-handler/FastLaneAuctionHandler.sol +++ b/contracts/auction-handler/FastLaneAuctionHandler.sol @@ -378,6 +378,14 @@ contract FastLaneAuctionHandler is FastLaneAuctionHandlerEvents { emit RelayFeeCollected(_payor, block.coinbase, msg.value); } + function paySpecificValidatorFee(address _validator) external payable nonReentrant { + // TODO: block this when _validator == block.coinbase? + if (msg.value == 0) revert RelayValueIsZero(); + validatorsBalanceMap[_validator] += msg.value; + validatorsTotal += msg.value; + emit RelayFeeCollected(_validator, block.coinbase, msg.value); + } + // Part of the PaymentProcessor interface. In this case, this is used to transfer a validator's balances from one // PFL contract to a new deployment. function payValidator(address validator, uint256 startBlock, uint256 endBlock, uint256 totalAmount, bytes calldata)