Skip to content

Commit 2e229b0

Browse files
committed
fix: use sourcify for selector lookups
1 parent 9ec8539 commit 2e229b0

File tree

6 files changed

+85
-86
lines changed

6 files changed

+85
-86
lines changed

Cargo.lock

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cast/src/opts.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ pub enum CastSubcommand {
594594
/// Decode event data.
595595
#[command(visible_aliases = &["event-decode", "--event-decode", "ed"])]
596596
DecodeEvent {
597-
/// The event signature. If none provided then tries to decode from local cache or <https://api.openchain.xyz>.
597+
/// The event signature. If none provided then tries to decode from local cache or <https://docs.sourcify.dev/docs/api/>.
598598
#[arg(long, visible_alias = "event-sig")]
599599
sig: Option<String>,
600600
/// The event data to decode.
@@ -604,7 +604,7 @@ pub enum CastSubcommand {
604604
/// Decode custom error data.
605605
#[command(visible_aliases = &["error-decode", "--error-decode", "erd"])]
606606
DecodeError {
607-
/// The error signature. If none provided then tries to decode from local cache or <https://api.openchain.xyz>.
607+
/// The error signature. If none provided then tries to decode from local cache or <https://docs.sourcify.dev/docs/api/>.
608608
#[arg(long, visible_alias = "error-sig")]
609609
sig: Option<String>,
610610
/// The error data to decode.
@@ -719,29 +719,29 @@ pub enum CastSubcommand {
719719
rpc: RpcOpts,
720720
},
721721

722-
/// Get the function signatures for the given selector from <https://openchain.xyz>.
722+
/// Get the function signatures for the given selector from <https://docs.sourcify.dev/docs/api/>.
723723
#[command(name = "4byte", visible_aliases = &["4", "4b"])]
724724
FourByte {
725725
/// The function selector.
726726
selector: Option<Selector>,
727727
},
728728

729-
/// Decode ABI-encoded calldata using <https://openchain.xyz>.
729+
/// Decode ABI-encoded calldata using <https://docs.sourcify.dev/docs/api/>.
730730
#[command(name = "4byte-calldata", aliases = &["4byte-decode", "4d", "4bd"], visible_aliases = &["4c", "4bc"])]
731731
FourByteCalldata {
732732
/// The ABI-encoded calldata.
733733
calldata: Option<String>,
734734
},
735735

736-
/// Get the event signature for a given topic 0 from <https://openchain.xyz>.
736+
/// Get the event signature for a given topic 0 from <https://docs.sourcify.dev/docs/api/>.
737737
#[command(name = "4byte-event", visible_aliases = &["4e", "4be", "topic0-event", "t0e"])]
738738
FourByteEvent {
739739
/// Topic 0
740740
#[arg(value_name = "TOPIC_0")]
741741
topic: Option<B256>,
742742
},
743743

744-
/// Upload the given signatures to <https://openchain.xyz>.
744+
/// Upload the given signatures to <https://docs.sourcify.dev/docs/api/>.
745745
///
746746
/// Example inputs:
747747
/// - "transfer(address,uint256)"
@@ -759,13 +759,13 @@ pub enum CastSubcommand {
759759

760760
/// Pretty print calldata.
761761
///
762-
/// Tries to decode the calldata using <https://openchain.xyz> unless --offline is passed.
762+
/// Tries to decode the calldata using <https://docs.sourcify.dev/docs/api/> unless --offline is passed.
763763
#[command(visible_alias = "pc")]
764764
PrettyCalldata {
765765
/// The calldata.
766766
calldata: Option<String>,
767767

768-
/// Skip the <https://openchain.xyz> lookup.
768+
/// Skip the <https://docs.sourcify.dev/docs/api/> lookup.
769769
#[arg(long, short)]
770770
offline: bool,
771771
},
@@ -1125,7 +1125,7 @@ pub enum CastSubcommand {
11251125
/// The hex-encoded bytecode.
11261126
bytecode: Option<String>,
11271127

1128-
/// Resolve the function signatures for the extracted selectors using <https://openchain.xyz>
1128+
/// Resolve the function signatures for the extracted selectors using <https://docs.sourcify.dev/docs/api/>
11291129
#[arg(long, short)]
11301130
resolve: bool,
11311131
},

crates/cast/tests/cli/selectors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use foundry_test_utils::util::OutputExt;
22
use std::path::Path;
33

4-
casttest!(error_decode_with_openchain, |prj, cmd| {
4+
casttest!(error_decode_with_sourcify, |prj, cmd| {
55
prj.clear_cache();
66
cmd.args(["decode-error", "0x7a0e198500000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000064"]).assert_success().stdout_eq(str![[r#"
77
ValueTooHigh(uint256,uint256)
@@ -147,8 +147,8 @@ casttest!(event_decode_with_sig, |_prj, cmd| {
147147
"#]]);
148148
});
149149

150-
// tests cast can decode event with Openchain API
151-
casttest!(event_decode_with_openchain, |prj, cmd| {
150+
// tests cast can decode event with Sourcify API
151+
casttest!(event_decode_with_sourcify, |prj, cmd| {
152152
prj.clear_cache();
153153
cmd.args(["decode-event", "0xe27c4c1372396a3d15a9922f74f9dfc7c72b1ad6d63868470787249c356454c1000000000000000000000000000000000000000000000000000000000000004e00000000000000000000000000000000000000000000000000000dd00000004e"]).assert_success().stdout_eq(str![[r#"
154154
BaseCurrencySet(address,uint256)

0 commit comments

Comments
 (0)