MCPcopy Create free account
hub / github.com/base/base / has_code

Method has_code

actions/harness/src/engine.rs:356–364  ·  view source on GitHub ↗

Check whether an account has non-empty code deployed. Returns `true` if the account exists and has code, `false` otherwise.

(&self, address: Address)

Source from the content-addressed store, hash-verified

354 ///
355 /// Returns `true` if the account exists and has code, `false` otherwise.
356 pub fn has_code(&self, address: Address) -> bool {
357 let inner = self.inner.lock().expect("engine client lock");
358 let provider =
359 inner.blockchain_provider.latest().expect("failed to get latest state provider");
360 provider
361 .account_code(&address)
362 .expect("failed to read account code")
363 .is_some_and(|c: reth_primitives_traits::Bytecode| !c.is_empty())
364 }
365
366 /// Build a block from the given `BasePayloadAttributes`, returning the `BaseBuiltPayload`.
367 fn build_payload(

Callers

nothing calls this directly

Calls 3

lockMethod · 0.45
latestMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected