-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,033 additions
and
220 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
[package] | ||
name = "pallet-evm-precompile-services" | ||
version = "0.1.0" | ||
authors = { workspace = true } | ||
edition = "2021" | ||
description = "A Precompile to make pallet-services calls encoding accessible to pallet-evm" | ||
|
||
[dependencies] | ||
|
||
# Moonbeam | ||
precompile-utils = { workspace = true } | ||
|
||
# Substrate | ||
frame-support = { workspace = true } | ||
frame-system = { workspace = true } | ||
pallet-balances = { workspace = true } | ||
pallet-multi-asset-delegation = { workspace = true } | ||
parity-scale-codec = { workspace = true, features = ["derive"] } | ||
sp-core = { workspace = true } | ||
sp-runtime = { workspace = true } | ||
sp-std = { workspace = true } | ||
|
||
# Frontier | ||
fp-evm = { workspace = true } | ||
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] } | ||
tangle-primitives = { workspace = true } | ||
pallet-services = { workspace = true } | ||
|
||
[dev-dependencies] | ||
derive_more = { workspace = true } | ||
hex-literal = { workspace = true } | ||
serde = { workspace = true } | ||
sha3 = { workspace = true } | ||
ethereum = { workspace = true, features = ["with-codec"] } | ||
ethers = "2.0" | ||
hex = { workspace = true } | ||
num_enum = { workspace = true } | ||
libsecp256k1 = { workspace = true } | ||
serde_json = { workspace = true } | ||
smallvec = { workspace = true } | ||
sp-keystore = { workspace = true } | ||
|
||
# Moonbeam | ||
precompile-utils = { workspace = true, features = ["std", "testing"] } | ||
|
||
# Substrate | ||
pallet-balances = { workspace = true, features = ["std"] } | ||
pallet-assets = { workspace = true, features = ["std"] } | ||
pallet-timestamp = { workspace = true, features = ["std"] } | ||
scale-info = { workspace = true, features = ["derive", "std"] } | ||
sp-io = { workspace = true, features = ["std"] } | ||
|
||
# Frontier Primitive | ||
fp-account = { workspace = true } | ||
fp-consensus = { workspace = true } | ||
fp-dynamic-fee = { workspace = true } | ||
fp-ethereum = { workspace = true } | ||
fp-rpc = { workspace = true } | ||
fp-self-contained = { workspace = true } | ||
fp-storage = { workspace = true } | ||
|
||
# Frontier FRAME | ||
pallet-base-fee = { workspace = true } | ||
pallet-dynamic-fee = { workspace = true } | ||
pallet-ethereum = { workspace = true } | ||
pallet-evm = { workspace = true } | ||
pallet-evm-chain-id = { workspace = true } | ||
|
||
pallet-evm-precompile-blake2 = { workspace = true } | ||
pallet-evm-precompile-bn128 = { workspace = true } | ||
pallet-evm-precompile-curve25519 = { workspace = true } | ||
pallet-evm-precompile-ed25519 = { workspace = true } | ||
pallet-evm-precompile-modexp = { workspace = true } | ||
pallet-evm-precompile-sha3fips = { workspace = true } | ||
pallet-evm-precompile-simple = { workspace = true } | ||
|
||
pallet-session = { workspace = true } | ||
pallet-staking = { workspace = true } | ||
sp-staking = { workspace = true } | ||
frame-election-provider-support = { workspace = true } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"fp-evm/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"pallet-balances/std", | ||
"pallet-evm/std", | ||
"pallet-multi-asset-delegation/std", | ||
"parity-scale-codec/std", | ||
"precompile-utils/std", | ||
"sp-core/std", | ||
"sp-runtime/std", | ||
"sp-std/std", | ||
"tangle-primitives/std", | ||
"pallet-assets/std", | ||
"pallet-services/std", | ||
"hex/std", | ||
"scale-info/std", | ||
"sp-runtime/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"sp-core/std", | ||
"sp-std/std", | ||
"sp-io/std", | ||
"tangle-primitives/std", | ||
"pallet-balances/std", | ||
"pallet-timestamp/std", | ||
"fp-account/std", | ||
"fp-consensus/std", | ||
"fp-dynamic-fee/std", | ||
"fp-ethereum/std", | ||
"fp-evm/std", | ||
"fp-rpc/std", | ||
"fp-self-contained/std", | ||
"fp-storage/std", | ||
"pallet-base-fee/std", | ||
"pallet-dynamic-fee/std", | ||
"pallet-ethereum/std", | ||
"pallet-evm/std", | ||
"pallet-evm-chain-id/std", | ||
|
||
"pallet-evm-precompile-modexp/std", | ||
"pallet-evm-precompile-sha3fips/std", | ||
"pallet-evm-precompile-simple/std", | ||
"pallet-evm-precompile-blake2/std", | ||
"pallet-evm-precompile-bn128/std", | ||
"pallet-evm-precompile-curve25519/std", | ||
"pallet-evm-precompile-ed25519/std", | ||
"precompile-utils/std", | ||
"serde/std", | ||
"pallet-session/std", | ||
"pallet-staking/std", | ||
"sp-staking/std", | ||
"frame-election-provider-support/std", | ||
] |
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,52 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
/// @title ServicesPrecompile Interface | ||
/// @dev This interface is meant to interact with the ServicesPrecompile in the Tangle network. | ||
interface ServicesPrecompile { | ||
|
||
/// @notice Create a new service blueprint | ||
/// @param blueprint_data The blueprint data encoded as bytes | ||
function createBlueprint(bytes calldata blueprint_data) external; | ||
|
||
/// @notice Register an operator for a specific blueprint | ||
/// @param blueprint_id The ID of the blueprint to register for | ||
/// @param preferences The operator's preferences encoded as bytes | ||
/// @param registration_args The registration arguments encoded as bytes | ||
function registerOperator(uint256 blueprint_id, bytes calldata preferences, bytes calldata registration_args) external; | ||
|
||
/// @notice Unregister an operator from a specific blueprint | ||
/// @param blueprint_id The ID of the blueprint to unregister from | ||
function unregisterOperator(uint256 blueprint_id) external; | ||
|
||
/// @notice Request a service from a specific blueprint | ||
/// @param blueprint_id The ID of the blueprint | ||
/// @param permitted_callers_data The permitted callers for the service encoded as bytes | ||
/// @param service_providers_data The service providers encoded as bytes | ||
/// @param request_args_data The request arguments encoded as bytes | ||
function requestService(uint256 blueprint_id, bytes calldata permitted_callers_data, bytes calldata service_providers_data, bytes calldata request_args_data) external; | ||
|
||
/// @notice Terminate a service | ||
/// @param service_id The ID of the service to terminate | ||
function terminateService(uint256 service_id) external; | ||
|
||
/// @notice Approve a service request | ||
/// @param request_id The ID of the service request to approve | ||
function approve(uint256 request_id) external; | ||
|
||
/// @notice Reject a service request | ||
/// @param request_id The ID of the service request to reject | ||
function reject(uint256 request_id) external; | ||
|
||
/// @notice Call a job in the service | ||
/// @param service_id The ID of the service | ||
/// @param job The job index (as uint8) | ||
/// @param args_data The arguments of the job encoded as bytes | ||
function callJob(uint256 service_id, uint8 job, bytes calldata args_data) external; | ||
|
||
/// @notice Submit the result of a job call | ||
/// @param service_id The ID of the service | ||
/// @param call_id The ID of the call | ||
/// @param result_data The result data encoded as bytes | ||
function submitResult(uint256 service_id, uint256 call_id, bytes calldata result_data) external; | ||
} |
Oops, something went wrong.