Skip to content

Commit

Permalink
Update Suave.sol library to flashbots/suave-geth@301bf72 (#60)
Browse files Browse the repository at this point in the history
Co-authored-by: ferranbt <[email protected]>
  • Loading branch information
github-actions[bot] and ferranbt authored Mar 2, 2024
1 parent b6b6b80 commit 018ccd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/forge/SuaveAddrs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library SuaveAddrs {
addrList[10] = Suave.NEW_BUILDER;
addrList[11] = Suave.NEW_DATA_RECORD;
addrList[12] = Suave.PRIVATE_KEY_GEN;
addrList[13] = Suave.RANDOM_UINT256;
addrList[13] = Suave.RANDOM_BYTES;
addrList[14] = Suave.SIGN_ETH_TRANSACTION;
addrList[15] = Suave.SIGN_MESSAGE;
addrList[16] = Suave.SIMULATE_BUNDLE;
Expand Down
10 changes: 5 additions & 5 deletions src/suavelib/Suave.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ library Suave {

address public constant PRIVATE_KEY_GEN = 0x0000000000000000000000000000000053200003;

address public constant RANDOM_UINT256 = 0x0000000000000000000000000000000077700256;
address public constant RANDOM_BYTES = 0x000000000000000000000000000000007770000b;

address public constant SIGN_ETH_TRANSACTION = 0x0000000000000000000000000000000040100001;

Expand Down Expand Up @@ -246,13 +246,13 @@ library Suave {
return abi.decode(data, (string));
}

function randomUint256() internal returns (uint256) {
(bool success, bytes memory data) = RANDOM_UINT256.call(abi.encode());
function randomBytes(uint8 numBytes) internal returns (bytes memory) {
(bool success, bytes memory data) = RANDOM_BYTES.call(abi.encode(numBytes));
if (!success) {
revert PeekerReverted(RANDOM_UINT256, data);
revert PeekerReverted(RANDOM_BYTES, data);
}

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

function signEthTransaction(bytes memory txn, string memory chainId, string memory signingKey)
Expand Down

0 comments on commit 018ccd4

Please sign in to comment.