Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
21 changes: 21 additions & 0 deletions clone-agent/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/lib/v2-periphery"]
path = contracts/lib/v2-periphery
url = https://github.com/Uniswap/v2-periphery
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/v2-periphery"]
path = lib/v2-periphery
url = https://github.com/Uniswap/v2-periphery
[submodule "lib/create3"]
path = lib/create3
url = https://github.com/0xsequence/create3
[submodule "contracts/lib/create3"]
path = contracts/lib/create3
url = https://github.com/0xsequence/create3
32 changes: 32 additions & 0 deletions clone-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 🤖 Clone

Clone is a **no-code agent deployer** that makes it easy to create and launch agents on **Telegram** in just a few clicks. Built for the **Agentic Ethereum Hackathon**, it integrates with multiple protocols to enable seamless automation.

## 🚀 Features

- **One-click agent deployment** – No technical knowledge required.
- **Cross-chain execution** – Powered by **Warden Agent Kit** for interoperability.
- **Data verification** – Uses **EigenLayer** to ensure trusted data sources.
- **Optimized liquidity allocation** – Utilizes **Warden Orderbook Smart Contracts** to track and allocate funds efficiently.

## 🔗 Integrations

- **Eliza on Flow SDK** – Supports `pump.flow` and VRF actions.
- **Warden Protocol** – Enables cross-chain interactions and liquidity optimization.
- **EigenLayer** – Ensures data integrity with trust-minimized verification.

## 📂 Project Links

- **GitHub:** [Clone Repository](http://github.com/Not-Sarthak/clone-xyz)
- **ETHGlobal Submission:** [View on ETHGlobal](http://ethglobal.com/showcase/clone-y0ucj)
- **Warden Orderbook Smart Contract:** `0xf3451c19a70852533c3416e76e229e15166d5f33`

## 🛠️ How to Use

1. Select a **pre-built agent template**.
2. Click **Deploy**, and your bot goes live on Telegram.
3. Manage and interact with your agent—all without writing code.

## 💡 What's Next?

We’re excited to continue building and expanding Clone's capabilities. Contributions and feedback are always welcome! 🚀
45 changes: 45 additions & 0 deletions clone-agent/contracts/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Show Forge version
run: |
forge --version

- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

- name: Run Forge build
run: |
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
20 changes: 20 additions & 0 deletions clone-agent/contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env

# Node modules
node_modules/

# Libs
lib/
9 changes: 9 additions & 0 deletions clone-agent/contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Warden Contracts

```bash
TX_FIELDS="\
(100000000000000,\
11155111,\
0x387d311e47e80b498169e6fb51d3193167d89F7D,\
0x38ed17390000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000c7d713b49da000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e000000000000000000000000000000000000000000000000000000006590af000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)"
```
238 changes: 238 additions & 0 deletions clone-agent/contracts/broadcast/Deploy.s.sol/10010/run-1739040681.json

Large diffs are not rendered by default.

238 changes: 238 additions & 0 deletions clone-agent/contracts/broadcast/Deploy.s.sol/10010/run-latest.json

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions clone-agent/contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[profile.default]
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
evm_version = "paris"
fuzz = { runs = 1_000 }
gas_reports = ["*"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
test = "test"
via_ir = true
fs_permissions = [
{ access = "read-write", path = "./broadcast" },
{ access = "read-write", path = "./broadcast/Deploy.s.sol" },
]
libs = ["lib"]

[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 4

[fmt]
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true

remappings = [
"forge-std/=lib/forge-std/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"@0xsequence/create3/=lib/create3/",
]
52 changes: 52 additions & 0 deletions clone-agent/contracts/mocks/MockAsyncPrecompile.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.25 <0.9.0;

import {
Future,
FutureByIdResponse,
FutureResponse,
FuturesResponse,
FutureResult,
FutureVote,
IAsync,
PendingFuturesResponse
} from "../src/interfaces/IAsync.sol";
import { Types } from "../src/Types.sol";

contract MockAsyncPrecompile is IAsync {
uint64 public futuresCount = 0;
mapping(uint64 id => FutureByIdResponse output) public _futures;
mapping(address orderAddress => address orderCreator) public orders;

function addFuture(string calldata handler, bytes calldata input) external returns (uint64 futureId) {
futureId = uint64(++futuresCount);
Future memory future = Future({
id: futureId,
// solhint-disable-next-line
creator: tx.origin,
handler: handler,
input: input
});

FutureVote[] memory emptyVotes = new FutureVote[](0);
bytes memory emptySubmitter;
FutureResult memory futureResult = FutureResult({ id: futureId, output: input, submitter: emptySubmitter });
FutureResponse memory futureResponse =
FutureResponse({ future: future, votes: emptyVotes, result: futureResult });
_futures[futureId] = FutureByIdResponse({ futureResponse: futureResponse });
}

function futureById(uint64 futureId) external view returns (FutureByIdResponse memory response) {
response = _futures[futureId];
}

function futures(Types.PageRequest calldata, address) external pure returns (FuturesResponse memory) {
// solhint-disable-next-line
revert("Unimplemented");
}

function pendingFutures(Types.PageRequest calldata) external pure returns (PendingFuturesResponse memory) {
// solhint-disable-next-line
revert("Unimplemented");
}
}
34 changes: 34 additions & 0 deletions clone-agent/contracts/mocks/MockSlinkyPrecompile.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.25 <0.9.0;

import { GetPriceResponse, QuotePrice, ISlinky } from "../src/interfaces/ISlinky.sol";

contract MockSlinkyPrecompile is ISlinky {
mapping(string base => mapping(string quote => uint256 price)) private prices;

function getPrice(
string calldata base,
string calldata quote
)
external
view
returns (GetPriceResponse memory response)
{
uint256 price = prices[base][quote];
if (price == 0) {
string memory s1 = string.concat("no price / nonce reported for CurrencyPair: ", base);
string memory s2 = string.concat(s1, "/");
string memory s3 = string.concat(s2, quote);
string memory s4 = string.concat(s3, ", the module is not tracking this CurrencyPair");
revert(s4);
}

QuotePrice memory quotePrice = QuotePrice({ blockHeight: 0, blockTimestamp: 0, price: price });

response = GetPriceResponse({ id: 0, nonce: 0, decimals: 9, price: quotePrice });
}

function setPrice(string calldata base, string calldata quote, uint256 price) external {
prices[base][quote] = price;
}
}
43 changes: 43 additions & 0 deletions clone-agent/contracts/mocks/MockWardenPrecompile.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.25 <0.9.0;

import { AddressesResponse, AddressType, BroadcastType, Key, KeyResponse } from "../src/interfaces/IWarden.sol";
import { Types } from "../src/Types.sol";

contract MockWardenPrecompile {
mapping(uint64 keyId => KeyResponse keyResponse) private keys;
mapping(uint64 keyId => bool isGood) private goodKeys;

function keyById(uint64, int32[] calldata) external pure returns (KeyResponse memory keyResponse) {
Key memory key;
AddressesResponse[] memory addresses = new AddressesResponse[](1);
addresses[0] = AddressesResponse({
addressValue: "0x0000000000000000000000000000000000000000",
addressType: AddressType.Ethereum
});
keyResponse = KeyResponse({ key: key, addresses: addresses });
}

function newSignRequest(
uint64 keyId,
bytes calldata,
bytes[] calldata,
bytes calldata,
Types.Coin[] calldata,
uint64,
uint64,
string calldata,
string calldata,
BroadcastType
)
external
view
returns (bool isGood)
{
isGood = goodKeys[keyId];
}

function addKey(uint64 keyId, bool isGood) external {
goodKeys[keyId] = isGood;
}
}
27 changes: 27 additions & 0 deletions clone-agent/contracts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "contracts",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"forge-std": "github:foundry-rs/forge-std#v1.8.1",
"prettier": "^3.0.0",
"solhint": "^3.6.2"
},
"dependencies": {
"@0xsequence/create3": "https://github.com/0xsequence/create3#acc4703a21ec1d71dc2a99db088c4b1f467530fd",
"@openzeppelin/contracts": "^5.0.1"
},
"scripts": {
"clean": "rm -rf cache out",
"build": "forge build src --via-ir",
"lint": "yarn run lint:sol && yarn run prettier:check",
"lint:sol": "forge fmt --check && yarn solhint \"{script,src,test}/**/*.sol\"",
"prettier:check": "prettier --check \"**/*.{json,md,yml}\" --ignore-path \".prettierignore\"",
"prettier:write": "prettier --write \"**/*.{json,md,yml}\" --ignore-path \".prettierignore\"",
"test": "forge test --via-ir",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage",
"deploy": "forge script script/Deploy.s.sol:Deploy --chain $CHAIN_ID --rpc-url $RPC_URL --broadcast -vvvv --via-ir --slow"
}
}
4 changes: 4 additions & 0 deletions clone-agent/contracts/remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
forge-std/=lib/forge-std/src/
@openzeppelin/=lib/openzeppelin-contracts/
ds-test/=lib/forge-std/lib/ds-test/src/
@0xsequence/create3/=lib/create3/
Loading