pub struct FactoryGenesis {
pub admin: Address,
}Expand description
The factory of one environment, pinned by its genesis admin: the deployer key that owns the factory from its first block. The admin is the only varying input of the frozen proxy init code, so the factory’s address, and every address deployed through it, follow from the admin and nothing else. Testnet and mainnet have their own.
Fields§
§admin: AddressThe deployer key: factory owner from genesis, apply’s signer.
Implementations§
Source§impl FactoryGenesis
impl FactoryGenesis
Sourcepub fn proxy_init_code(&self, artifacts: &Artifacts) -> Result<Bytes>
pub fn proxy_init_code(&self, artifacts: &Artifacts) -> Result<Bytes>
The frozen proxy init code: ERC1967Proxy creation code ++
abi.encode(implAddress, initialize(admin)). FactoryDeployer.proxyInitCode(admin)
produces the same bytes (asserted against the vendored artifacts by
the Solidity tests).
Sourcepub fn address(&self, artifacts: &Artifacts) -> Result<Address>
pub fn address(&self, artifacts: &Artifacts) -> Result<Address>
The factory’s address — the same on every EVM network the admin deploys to.
Sourcepub async fn ensure<P: Provider>(
&self,
provider: &P,
artifacts: &Artifacts,
) -> Result<Address>
pub async fn ensure<P: Provider>( &self, provider: &P, artifacts: &Artifacts, ) -> Result<Address>
Make sure the factory exists at Self::address, bootstrapping
whatever is missing: the CREATE2 deployer (via the keyless presigned
transaction), the factory implementation, and the factory proxy —
each at its deterministic address. Idempotent: reruns are read-only
no-ops once the factory is up.
Trait Implementations§
Source§impl Clone for FactoryGenesis
impl Clone for FactoryGenesis
impl Copy for FactoryGenesis
Source§impl Debug for FactoryGenesis
impl Debug for FactoryGenesis
impl Eq for FactoryGenesis
Source§impl PartialEq for FactoryGenesis
impl PartialEq for FactoryGenesis
impl StructuralPartialEq for FactoryGenesis
Auto Trait Implementations§
impl Freeze for FactoryGenesis
impl RefUnwindSafe for FactoryGenesis
impl Send for FactoryGenesis
impl Sync for FactoryGenesis
impl Unpin for FactoryGenesis
impl UnsafeUnpin for FactoryGenesis
impl UnwindSafe for FactoryGenesis
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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