Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Msg value refund #20

Merged
merged 7 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/FastLaneFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.16;
pragma solidity ^0.8.16;

import {FastLaneLegacyAuction} from "./legacy/FastLaneLegacyAuction.sol";

Expand Down
10 changes: 8 additions & 2 deletions contracts/auction-handler/FastLaneAuctionHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ contract FastLaneAuctionHandler is FastLaneAuctionHandlerEvents {
) returns (uint256 bidAmount) {
emit RelayFastBid(msg.sender, block.coinbase, true, bidAmount, searcherToAddress);
} catch {
if (msg.value > 0) {
SafeTransferLib.safeTransferETH(
msg.sender,
msg.value
);
}
emit RelayFastBid(msg.sender, block.coinbase, false, 0, searcherToAddress);
}
}
Expand Down Expand Up @@ -370,7 +376,7 @@ contract FastLaneAuctionHandler is FastLaneAuctionHandlerEvents {
tx.origin,
surplus
);

// Otherwise refund the searcher contract
} else {
SafeTransferLib.safeTransferETH(
Expand Down Expand Up @@ -494,7 +500,7 @@ contract FastLaneAuctionHandler is FastLaneAuctionHandlerEvents {
limitedReentrant(paymentProcessor)
validPayee
{
if (paymentProcessor == address(0)) revert RelayProcessorCannotBeZero();
if (paymentProcessor == address(0) || paymentProcessor == address(this)) revert RelayProcessorCannotBeZero();

address validator = getValidator();
uint256 validatorBalance = validatorsBalanceMap[validator] - 1;
Expand Down
4 changes: 2 additions & 2 deletions contracts/legacy/FastLaneLegacyAuction.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.16;
pragma solidity ^0.8.16;

import "openzeppelin-contracts/contracts/utils/Address.sol";
import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol";
Expand Down Expand Up @@ -174,7 +174,7 @@ contract FastLaneLegacyAuction is Initializable, OwnableUpgradeable , UUPSUpgrad
}

function initialize(address _newOwner) public initializer {
__Ownable_init();
// __Ownable_init();
__UUPSUpgradeable_init();
_transferOwnership(_newOwner);
}
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ bytecode_hash = "none"
names = true
sizes = true
gas_price = 60000000000
solc_version = '0.8.16'
solc_version = '0.8.20'
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
2 changes: 1 addition & 1 deletion script/legacy-script/UUPSDeploy.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.16;
pragma solidity ^0.8.16;

import "forge-std/Test.sol";
import "forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/legacy-test/PFLDeploy.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.16;
pragma solidity ^0.8.16;

import "contracts/legacy/FastLaneLegacyAuction.sol";

Expand Down