mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 09:08:00 +00:00
Emerge Yul recompiler (#1)
Provide a modified (and incomplete) version of ZKSync zksolc that can compile the most basic contracts
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
//!
|
||||
//! The LLVM IR generator Vyper data.
|
||||
//!
|
||||
|
||||
///
|
||||
/// The LLVM IR generator Vyper data.
|
||||
///
|
||||
/// Describes some data that is only relevant to Vyper.
|
||||
///
|
||||
#[derive(Debug)]
|
||||
pub struct VyperData {
|
||||
/// The immutables size tracker. Stores the size in bytes.
|
||||
/// Does not take into account the size of the indexes.
|
||||
immutables_size: usize,
|
||||
/// Whether the contract forwarder has been used.
|
||||
is_forwarder_used: bool,
|
||||
}
|
||||
|
||||
impl VyperData {
|
||||
///
|
||||
/// A shortcut constructor.
|
||||
///
|
||||
pub fn new(immutables_size: usize, is_forwarder_used: bool) -> Self {
|
||||
Self {
|
||||
immutables_size,
|
||||
is_forwarder_used,
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the size of the immutables data of the contract.
|
||||
///
|
||||
pub fn immutables_size(&self) -> usize {
|
||||
self.immutables_size
|
||||
}
|
||||
|
||||
///
|
||||
/// Sets the forwarder usage flag.
|
||||
///
|
||||
pub fn set_is_forwarder_used(&mut self) {
|
||||
self.is_forwarder_used = true;
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the forwarder usage flag.
|
||||
///
|
||||
pub fn is_forwarder_used(&self) -> bool {
|
||||
self.is_forwarder_used
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user