Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cast) lowercase selectors before send API request to openchain.xyz #6865

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

cdump
Copy link
Contributor

@cdump cdump commented Jan 20, 2024

Motivation

cast 4byte-decode is broken, using the command from reference example:

on Nightly (2023-12-02):

$ cast 4byte-decode 0x1F1F897F676d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e7

Error:
Could not decode response:
 {"ok":true,"result":{"event":{},"function":{"0x1F1F897F":null,"0x1f1f897f":[{"name":"fulfillRandomness(bytes32,uint256)","filtered":false}]}}}
.
Error: invalid type: null, expected a sequence at line 1 column 61

on master:

$ cast 4byte-decode 0x1F1F897F676d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e7

Error:
No signature found

Solution

We need to lowercase the selectors before sending API request to openchain API, after the fix:

$ cast 4byte-decode 0x1F1F897F676d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e7

1) "fulfillRandomness(bytes32,uint256)"
0x676d000000000000000000000000000000000000000000000000000000000000
999

@DaniPopes DaniPopes merged commit d2e264c into foundry-rs:master Jan 20, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants