Struct ethers_solc::artifacts::contract::ContractBytecode
source · 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§fn eq(&self, other: &ContractBytecode) -> bool
fn eq(&self, other: &ContractBytecode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ContractBytecode
impl Serialize for ContractBytecode
source§impl TryFrom<ContractBytecode> for ContractBytecodeSome
impl TryFrom<ContractBytecode> for ContractBytecodeSome
§type Error = ContractBytecode
type Error = ContractBytecode
The type returned in the event of a conversion error.
impl StructuralPartialEq for ContractBytecode
Auto Trait Implementations§
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