This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FM-168: Generate different ABI bindings for the diamond * FM-168: First guess at how the genesis process should change * FM-168: Update hardhat library resolver tests * FM-168: Update genesis interpreter to handle facets * FM-168: Fix; leave root dependencies in the topo sort and remove only top levels, leave facets * FM-168: Factored out utility data structures * FM-168: Fix lint
- Loading branch information
Showing
22 changed files
with
18,743 additions
and
6,746 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2022-2023 Protocol Labs | ||
// SPDX-License-Identifier: Apache-2.0, MIT | ||
//! Helper data structures to declare diamond pattern contracts. | ||
|
||
// See https://medium.com/@MarqyMarq/how-to-implement-the-diamond-standard-69e87dae44e6 | ||
|
||
use std::collections::HashMap; | ||
|
||
use ethers::abi::Abi; | ||
use fvm_shared::ActorID; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct EthFacet { | ||
pub name: &'static str, | ||
pub abi: Abi, | ||
} | ||
|
||
/// Top level Ethereum contract with a pre-determined ID. | ||
#[derive(Clone, Debug)] | ||
pub struct EthContract { | ||
/// Pre-determined ID for the contract. | ||
pub actor_id: ActorID, | ||
pub abi: Abi, | ||
/// List of facets if the contract is using the diamond pattern. | ||
pub facets: Vec<EthFacet>, | ||
} | ||
|
||
pub type EthContractMap = HashMap<&'static str, EthContract>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.