Struct ethers_solc::artifacts::bytecode::Bytecode
source · pub struct Bytecode {
pub function_debug_data: BTreeMap<String, FunctionDebugData>,
pub object: BytecodeObject,
pub opcodes: Option<String>,
pub source_map: Option<String>,
pub generated_sources: Vec<GeneratedSource>,
pub link_references: BTreeMap<String, BTreeMap<String, Vec<Offsets>>>,
}
Fields§
§function_debug_data: BTreeMap<String, FunctionDebugData>
Debugging information at function level
object: BytecodeObject
The bytecode as a hex string.
opcodes: Option<String>
Opcodes list (string)
source_map: Option<String>
The source mapping as a string. See the source mapping definition.
generated_sources: Vec<GeneratedSource>
Array of sources generated by the compiler. Currently only contains a single Yul file.
link_references: BTreeMap<String, BTreeMap<String, Vec<Offsets>>>
If given, this is an unlinked object.
Implementations§
source§impl Bytecode
impl Bytecode
sourcepub fn source_map(&self) -> Option<Result<SourceMap, SyntaxError>>
pub fn source_map(&self) -> Option<Result<SourceMap, SyntaxError>>
Returns the parsed source map
See also https://docs.soliditylang.org/en/v0.8.10/internals/source_mappings.html
sourcepub fn link_fully_qualified(
&mut self,
name: impl AsRef<str>,
addr: Address
) -> bool
pub fn link_fully_qualified(
&mut self,
name: impl AsRef<str>,
addr: Address
) -> bool
Same as Bytecode::link
but with fully qualified name (file.sol:Math
)
sourcepub fn link(
&mut self,
file: impl AsRef<str>,
library: impl AsRef<str>,
address: Address
) -> bool
pub fn link(
&mut self,
file: impl AsRef<str>,
library: impl AsRef<str>,
address: Address
) -> bool
Tries to link the bytecode object with the file
and library
name.
Replaces all library placeholders with the given address.
Returns true if the bytecode object is fully linked, false otherwise This is a noop if the bytecode object is already fully linked.
sourcepub fn link_all<I, S, T>(&mut self, libs: I) -> boolwhere
I: IntoIterator<Item = (S, T, Address)>,
S: AsRef<str>,
T: AsRef<str>,
pub fn link_all<I, S, T>(&mut self, libs: I) -> boolwhere
I: IntoIterator<Item = (S, T, Address)>,
S: AsRef<str>,
T: AsRef<str>,
Links the bytecode object with all provided (file, lib, addr)
sourcepub fn link_all_fully_qualified<I, S>(&mut self, libs: I) -> boolwhere
I: IntoIterator<Item = (S, Address)>,
S: AsRef<str>,
pub fn link_all_fully_qualified<I, S>(&mut self, libs: I) -> boolwhere
I: IntoIterator<Item = (S, Address)>,
S: AsRef<str>,
Links the bytecode object with all provided (fully_qualified, addr)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Bytecode
impl<'de> Deserialize<'de> for Bytecode
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>,
source§impl From<Bytecode> for CompactBytecode
impl From<Bytecode> for CompactBytecode
source§fn from(bcode: Bytecode) -> CompactBytecode
fn from(bcode: Bytecode) -> CompactBytecode
source§impl From<Bytecode> for DeployedBytecode
impl From<Bytecode> for DeployedBytecode
source§fn from(bcode: Bytecode) -> DeployedBytecode
fn from(bcode: Bytecode) -> DeployedBytecode
source§impl From<BytecodeObject> for Bytecode
impl From<BytecodeObject> for Bytecode
source§fn from(object: BytecodeObject) -> Bytecode
fn from(object: BytecodeObject) -> Bytecode
source§impl From<CompactBytecode> for Bytecode
impl From<CompactBytecode> for Bytecode
source§fn from(bcode: CompactBytecode) -> Bytecode
fn from(bcode: CompactBytecode) -> Bytecode
impl Eq for Bytecode
impl StructuralEq for Bytecode
impl StructuralPartialEq for Bytecode
Auto Trait Implementations§
impl RefUnwindSafe for Bytecode
impl Send for Bytecode
impl Sync for Bytecode
impl Unpin for Bytecode
impl UnwindSafe for Bytecode
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.