Skip to content

Instantly share code, notes, and snippets.

@rouzwelt
rouzwelt / DiagOrder.md
Last active June 13, 2024 06:10
Diag Rain Orderbook Orders Running on Arb Bot
  • you need foundry installed on your machine for this process, as well as having forge-std lib for contract dependencies.
  • download or copy the DiagOrder.sol file below and put it in ./script folder (or any other folder of your choice)
  • replace the import path with the location of forge-std/src/Script.sol on you disk.
  • replace the to address with the arb contract address on the desired network.
  • replace the data with the calldata without leading 0x taken from otel (hyperdx).
  • save the file and now you can run the following command to get the traces:
forge script path/to/DiagOrder.sol:DiagOrder -vvvvv --fork-url <url> --fork-block-number <blocknumber> --sender <addres>
  • replace the path with the location of the saved file in previous step,
@rouzwelt
rouzwelt / obv3.js
Last active July 13, 2024 02:21
Parse and Deploy Rain Order
const { ethers } = require("ethers");
const encodeMeta = (data) => {
return (
"0x" +
BigInt(0xff0a89c674ee7874n).toString(16).toLowerCase() +
ethers.utils.hexlify(ethers.utils.toUtf8Bytes(data)).split("x")[1]
);
};