Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-10-13
toolchain: nightly-2025-10-20
components: rustfmt

- name: Check Formatting
run: cargo fmt -- --check
run: cargo +nightly-2025-10-20 fmt -- --check

lint:
timeout-minutes: 120
Expand All @@ -46,9 +47,10 @@ jobs:
- name: Install Solidity Dependencies
run: forge soldeer update -d

- uses: dtolnay/rust-toolchain@nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-10-13
toolchain: nightly-2025-10-20
components: clippy

- uses: swatinem/rust-cache@v2
Expand Down Expand Up @@ -82,9 +84,10 @@ jobs:
- name: Install Solidity Dependencies
run: forge soldeer update -d

- uses: dtolnay/rust-toolchain@nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-10-13
toolchain: nightly-2025-10-20
components: clippy

- uses: swatinem/rust-cache@v2
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/verify-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
--define project-description="An example blueprint"
--define project-homepage="https://tangle.tools"
--define flakes=true
--define docker=true
--define container=true
--define base-image="rustlang/rust:nightly"
--define ci=true
--define rust-ci=true
Expand All @@ -33,9 +33,12 @@ jobs:
version: nightly
- name: Show forge version
run: forge --version
- uses: dtolnay/rust-toolchain@stable
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly-2025-10-20
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- run: |
cp -r $PROJECT_NAME ${{ runner.temp }}/
cd ${{ runner.temp }}/$PROJECT_NAME
Expand Down
12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ repository = "https://github.com/{{gh-username}}/{{project-name}}"
readme = "README.md"
categories = ["cryptography", "cryptography::cryptocurrencies"]
keywords = ["tangle", "blueprint", "avs"]
rust-version = "1.81"
rust-version = "1.88"

[dependencies]
# Gadget
blueprint-sdk = { git = "https://github.com/tangle-network/gadget.git", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build"] }
blueprint-sdk = { version = "0.1.0-alpha.19", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build", "testing"], git = "https://github.com/tangle-network/blueprint.git" }
serde = { version = "1.0.208", features = ["derive"] }
jsonrpc-core = { version = "18.0.0", default-features = false }
jsonrpc-http-server = { version = "18.0.0", default-features = false }
thiserror = { version = "2.0.17", default-features = false }
reqwest = { version = "0.12.22", default-features = false }
color-eyre = { version = "0.6", default-features = false }


[build-dependencies]
blueprint-sdk = { git = "https://github.com/tangle-network/gadget.git", default-features = false, features = ["std", "build"] }
blueprint-sdk = { version = "0.1.0-alpha.19", default-features = false, features = ["std", "eigenlayer", "evm", "macros", "build", "testing"], git = "https://github.com/tangle-network/blueprint.git" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ LABEL org.opencontainers.image.description="{{project-description}}"
LABEL org.opencontainers.image.source="https://github.com/{{gh-username}}/{{project-name}}"
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"

ENV RUST_LOG="gadget=info"
ENV RUST_LOG="blueprint_sdk=info"
ENV BIND_ADDR="0.0.0.0"
ENV BIND_PORT=9632
ENV BLUEPRINT_ID=0
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fn main() {
let contract_dirs: Vec<&str> = vec!["./contracts"];
blueprint_sdk::build::utils::soldeer_update();
blueprint_sdk::build::utils::build_contracts(contract_dirs);
blueprint_sdk::build::soldeer_update();
blueprint_sdk::build::build_contracts(contract_dirs);
}
36 changes: 8 additions & 28 deletions contracts/src/ITangleTaskManager.sol
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.13;

import "eigenlayer-middleware/src/libraries/BN254.sol";

interface ITangleTaskManager {
// EVENTS
event NewTaskCreated(uint32 indexed taskIndex, Task task);

event TaskResponded(
TaskResponse taskResponse,
TaskResponseMetadata taskResponseMetadata
);
event TaskResponded(TaskResponse taskResponse, TaskResponseMetadata taskResponseMetadata);

event TaskCompleted(uint32 indexed taskIndex);

event TaskChallengedSuccessfully(
uint32 indexed taskIndex,
address indexed challenger
);

event TaskChallengedUnsuccessfully(
uint32 indexed taskIndex,
address indexed challenger
);

// STRUCTS
struct Task {
uint256 numberToBeSquared;
// TODO: Replace your task params
bytes message;
uint32 taskCreatedBlock;
// task submitter decides on the criteria for a task to be completed
// note that this does not mean the task was "correctly" answered (i.e. the number was squared correctly)
Expand All @@ -44,36 +30,30 @@ interface ITangleTaskManager {
// Can be obtained by the operator from the event NewTaskCreated.
uint32 referenceTaskIndex;
// This is just the response that the operator has to compute by itself.
uint256 numberSquared;
// TODO: Replace with your expected param following Task
bytes message;
}

// Extra information related to taskResponse, which is filled inside the contract.
// It thus cannot be signed by operators, so we keep it in a separate struct than TaskResponse
// This metadata is needed by the challenger, so we emit it in the TaskResponded event
struct TaskResponseMetadata {
uint32 taskResponsedBlock;
uint32 taskRespondedBlock;
bytes32 hashOfNonSigners;
}

// FUNCTIONS
// NOTE: this function creates new task.
function createNewTask(
uint256 numberToBeSquared,
// TODO: Replace param following Task
bytes calldata message,
uint32 quorumThresholdPercentage,
bytes calldata quorumNumbers
) external;

/// @notice Returns the current 'taskNumber' for the middleware
function taskNumber() external view returns (uint32);

// // NOTE: this function raises challenge to existing tasks.
function raiseAndResolveChallenge(
Task calldata task,
TaskResponse calldata taskResponse,
TaskResponseMetadata calldata taskResponseMetadata,
BN254.G1Point[] memory pubkeysOfNonSigningOperators
) external;

/// @notice Returns the TASK_RESPONSE_WINDOW_BLOCK
function getTaskResponseWindowBlock() external view returns (uint32);
}
17 changes: 11 additions & 6 deletions contracts/src/TangleServiceManager.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.13;

import "eigenlayer-contracts/src/contracts/libraries/BytesLib.sol";
import "contracts/src/ITangleTaskManager.sol";
import "eigenlayer-middleware/src/ServiceManagerBase.sol";
import "@eigenlayer-middleware/src/ServiceManagerBase.sol";
import {IAllocationManager} from "@eigenlayer/contracts/interfaces/IAllocationManager.sol";
import {IRewardsCoordinator} from "@eigenlayer/contracts/interfaces/IRewardsCoordinator.sol";
import {ISlashingRegistryCoordinator} from
"@eigenlayer-middleware/src/interfaces/ISlashingRegistryCoordinator.sol";

/**
* @title Primary entrypoint for procuring services from Hello.
* @author Layr Labs, Inc.
*/
contract TangleServiceManager is ServiceManagerBase {
using BytesLib for bytes;

ITangleTaskManager
public immutable TangleTaskManager;

Expand All @@ -27,15 +28,19 @@ contract TangleServiceManager is ServiceManagerBase {
constructor(
IAVSDirectory _avsDirectory,
IRewardsCoordinator _rewardsCoordinator,
IRegistryCoordinator _registryCoordinator,
ISlashingRegistryCoordinator _registryCoordinator,
IStakeRegistry _stakeRegistry,
IPermissionController _permissionController,
IAllocationManager _allocationManager,
ITangleTaskManager _TangleTaskManager
)
ServiceManagerBase(
_avsDirectory,
_rewardsCoordinator,
_registryCoordinator,
_stakeRegistry
_stakeRegistry,
_permissionController,
_allocationManager
)
{
TangleTaskManager = _TangleTaskManager;
Expand Down
Loading
Loading