Skip to content

Commit

Permalink
Merge pull request #2 from amazingdatamachine/v12.0.0+adm
Browse files Browse the repository at this point in the history
V12.0.0+adm
  • Loading branch information
sanderpick authored Apr 18, 2024
2 parents b86938e + bdf9947 commit e1f7b12
Show file tree
Hide file tree
Showing 30 changed files with 712 additions and 63 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ testing-fake-proofs = []
[workspace]
resolver = "2"
members = [
"actors/*",
"state",
"runtime",
"test_vm",
"vm_api",
"integration_tests"
"actors/*",
"state",
"runtime",
"test_vm",
"vm_api",
"integration_tests"
]

[workspace.dependencies]
Expand Down Expand Up @@ -142,11 +142,14 @@ fil_actor_system = { version = "12.0.0", path = "actors/system" }
fil_actor_verifreg = { version = "12.0.0", path = "actors/verifreg" }
fil_actors_evm_shared = { version = "12.0.0", path = "actors/evm/shared" }
fil_actors_runtime = { version = "12.0.0", path = "runtime" }
fil_builtin_actors_state = { version = "12.0.0", path = "state"}
fil_builtin_actors_state = { version = "12.0.0", path = "state" }
fil_actors_integration_tests = { version = "1.0.0", path = "integration_tests" }
vm_api = { version = "1.0.0", path = "vm_api" }
test_vm = { version = "12.0.0", path = "test_vm" }

# ADM workspace
fil_actor_adm = { version = "12.0.0", path = "actors/adm" }

[patch.crates-io]
#fvm_shared = { git = "https://github.com/filecoin-project/ref-fvm", branch = "master" }
#fvm_sdk = { git = "https://github.com/filecoin-project/ref-fvm", branch = "master" }
Expand Down Expand Up @@ -175,13 +178,13 @@ test_vm = { version = "12.0.0", path = "test_vm" }
## Assumes the ref-fvm checkout is in a sibling directory with the same name.
## (Valid once FVM modules are published to crates.io)
# [patch.crates-io]
# fvm_shared = { path = "../ref-fvm/shared" }
# fvm_sdk = { path = "../ref-fvm/sdk" }
# fvm_ipld_hamt = { path = "../ref-fvm/ipld/hamt" }
# fvm_ipld_amt = { path = "../ref-fvm/ipld/amt" }
# fvm_ipld_bitfield = { path = "../ref-fvm/ipld/bitfield"}
# fvm_ipld_encoding = { path = "../ref-fvm/ipld/encoding"}
# fvm_ipld_blockstore = { path = "../ref-fvm/ipld/blockstore"}
#fvm_shared = { path = "../ref-fvm/shared" }
#fvm_sdk = { path = "../ref-fvm/sdk" }
#fvm_ipld_hamt = { path = "../ref-fvm/ipld/hamt" }
#fvm_ipld_amt = { path = "../ref-fvm/ipld/amt" }
#fvm_ipld_bitfield = { path = "../ref-fvm/ipld/bitfield" }
#fvm_ipld_encoding = { path = "../ref-fvm/ipld/encoding" }
#fvm_ipld_blockstore = { path = "../ref-fvm/ipld/blockstore" }
#fvm_actor_utils = { path = "../../filecoin/fvm_actor_utils"}
#frc42_dispatch = { path = "../../filecoin/frc42_dispatch"}
#frc46_token = { path = "../../filecoin/frc46_token"}
Expand Down
35 changes: 35 additions & 0 deletions actors/adm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "fil_actor_adm"
description = "Builtin machines address manager actor for ADM"
version = "12.0.0"
license = "MIT OR Apache-2.0"
authors = ["ADM"]
edition = "2021"
repository = "https://github.com/filecoin-project/builtin-actors"
keywords = ["filecoin", "web3", "wasm", "adm"]

[lib]
## lib is necessary for integration tests
## cdylib is necessary for Wasm build
crate-type = ["cdylib", "lib"]

[dependencies]
anyhow = { workspace = true }
cid = { workspace = true }
fil_actors_runtime = { workspace = true }
fvm_ipld_blockstore = { workspace = true }
fvm_ipld_encoding = { workspace = true }
fvm_shared = { workspace = true }
hex-literal = { workspace = true }
integer-encoding = { workspace = true }
log = { workspace = true }
multihash = { workspace = true }
num-derive = { workspace = true }
num-traits = { workspace = true }
serde = { workspace = true }

[dev-dependencies]
fil_actors_runtime = { workspace = true, features = ["test_utils"] }

[features]
fil-actor = ["fil_actors_runtime/fil-actor"]
57 changes: 57 additions & 0 deletions actors/adm/src/ext.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2024 ADM Contributors
// Copyright 2022-2024 Protocol Labs
// SPDX-License-Identifier: Apache-2.0, MIT

use fvm_ipld_encoding::tuple::*;
use serde::{Deserialize, Serialize};

pub mod init {
use super::*;
use cid::Cid;
use fvm_ipld_encoding::RawBytes;
use fvm_shared::address::Address;

pub const EXEC_METHOD: u64 = 2;

/// Init actor Exec Params.
#[derive(Serialize_tuple, Deserialize_tuple)]
pub struct ExecParams {
pub code_cid: Cid,
pub constructor_params: RawBytes,
}

/// Init actor Exec Return value.
#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
pub struct ExecReturn {
/// ID based address for created actor.
pub id_address: Address,
/// Reorg safe address for actor.
pub robust_address: Address,
}
}

pub mod account {
pub const PUBKEY_ADDRESS_METHOD: u64 = 2;
}

pub mod machine {
use super::*;
use fvm_shared::address::Address;

#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
pub struct ConstructorParams {
/// The machine creator robust address.
pub creator: Address,
/// Write access dictates who can write to the machine.
pub write_access: WriteAccess,
}

/// The different types of machine write access.
#[derive(Debug, Serialize, Deserialize)]
pub enum WriteAccess {
/// Only the owner can write to the machine.
OnlyOwner,
/// Any valid account can write to the machine.
Public,
}
}
Loading

0 comments on commit e1f7b12

Please sign in to comment.