pub struct Artifacts { /* private fields */ }Expand description
A source of compiled contract artifacts.
Implementations§
Source§impl Artifacts
impl Artifacts
Sourcepub const fn embedded() -> Self
pub const fn embedded() -> Self
The artifacts vendored into the crate. The default, filesystem-free path.
Sourcepub fn from_dir(dir: impl Into<PathBuf>) -> Self
pub fn from_dir(dir: impl Into<PathBuf>) -> Self
Artifacts read from a directory laid out as <File>.sol/<Name>.json
(a forge out/ directory qualifies).
Sourcepub fn raw(&self, file: &str, contract: &str) -> Result<Value>
pub fn raw(&self, file: &str, contract: &str) -> Result<Value>
The raw artifact JSON for out/<file>.sol/<contract>.json.
Sourcepub fn bytecode(&self, contract: &str) -> Result<Bytes>
pub fn bytecode(&self, contract: &str) -> Result<Bytes>
Creation bytecode of a contract whose .sol file name matches the
contract name. Fails on artifacts with unresolved link references —
deploy those through Self::linked_bytecode.
Sourcepub fn bytecode_named(&self, file: &str, contract: &str) -> Result<Bytes>
pub fn bytecode_named(&self, file: &str, contract: &str) -> Result<Bytes>
Creation bytecode where the source file and contract names differ
(Verifier.sol → HonkVerifier).
Sourcepub async fn linked_bytecode<P: Provider>(
&self,
provider: &P,
file: &str,
contract: &str,
sender: Option<Address>,
) -> Result<Bytes>
pub async fn linked_bytecode<P: Provider>( &self, provider: &P, file: &str, contract: &str, sender: Option<Address>, ) -> Result<Bytes>
Creation bytecode with every external library it references deployed
(recursively) through provider and linked in. Mirrors what forge does
automatically: the generated UltraHonk verifiers link ZKTranscriptLib.
For artifacts with no link references this behaves like
Self::bytecode_named (no transaction is sent).
sender opts into explicit nonce management (see
deploy_contract_from).
Sourcepub fn method_identifiers(
&self,
contract: &str,
) -> Result<BTreeMap<String, String>>
pub fn method_identifiers( &self, contract: &str, ) -> Result<BTreeMap<String, String>>
The artifact’s methodIdentifiers: "sig(args)" -> 4-byte selector
(8 hex chars, no 0x).
Sourcepub fn facet_selectors(&self, contract: &str) -> Result<Vec<FixedBytes<4>>>
pub fn facet_selectors(&self, contract: &str) -> Result<Vec<FixedBytes<4>>>
All external function selectors of a facet, decoded from its
methodIdentifiers. Mirrors BankDiamondDeployer._selectors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Artifacts
impl RefUnwindSafe for Artifacts
impl Send for Artifacts
impl Sync for Artifacts
impl Unpin for Artifacts
impl UnsafeUnpin for Artifacts
impl UnwindSafe for Artifacts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more