-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f00ef8
commit 44f4775
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/marketplace/contracts/exchange/mocks/MockTrustedForwarder.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.21; | ||
|
||
contract MockTrustedForwarder { | ||
struct ForwardRequest { | ||
address from; | ||
address to; | ||
uint256 value; | ||
uint256 gasLimit; | ||
bytes data; | ||
} | ||
|
||
function execute(ForwardRequest calldata req) public payable returns (bool, bytes memory) { | ||
(bool success, bytes memory returndata) = req.to.call{gas: req.gasLimit, value: req.value}( | ||
abi.encodePacked(req.data, req.from) | ||
); | ||
assert(gasleft() > req.gasLimit / 63); | ||
require(success, "Call execution failed"); | ||
return (success, returndata); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44f4775
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage for this commit
Coverage Report