From ceef173a22ac68089b0b0bba7a600b3f64a85ae5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 19 Nov 2023 20:18:13 -0800 Subject: [PATCH 1/2] removed the portion-of-MEV fee from the allocateValue hook in the ExecutionEnvironment. --- lib/openzeppelin-contracts | 2 +- src/contracts/atlas/ExecutionEnvironment.sol | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts index 281550b7..0a25c194 160000 --- a/lib/openzeppelin-contracts +++ b/lib/openzeppelin-contracts @@ -1 +1 @@ -Subproject commit 281550b71c3df9a83e6b80ceefc700852c287570 +Subproject commit 0a25c1940ca220686588c4af3ec526f725fe2582 diff --git a/src/contracts/atlas/ExecutionEnvironment.sol b/src/contracts/atlas/ExecutionEnvironment.sol index 19c87fc6..e9445433 100644 --- a/src/contracts/atlas/ExecutionEnvironment.sol +++ b/src/contracts/atlas/ExecutionEnvironment.sol @@ -255,7 +255,7 @@ contract ExecutionEnvironment is Base { function allocateValue( address bidToken, uint256 bidAmount, - bytes memory returnData + bytes memory allocateData ) external onlyAtlasEnvironment(ExecutionPhase.HandlingPayments, _ENVIRONMENT_DEPTH) @@ -264,18 +264,7 @@ contract ExecutionEnvironment is Base { // msg.sender = escrow // address(this) = ExecutionEnvironment - uint256 payment = (bidAmount * 5) / 100; - - if (bidToken != address(0)) { - SafeTransferLib.safeTransfer(ERC20(bidToken), address(0xa71a5), payment); - } else { - SafeTransferLib.safeTransferETH(address(0xa71a5), payment); - } - - uint256 netBidAmount = bidAmount - payment; - - bytes memory allocateData = - abi.encodeWithSelector(IDAppControl.allocateValueCall.selector, bidToken, netBidAmount, returnData); + allocateData = abi.encodeWithSelector(IDAppControl.allocateValueCall.selector, bidToken, bidAmount, allocateData); (bool success,) = _control().delegatecall(forward(allocateData)); require(success, "ERR-EC02 DelegateRevert"); From ab3592622c50c51e5d59f5329090a673b07ee827 Mon Sep 17 00:00:00 2001 From: jj1980a Date: Mon, 20 Nov 2023 14:43:02 +0800 Subject: [PATCH 2/2] make linter happy --- src/contracts/atlas/ExecutionEnvironment.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/contracts/atlas/ExecutionEnvironment.sol b/src/contracts/atlas/ExecutionEnvironment.sol index e9445433..9d6e207e 100644 --- a/src/contracts/atlas/ExecutionEnvironment.sol +++ b/src/contracts/atlas/ExecutionEnvironment.sol @@ -264,7 +264,8 @@ contract ExecutionEnvironment is Base { // msg.sender = escrow // address(this) = ExecutionEnvironment - allocateData = abi.encodeWithSelector(IDAppControl.allocateValueCall.selector, bidToken, bidAmount, allocateData); + allocateData = + abi.encodeWithSelector(IDAppControl.allocateValueCall.selector, bidToken, bidAmount, allocateData); (bool success,) = _control().delegatecall(forward(allocateData)); require(success, "ERR-EC02 DelegateRevert");