mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 02:07:55 +00:00
cffa14a4d2
Provide a modified (and incomplete) version of ZKSync zksolc that can compile the most basic contracts
51 lines
1.1 KiB
Rust
51 lines
1.1 KiB
Rust
//!
|
|
//! 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
|
|
}
|
|
}
|