Skip to content

Commit 2a24fc9

Browse files
committed
chore: bump version to 0.3.0 and refactor contract bindings to match deployed implementation
- Bump workspace version from 0.2.0 to 0.3.0 in Cargo.toml - Refactor Makefile: split clippy into check-only and auto-fix variants, remove unused targets (cliff, uv-sync, udeps, wasm) - Update contracts.rs with complete AgenticCommerce ABI including admin functions (setPlatformFee, setEvaluatorFee, setTreasury, setHookWhitelist, ownership transfer) - Add contract-specific events (EvaluatorFeePaid, HookWhite
1 parent f927810 commit 2a24fc9

8 files changed

Lines changed: 292 additions & 233 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ default-members = ["erc8183"]
44
resolver = "3"
55

66
[workspace.package]
7-
version = "0.2.0"
7+
version = "0.3.0"
88
edition = "2024"
99
license = "MIT OR Apache-2.0"
1010
repository = "https://github.com/qntx/erc8183"
1111
description = "The Commerce Layer for AI Agents."
1212

1313
[workspace.dependencies]
14-
erc8183 = { version = "0.2", path = "erc8183" }
14+
erc8183 = { version = "0.3", path = "erc8183" }
1515

1616
alloy = { version = "1", features = ["full"] }
1717
serde = { version = "1", features = ["derive"] }

Makefile

Lines changed: 20 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,55 @@
11
# Makefile for Rust project using Cargo
22

3-
.PHONY: all
4-
all: pre-commit
3+
.PHONY: all build check run test bench clippy clippy-fix fmt doc update
4+
5+
all: fmt clippy-fix
56

67
# Build the project with all features enabled in release mode
7-
.PHONY: build
88
build:
9-
cargo build --release --all-features
9+
cargo build --workspace --release --all-features
10+
11+
# Check the project for compilation errors without producing binaries
12+
check:
13+
cargo check --workspace --all-features
1014

1115
# Update dependencies to their latest compatible versions
12-
.PHONY: update
1316
update:
1417
cargo update
1518

1619
# Run the project with all features enabled in release mode
17-
.PHONY: run
1820
run:
1921
cargo run --release --all-features
2022

2123
# Run all tests with all features enabled
22-
.PHONY: test
2324
test:
24-
cargo test --all-features
25+
cargo test --workspace --all-features
2526

2627
# Run benchmarks with all features enabled
27-
.PHONY: bench
2828
bench:
2929
cargo bench --all-features
3030

31-
# Run Clippy linter with nightly toolchain, fixing issues automatically
32-
# and applying strict linting rules (uses workspace lints from Cargo.toml)
33-
.PHONY: clippy
31+
# Run Clippy linter with nightly toolchain (check only, for CI)
32+
# Uses workspace lints from Cargo.toml
3433
clippy:
35-
cargo +nightly clippy --fix \
34+
cargo +nightly clippy --workspace \
35+
--all-targets \
36+
--all-features \
37+
-- -D warnings
38+
39+
# Run Clippy linter with auto-fix (for development)
40+
clippy-fix:
41+
cargo +nightly clippy --workspace \
42+
--fix \
3643
--all-targets \
3744
--all-features \
3845
--allow-dirty \
3946
--allow-staged \
4047
-- -D warnings
4148

4249
# Format the code using rustfmt with nightly toolchain
43-
.PHONY: fmt
4450
fmt:
4551
cargo +nightly fmt
4652

4753
# Generate documentation for all crates and open it in the browser
48-
.PHONY: doc
4954
doc:
5055
cargo +nightly doc --all-features --no-deps --open
51-
52-
# Generate CHANGELOG.md using git-cliff
53-
.PHONY: cliff
54-
cliff:
55-
git-cliff
56-
git cliff --output CHANGELOG.md
57-
58-
# Sync Python environment using uv
59-
.PHONY: uv-sync
60-
uv-sync:
61-
uv venv
62-
uv lock --upgrade
63-
uv sync
64-
uv run "./scripts/gen_stub.py" kand kand-py/python/kand/_kand.pyi
65-
66-
# Check for unused dependencies using cargo-udeps with nightly toolchain
67-
.PHONY: udeps
68-
udeps:
69-
cargo +nightly udeps --all-features
70-
71-
# Update and run udeps to check for unused dependencies
72-
.PHONY: udeps-check
73-
udeps-check:
74-
cargo update
75-
cargo +nightly udeps --all-features
76-
77-
78-
# Build the wasm package
79-
.PHONY: wasm-build
80-
wasm-build:
81-
@echo "Building WASM package..."
82-
(cd kand-wasm && wasm-pack build --target web && wasm-pack pack pkg)
83-
84-
# Publish the wasm package to npm
85-
# Note: You must be logged in to npm for this to work (`npm login`)
86-
.PHONY: wasm-publish
87-
wasm-publish: wasm-build
88-
@echo "Publishing WASM package to npm..."
89-
(cd kand-wasm/pkg && npm pkg fix && npm pkg set name="kand" && npm publish --access public)
90-
91-
# Convenience target to build and publish wasm
92-
.PHONY: wasm
93-
wasm: wasm-publish
94-
95-
# Run pre-commit hooks on all files
96-
.PHONY: pre-commit
97-
pre-commit:
98-
$(MAKE) build
99-
$(MAKE) test
100-
$(MAKE) clippy
101-
$(MAKE) fmt
102-
$(MAKE) cliff
103-
$(MAKE) udeps-check
104-
$(MAKE) wasm-build
105-
$(MAKE) uv-sync

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- markdownlint-disable MD033 MD041 MD001 -->
2+
13
# erc8183
24

35
[![CI][ci-badge]][ci-url]
@@ -113,7 +115,7 @@ println!("Budget: {}", job.budget);
113115
| Module | Description |
114116
| --- | --- |
115117
| **[`Erc8183`](erc8183/src/client.rs)** | Top-level client — generic over `P: Provider`, builder pattern for address configuration |
116-
| **[`JobHandle`](erc8183/src/job.rs)** | Job operations `create_job`, `set_provider`, `set_budget`, `fund`, `submit`, `complete`, `reject`, `claim_refund` |
118+
| **[`JobHandle`](erc8183/src/job.rs)** | Job lifecycle + view + admin `create_job`, `fund`, `submit`, `complete`, `reject`, `claim_refund`, `get_job`, `total_jobs`, `set_platform_fee`, etc. |
117119
| **[`types`](erc8183/src/types.rs)** | Domain types — `JobStatus`, `Job`, `CreateJobParams`, `SubmitParams`, `AttestParams` |
118120
| **[`contracts`](erc8183/src/contracts.rs)** | Inline Solidity bindings (`sol!` macro) — `AgenticCommerce` contract and `IACPHook` interface |
119121
| **[`error`](erc8183/src/error.rs)** | Error types — `Error` enum with `thiserror`, covers contract/transport/status errors |
@@ -173,7 +175,7 @@ stateDiagram-v2
173175

174176
| Event | Parameters |
175177
| --- | --- |
176-
| `JobCreated` | jobId, client, provider, evaluator, expiredAt |
178+
| `JobCreated` | jobId, client, provider, evaluator, expiredAt, hook |
177179
| `ProviderSet` | jobId, provider |
178180
| `BudgetSet` | jobId, amount |
179181
| `JobFunded` | jobId, client, amount |

erc8183-cli/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! This binary provides a command-line interface for managing jobs and
44
//! interacting with the Agentic Commerce contract.
55
6+
#[allow(clippy::print_stdout)]
67
fn main() {
78
println!("Hello, world!");
89
}

0 commit comments

Comments
 (0)