MCPcopy Create free account
hub / github.com/ChainSecurity/deployment_validation / extract_create_call_frame

Function extract_create_call_frame

lib/web3.rs:151–173  ·  view source on GitHub ↗

Searches recursively for create call frame Ignores reverting call frames

(
    call_frame: &CallFrame,
    address: &Address,
)

Source from the content-addressed store, hash-verified

149// Searches recursively for create call frame
150// Ignores reverting call frames
151fn extract_create_call_frame(
152 call_frame: &CallFrame,
153 address: &Address,
154) -> Result<CallFrame, ValidationError> {
155 if call_frame.typ.starts_with("CREATE")
156 && call_frame.error.is_none()
157 && call_frame.to.as_ref().and_then(|to| to.as_address()) == Some(address)
158 {
159 return Ok(call_frame.clone());
160 }
161
162 if let Some(calls) = &call_frame.calls {
163 for call in calls {
164 if call.error.is_none() {
165 if let Ok(call_frame) = extract_create_call_frame(call, address) {
166 return Ok(call_frame);
167 }
168 }
169 }
170 }
171
172 Err(ValidationError::from("Cannot determine create addresses"))
173}
174pub fn get_eth_debug_call_trace(
175 config: &DVFConfig,
176 tx_id: &str,

Callers 1

get_init_codeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected