Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 121 additions & 94 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions crates/cast/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ use foundry_common::{
fmt::{format_tokens, format_uint_exp, serialize_value_as_json},
fs,
selectors::{
ParsedSignatures, SelectorImportData, SelectorKind, decode_calldata, decode_event_topic,
decode_function_selector, decode_selectors, import_selectors, parse_signatures,
pretty_calldata,
SelectorKind, decode_calldata, decode_event_topic, decode_function_selector,
decode_selectors, pretty_calldata,
},
shell, stdin,
};
Expand Down Expand Up @@ -594,15 +593,11 @@ pub async fn run_command(args: CastArgs) -> Result<()> {
sh_println!("{sig}")?
}
}
CastSubcommand::UploadSignature { signatures } => {
let signatures = stdin::unwrap_vec(signatures)?;
let ParsedSignatures { signatures, abis } = parse_signatures(signatures);
if !abis.is_empty() {
import_selectors(SelectorImportData::Abi(abis)).await?.describe();
}
if !signatures.is_empty() {
import_selectors(SelectorImportData::Raw(signatures)).await?.describe();
}
CastSubcommand::UploadSignature { .. } => {
sh_warn!(
"Selector uploading is deprecated and is currently a no-op, as the upstream API has been removed."
)?;
sh_warn!("To upload selectors in the future, verify your contracts with Sourcify.")?;
}

// ENS
Expand Down
18 changes: 9 additions & 9 deletions crates/cast/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ pub enum CastSubcommand {
/// Decode event data.
#[command(visible_aliases = &["event-decode", "--event-decode", "ed"])]
DecodeEvent {
/// The event signature. If none provided then tries to decode from local cache or <https://api.openchain.xyz>.
/// The event signature. If none provided then tries to decode from local cache or <https://docs.sourcify.dev/docs/api/>.
#[arg(long, visible_alias = "event-sig")]
sig: Option<String>,
/// The event data to decode.
Expand All @@ -605,7 +605,7 @@ pub enum CastSubcommand {
/// Decode custom error data.
#[command(visible_aliases = &["error-decode", "--error-decode", "erd"])]
DecodeError {
/// The error signature. If none provided then tries to decode from local cache or <https://api.openchain.xyz>.
/// The error signature. If none provided then tries to decode from local cache or <https://docs.sourcify.dev/docs/api/>.
#[arg(long, visible_alias = "error-sig")]
sig: Option<String>,
/// The error data to decode.
Expand Down Expand Up @@ -720,29 +720,29 @@ pub enum CastSubcommand {
rpc: RpcOpts,
},

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

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

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

/// Upload the given signatures to <https://openchain.xyz>.
/// DEPRECATED: Upload the given signatures to <https://docs.sourcify.dev/docs/api/>.
///
/// Example inputs:
/// - "transfer(address,uint256)"
Expand All @@ -760,13 +760,13 @@ pub enum CastSubcommand {

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

/// Skip the <https://openchain.xyz> lookup.
/// Skip the <https://docs.sourcify.dev/docs/api/> lookup.
#[arg(long, short)]
offline: bool,
},
Expand Down Expand Up @@ -1126,7 +1126,7 @@ pub enum CastSubcommand {
/// The hex-encoded bytecode.
bytecode: Option<String>,

/// Resolve the function signatures for the extracted selectors using <https://openchain.xyz>
/// Resolve the function signatures for the extracted selectors using <https://docs.sourcify.dev/docs/api/>
#[arg(long, short)]
resolve: bool,
},
Expand Down
16 changes: 8 additions & 8 deletions crates/cast/tests/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ casttest!(mktx_raw_unsigned_no_from_missing_nonce, |_prj, cmd| {
"--chain",
"1",
"--gas-limit",
"21000",
"21000",
"--gas-price",
"20000000000",
"0x742d35Cc6634C0532925a3b8D6Ac6F67C9c2b7FD",
Expand Down Expand Up @@ -3384,7 +3384,7 @@ Traces:
│ ├─ [2553] 0x2Ce6311ddAE708829bc0784C967b7d77D19FD779::balanceOf(0xA12384c5E52fD646E7BC7F6B3b33A605651F566E) [delegatecall]
│ │ └─ ← [Return] 0x000000000000000000000000000000000000000000000000000000000000f3b9
│ └─ ← [Return] 0x000000000000000000000000000000000000000000000000000000000000f3b9
├─ [65442] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::00000000(00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a12384c5e52fd646e7bc7f6b3b33a605651f566e000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f0000000000000000000000000000000000000000000000000000000000036cd000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000327a25ad5cfe5c4d4339c1a4267d4a83e8c93312000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000b55b053230e4effb6609de652fca73fd1c2980400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
├─ [65442] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::fulfillBasicOrder_efficient_6GL6yc()
│ ├─ [25070] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::unwrapAndValidateSignature(0x290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff, 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00) [staticcall]
│ │ ├─ [22067] 0x0B55b053230E4EFFb6609de652fCa73Fd1C29804::unwrapAndValidateSignature(0x290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff, 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00) [delegatecall]
│ │ │ ├─ [2369] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::pauseFlag() [staticcall]
Expand Down Expand Up @@ -3418,7 +3418,7 @@ Traces:
│ │ ├─ [553] 0x2Ce6311ddAE708829bc0784C967b7d77D19FD779::balanceOf(0x327a25aD5Cfe5c4D4339C1A4267D4a83E8c93312) [delegatecall]
│ │ │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000009c9a
│ │ └─ ← [Return] 0x0000000000000000000000000000000000000000000000000000000000009c9a
│ ├─ [5675] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::00000001(00000000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b290a4c4039f102eceba2147e1fcc46f994a46d1229faf43ffff26a058e7378ff0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a12384c5e52fd646e7bc7f6b3b33a605651f566e000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f0000000000000000000000000000000000000000000000000000000000036cd000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000000000000000000000000000000000000000060f000000000000000000000000327a25ad5cfe5c4d4339c1a4267d4a83e8c93312000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000005a00000000000000000000000000b55b053230e4effb6609de652fca73fd1c2980400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000221000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006cdd519280ec730727f07aa36550bde31a1d5f3097818f3425c2f083ed33a91f080fa2afac0071f6e1af9a0e9c09b851bf01e68bc8a1c1f89f686c48205762f92500000000000000000000000000000000000000000000000000000000000000244242424242424242424242424242424242424242424242424242424242424242010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000827b226368616c6c656e6765223a224b51704d51446e7841757a726f68522d483878472d5a536b625249702d76515f5f5f4a714259357a655038222c2263726f73734f726967696e223a66616c73652c226f726967696e223a2268747470732f2f6974686163612e78797a222c2274797065223a22776562617574686e2e676574227d0000000000000000000000000000000000000000000000000000000000001bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
│ ├─ [5675] 0xc2FF493F28e894742b968A7DB5D3F21F0aD80C6c::multicallN2M_001Taw5z()
│ │ ├─ [4148] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::execute(0x0100000000007821000100000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b)
│ │ │ ├─ [3693] 0x0B55b053230E4EFFb6609de652fCa73Fd1C29804::execute(0x0100000000007821000100000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000201bde17b8de18819c9eb86cefc3920ddb5d3d4254de276e3d6e18dd2b399f732b) [delegatecall]
│ │ │ │ ├─ [435] 0xA12384c5E52fD646E7BC7F6B3b33A605651F566E::fallback()
Expand Down Expand Up @@ -3586,12 +3586,12 @@ forgetest_async!(cast_send_create_with_constructor_args, |prj, cmd| {
contract ConstructorContract {
uint256 public value;
string public name;
constructor(uint256 _value, string memory _name) {
value = _value;
name = _name;
}
function getValue() public view returns (uint256) {
return value;
}
Expand Down Expand Up @@ -3665,7 +3665,7 @@ casttest!(cast_estimate_create_with_constructor_args, |prj, cmd| {
contract EstimateContract {
uint256 public value;
string public name;
constructor(uint256 _value, string memory _name) {
value = _value;
name = _name;
Expand Down Expand Up @@ -3767,13 +3767,13 @@ contract ComplexContract {
address public owner;
uint256[] public values;
bool public active;
constructor(address _owner, uint256[] memory _values, bool _active) {
owner = _owner;
values = _values;
active = _active;
}
function getValuesLength() public view returns (uint256) {
return values.length;
}
Expand Down
Loading
Loading