pub struct ContractBytecode {
pub abi: Option<Contract>,
pub bytecode: Option<Bytecode>,
pub deployed_bytecode: Option<DeployedBytecode>,
}
Expand description
Minimal representation of a contract with a present abi and bytecode.
Unlike CompactContractSome
which contains the BytecodeObject
, this holds the whole
Bytecode
object.
Fields§
§abi: Option<Contract>
The Ethereum Contract ABI. If empty, it is represented as an empty array. See https://docs.soliditylang.org/en/develop/abi-spec.html
bytecode: Option<Bytecode>
§deployed_bytecode: Option<DeployedBytecode>
Implementations§
Source§impl ContractBytecode
impl ContractBytecode
Sourcepub fn unwrap(self) -> ContractBytecodeSome
pub fn unwrap(self) -> ContractBytecodeSome
Returns the ContractBytecodeSome
if all fields are Some
§Panics
Panics if any of the fields equal None
§Example
use ethers_solc::Project;
use ethers_solc::artifacts::*;
let mut output = project.compile().unwrap().output();
let contract: ContractBytecode = output.remove_first("Greeter").unwrap().into();
let contract = contract.unwrap();
Trait Implementations§
Source§impl Clone for ContractBytecode
impl Clone for ContractBytecode
Source§fn clone(&self) -> ContractBytecode
fn clone(&self) -> ContractBytecode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ContractBytecode
impl Debug for ContractBytecode
Source§impl<'de> Deserialize<'de> for ContractBytecode
impl<'de> Deserialize<'de> for ContractBytecode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CompactContractBytecode> for ContractBytecode
impl From<CompactContractBytecode> for ContractBytecode
Source§fn from(c: CompactContractBytecode) -> Self
fn from(c: CompactContractBytecode) -> Self
Converts to this type from the input type.
Source§impl From<Contract> for ContractBytecode
impl From<Contract> for ContractBytecode
Source§impl From<ContractBytecode> for CompactContract
impl From<ContractBytecode> for CompactContract
Source§fn from(c: ContractBytecode) -> Self
fn from(c: ContractBytecode) -> Self
Converts to this type from the input type.
Source§impl From<ContractBytecode> for CompactContractBytecode
impl From<ContractBytecode> for CompactContractBytecode
Source§fn from(c: ContractBytecode) -> Self
fn from(c: ContractBytecode) -> Self
Converts to this type from the input type.
Source§impl From<HardhatArtifact> for ContractBytecode
impl From<HardhatArtifact> for ContractBytecode
Source§fn from(artifact: HardhatArtifact) -> Self
fn from(artifact: HardhatArtifact) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ContractBytecode
impl PartialEq for ContractBytecode
Source§impl Serialize for ContractBytecode
impl Serialize for ContractBytecode
Source§impl TryFrom<ContractBytecode> for ContractBytecodeSome
impl TryFrom<ContractBytecode> for ContractBytecodeSome
Source§type Error = ContractBytecode
type Error = ContractBytecode
The type returned in the event of a conversion error.
impl StructuralPartialEq for ContractBytecode
Auto Trait Implementations§
impl !Freeze for ContractBytecode
impl RefUnwindSafe for ContractBytecode
impl Send for ContractBytecode
impl Sync for ContractBytecode
impl Unpin for ContractBytecode
impl UnwindSafe for ContractBytecode
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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