core/scripts/ccip/revert-reason/README.md
Before starting:
Create .env file based on the example .env.example next to the CLI binary.
If you plan to resolve revert reasons from a transaction hash, you will need:
The endpoint URL can be a locally running node (archive mode), or an externally hosted one like alchemy.
To see all available commands, run the following:
go run main.go --help
Decoding an error code string (offline):
> ./ccip-revert-reason reason --from-error "0x4e487b710000000000000000000000000000000000000000000000000000000000000032"
2022/12/05 15:18:33 Using config file .env
Decoded error: Assertion failure
If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).%
Resolving from a transaction hash (NODE_URL and FROM_ADDRESS env vars need to be defined)
> ./ccip-revert-reason reason "0x4e487b710000000000000"
2022/12/05 15:18:33 Using config file .env
Decoded error: Assertion failure
If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i >= x.length or i < 0).%