Skip to content

Commit

Permalink
Merge pull request #12 from Polygon-Fast-Lane/consolidation
Browse files Browse the repository at this point in the history
Consolidation
  • Loading branch information
Elyx0 authored Sep 7, 2023
2 parents 5230bb0 + 3bb8771 commit 1c3b52a
Show file tree
Hide file tree
Showing 94 changed files with 5,283 additions and 3,013 deletions.
342 changes: 312 additions & 30 deletions contracts/abis/FastLaneAuctionHandlerAbi.json

Large diffs are not rendered by default.

383 changes: 291 additions & 92 deletions contracts/auction-handler/FastLaneAuctionHandler.sol

Large diffs are not rendered by default.

82 changes: 72 additions & 10 deletions contracts/interfaces/IFastLaneAuctionHandler.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
pragma solidity ^0.8.10;

interface IFastLaneAuctionHandler {
event CustomPaymentProcessorPaid(
address indexed payor,
address indexed paymentProcessor,
uint256 totalAmount,
uint256 customAllocation,
uint256 startBlock,
uint256 endBlock
);
event RelayFastBid(
address indexed sender,
address indexed validator,
bool success,
uint256 bidAmount,
address searcherContractAddress
);
event RelayFeeCollected(address indexed payor, address indexed payee, uint256 amount);
event RelayFlashBid(
address indexed sender,
uint256 amount,
bytes32 indexed oppTxHash,
address indexed validator,
uint256 bidAmount,
uint256 amountPaid,
address searcherContractAddress
);
event RelayFlashBidWithRefund(
address indexed sender,
bytes32 indexed oppTxHash,
address indexed validator,
uint256 bidAmount,
uint256 amountPaid,
address searcherContractAddress,
uint256 refundedAmount,
address refundAddress
);
event RelayInvestigateOutcome(
address indexed validator,
address indexed sender,
uint256 blockNumber,
uint256 existingBidAmount,
uint256 newBidAmount,
uint256 existingGasPrice,
uint256 newGasPrice
);
event RelayProcessingPaidValidator(address indexed validator, uint256 validatorPayment, address indexed initiator);
event RelaySimulatedFlashBid(
address indexed sender,
Expand All @@ -21,30 +56,57 @@ interface IFastLaneAuctionHandler {
event RelayWithdrawStuckERC20(address indexed receiver, address indexed token, uint256 amount);
event RelayWithdrawStuckNativeToken(address indexed receiver, uint256 amount);

function clearValidatorPayee() external;
function collectFees() external returns (uint256);
function fastBidWrapper(
address msgSender,
uint256 fastPrice,
address searcherToAddress,
bytes memory searcherCallData
) external payable returns (uint256);
function fulfilledAuctionsMap(bytes32) external view returns (uint256);
function fulfilledPGAMap(uint256)
external
view
returns (uint64 lowestGasPrice, uint64 lowestFastPrice, uint64 lowestTotalPrice);
function getValidatorBalance(address _validator) external view returns (uint256 _validatorBalance);
function getValidatorBlockOfLastWithdraw(address _validator) external view returns (uint256 _blockNumber);
function getValidatorPayee(address _validator) external view returns (address _payee);
function getValidatorRecipient(address _validator) external view returns (address _recipient);
function humanizeError(bytes memory _errorData) external pure returns (string memory decoded);
function isPayeeTimeLocked(address _validator) external view returns (bool _isTimeLocked);
function isValidPayee(address _validator, address _payee) external view returns (bool _valid);
function payValidatorCustom(address paymentProcessor, uint256 customAllocation, bytes memory data)
external
payable;
function payValidatorFee(address _payor) external payable;
function payeeMap(address) external view returns (address);
function simulateFlashBid(
uint256 _bidAmount,
bytes32 _oppTxHash,
address _searcherToAddress,
bytes memory _searcherCallData
uint256 bidAmount,
bytes32 oppTxHash,
address searcherToAddress,
bytes memory searcherCallData
) external payable;
function submitFastBid(uint256 fastGasPrice, address searcherToAddress, bytes memory searcherCallData)
external
payable;
function submitFlashBid(
uint256 _bidAmount,
bytes32 _oppTxHash,
address _searcherToAddress,
bytes memory _searcherCallData
uint256 bidAmount,
bytes32 oppTxHash,
address searcherToAddress,
bytes memory searcherCallData
) external payable;
function submitFlashBidWithRefund(
uint256 bidAmount,
bytes32 oppTxHash,
address refundAddress,
address searcherToAddress,
bytes memory searcherCallData
) external payable;
function syncStuckNativeToken() external;
function updateValidatorPayee(address _payee) external;
function updateValidatorRefundShare(uint256 refundShare) external;
function validatorsBalanceMap(address) external view returns (uint256);
function validatorsRefundShareMap(address) external view returns (uint256);
function validatorsTotal() external view returns (uint256);
function withdrawStuckERC20(address _tokenAddress) external;
}
12 changes: 12 additions & 0 deletions contracts/interfaces/IPaymentProcessor.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

interface IPaymentProcessor {
function payValidator(
uint256 startBlock,
uint256 endBlock,
uint256 totalAmount,
uint256 customAllocation,
bytes calldata data
) external payable;
}
Loading

0 comments on commit 1c3b52a

Please sign in to comment.