Skip to content

Commit

Permalink
Update Suave.sol library to flashbots/suave-geth@6f5a2a8 (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: sukoneck <[email protected]>
  • Loading branch information
github-actions[bot] and sukoneck authored Feb 19, 2024
1 parent 8fb650d commit e1b6b85
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/forge/SuaveAddrs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ import "../suavelib/Suave.sol";

library SuaveAddrs {
function getSuaveAddrs() external pure returns (address[] memory) {
address[] memory addrList = new address[](18);
address[] memory addrList = new address[](19);

addrList[0] = Suave.IS_CONFIDENTIAL_ADDR;
addrList[1] = Suave.BUILD_ETH_BLOCK;
addrList[2] = Suave.CONFIDENTIAL_RETRIEVE;
addrList[3] = Suave.CONFIDENTIAL_STORE;
addrList[4] = Suave.DO_HTTPREQUEST;
addrList[5] = Suave.ETHCALL;
addrList[6] = Suave.EXTRACT_HINT;
addrList[7] = Suave.FETCH_DATA_RECORDS;
addrList[8] = Suave.FILL_MEV_SHARE_BUNDLE;
addrList[9] = Suave.NEW_BUILDER;
addrList[10] = Suave.NEW_DATA_RECORD;
addrList[11] = Suave.PRIVATE_KEY_GEN;
addrList[12] = Suave.SIGN_ETH_TRANSACTION;
addrList[13] = Suave.SIGN_MESSAGE;
addrList[14] = Suave.SIMULATE_BUNDLE;
addrList[15] = Suave.SIMULATE_TRANSACTION;
addrList[16] = Suave.SUBMIT_BUNDLE_JSON_RPC;
addrList[17] = Suave.SUBMIT_ETH_BLOCK_TO_RELAY;
addrList[4] = Suave.CONTEXT_GET;
addrList[5] = Suave.DO_HTTPREQUEST;
addrList[6] = Suave.ETHCALL;
addrList[7] = Suave.EXTRACT_HINT;
addrList[8] = Suave.FETCH_DATA_RECORDS;
addrList[9] = Suave.FILL_MEV_SHARE_BUNDLE;
addrList[10] = Suave.NEW_BUILDER;
addrList[11] = Suave.NEW_DATA_RECORD;
addrList[12] = Suave.PRIVATE_KEY_GEN;
addrList[13] = Suave.SIGN_ETH_TRANSACTION;
addrList[14] = Suave.SIGN_MESSAGE;
addrList[15] = Suave.SIMULATE_BUNDLE;
addrList[16] = Suave.SIMULATE_TRANSACTION;
addrList[17] = Suave.SUBMIT_BUNDLE_JSON_RPC;
addrList[18] = Suave.SUBMIT_ETH_BLOCK_TO_RELAY;

return addrList;
}
Expand Down
11 changes: 11 additions & 0 deletions src/suavelib/Suave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ library Suave {

address public constant CONFIDENTIAL_STORE = 0x0000000000000000000000000000000042020000;

address public constant CONTEXT_GET = 0x0000000000000000000000000000000053300003;

address public constant DO_HTTPREQUEST = 0x0000000000000000000000000000000043200002;

address public constant ETHCALL = 0x0000000000000000000000000000000042100003;
Expand Down Expand Up @@ -148,6 +150,15 @@ library Suave {
}
}

function contextGet(string memory key) internal returns (bytes memory) {
(bool success, bytes memory data) = CONTEXT_GET.call(abi.encode(key));
if (!success) {
revert PeekerReverted(CONTEXT_GET, data);
}

return abi.decode(data, (bytes));
}

function doHTTPRequest(HttpRequest memory request) internal returns (bytes memory) {
(bool success, bytes memory data) = DO_HTTPREQUEST.call(abi.encode(request));
if (!success) {
Expand Down

0 comments on commit e1b6b85

Please sign in to comment.