Add draft for arc 20 / arc 22#131
Closed
snarkworld wants to merge 4 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds initial Draft artifacts for ARC-20 and ARC-22, including Leo interface libraries, reference programs, and Jest-based regression/integration tests to validate interface conformance and deployed ABI compatibility.
Changes:
- Add ARC-20 draft spec,
IARC20interface library, wrapper/reference programs, and Jest test suite. - Add ARC-22 draft spec,
IARC22interface library plusfreezelistprogram and associated test tooling (Merkle proof generation + ABI comparison). - Update repo-level
.gitignorefor Node workflows.
Reviewed changes
Copilot reviewed 82 out of 83 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| arc-0022/tests/package.json | Adds Node/Jest test harness deps for ARC-22 tests. |
| arc-0022/tests/lib/merkle-proof-utils.js | Adds Merkle proof formatting/generation utilities for Leo inputs. |
| arc-0022/tests/lib/arc20-wrapper-tests.js | Adds shared wrapper test helpers (ARC-20-style) under ARC-22 tests. |
| arc-0022/tests/jest.config.js | Jest configuration for ARC-22 test suite. |
| arc-0022/tests/contracts/compliant-token-template.js | JS wrapper to execute/query the ARC-22 compliant token template via leo. |
| arc-0022/tests/abi-vs-deployed.test.js | Regression test comparing local ABI vs deployed program ABI from Explorer API. |
| arc-0022/README.md | ARC-22 draft specification document. |
| arc-0022/IARC22/src/lib.leo | Defines ARC-22 interface + Merkle helper functions/constants. |
| arc-0022/IARC22/program.json | Declares IARC22 library program metadata. |
| arc-0022/IARC22/.gitignore | Ignores Leo build artifacts for the IARC22 library. |
| arc-0022/freezelist/src/main.leo | Implements freezelist.aleo program for freeze-list enforcement. |
| arc-0022/freezelist/program.json | freezelist.aleo program metadata and deps. |
| arc-0022/freezelist/build/program.json | Checked-in build metadata for freezelist.aleo. |
| arc-0022/freezelist/build/main.aleo | Checked-in compiled Aleo bytecode for freezelist.aleo. |
| arc-0022/freezelist/build/abi.json | Checked-in ABI for freezelist.aleo. |
| arc-0022/freezelist/.gitignore | Ignores Leo build artifacts for freezelist. |
| arc-0022/fmt-leo.sh | Script to run leo fmt across ARC-22 programs. |
| arc-0022/compliant_token_template/program.json | Program metadata/deps for the ARC-22 reference token template. |
| arc-0022/compliant_token_template/build/program.json | Checked-in build metadata for compliant_token_template.aleo. |
| arc-0022/compliant_token_template/build/imports/freezelist.aleo.abi.json | Checked-in imported ABI artifact for freezelist.aleo. |
| arc-0022/compliant_token_template/build/imports/freezelist.aleo | Checked-in imported bytecode for freezelist.aleo. |
| arc-0022/compliant_token_template/build/imports/freezelist.abi.json | Checked-in imported ABI artifact for freezelist.aleo (transition-style). |
| arc-0022/.gitignore | ARC-22 directory ignore rules. |
| arc-0020/wrapped_token_registry/src/main.leo | Adds wrapped_token_registry.aleo ARC-20 wrapper implementation. |
| arc-0020/wrapped_token_registry/README.md | Documentation for wrapped_token_registry.aleo. |
| arc-0020/wrapped_token_registry/program.json | Program metadata for wrapped_token_registry.aleo. |
| arc-0020/wrapped_token_registry/.gitignore | Ignores Leo build artifacts for wrapped_token_registry. |
| arc-0020/wrapped_credits/tests/wrappedCredits.test.js | Adds legacy JS harness for wrapped credits flows. |
| arc-0020/wrapped_credits/tests/test_wrapped_credits.leo | Adds compile-only Leo test for wrapper interface reachability. |
| arc-0020/wrapped_credits/tests/README.md | Documents legacy wrapped_credits test harness. |
| arc-0020/wrapped_credits/tests/package.json | Package metadata for legacy wrapped_credits tests. |
| arc-0020/wrapped_credits/tests/contract.js | Minimal JS wrapper to run Leo (optional Provable SDK). |
| arc-0020/wrapped_credits/src/main.leo | Adds wrapped_credits.aleo ARC-20 wrapper implementation. |
| arc-0020/wrapped_credits/program.json | Program metadata for wrapped_credits.aleo. |
| arc-0020/wrapped_credits/.gitignore | Ignores Leo build artifacts for wrapped_credits. |
| arc-0020/token_registry/README.md | Documentation for token_registry.aleo. |
| arc-0020/token_registry/program.json | Program metadata for token_registry.aleo. |
| arc-0020/token_registry/build/program.json | Checked-in build metadata for token_registry.aleo. |
| arc-0020/token_registry/build/imports/credits.aleo | Checked-in imported bytecode for credits.aleo. |
| arc-0020/tests/wrapped-token-registry.test.js | Jest integration tests for token registry + wrapper. |
| arc-0020/tests/wrapped-credits.test.js | Jest integration tests for wrapped credits + shared ARC20 suite. |
| arc-0020/tests/README.md | Developer instructions for running ARC-20 tests. |
| arc-0020/tests/package.json | Node/Jest harness for ARC-20 tests. |
| arc-0020/tests/lib/arc20-wrapper-tests.js | Shared ARC-20 behavioral test suite for wrappers. |
| arc-0020/tests/jest.config.js | Jest configuration for ARC-20 test suite. |
| arc-0020/tests/interface-transferrable.test.js | Static tests comparing IARC20/IARC22 interface bodies in source text. |
| arc-0020/tests/index.js | Minimal test entrypoint guidance. |
| arc-0020/tests/deposit-withdraw-logic.test.js | Static normalization test ensuring wrapper deposit/withdraw logic matches. |
| arc-0020/tests/contracts/wrapped-token-registry.js | JS helper wrapper around wrapped_token_registry.aleo. |
| arc-0020/tests/contracts/wrapped-credits.js | JS helper wrapper around wrapped_credits.aleo. |
| arc-0020/tests/contracts/token-registry.js | JS helper wrapper around token_registry.aleo. |
| arc-0020/tests/contracts/dummy-exchange.js | JS helper wrapper around dummy_exchange.aleo. |
| arc-0020/tests/.gitignore | Ignores node artifacts/logs for ARC-20 tests. |
| arc-0020/README.md | ARC-20 draft specification document. |
| arc-0020/package.json | Adds convenience script(s) for ARC-20 directory. |
| arc-0020/IARC20/src/lib.leo | Defines ARC-20 interface library. |
| arc-0020/IARC20/program.json | Declares IARC20 library program metadata. |
| arc-0020/IARC20/.gitignore | Ignores Leo build artifacts for the IARC20 library. |
| arc-0020/fmt-leo.sh | Script to run leo fmt across ARC-20 programs. |
| arc-0020/dummy_exchange/src/main.leo | Adds dynamic-dispatch demo program for ARC-20 interoperability. |
| arc-0020/dummy_exchange/program.json | Program metadata for dummy_exchange.aleo. |
| arc-0020/dummy_exchange/build/program.json | Checked-in build metadata for dummy_exchange.aleo. |
| arc-0020/dummy_exchange/build/main.aleo | Checked-in compiled Aleo bytecode for dummy_exchange.aleo. |
| arc-0020/dummy_exchange/build/imports/wrapped_credits.aleo | Checked-in imported bytecode for wrapped_credits.aleo. |
| arc-0020/dummy_exchange/build/imports/credits.aleo | Checked-in imported bytecode for credits.aleo. |
| arc-0020/dummy_exchange/build/abi.json | Checked-in ABI for dummy_exchange.aleo. |
| .gitignore | Adds Node ignores (node_modules, package-lock.json). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+43
to
+48
| fn calculate_root_depth_siblings(merkle_proof: MerkleProof) -> (field, u32) { | ||
| let root: field = calculate_hash_for_leaves( | ||
| merkle_proof.siblings[0u8], | ||
| merkle_proof.siblings[1u8], | ||
| merkle_proof.leaf_index % 2u32, | ||
| ); |
Comment on lines
+43
to
+46
| struct MerkleProof { | ||
| siblings: [field; 16], | ||
| leaf_index: u32, | ||
| } |
| { | ||
| "program": "wrapped_token_registry.aleo", | ||
| "version": "0.1.0", | ||
| "description": "Stateless wrapper around token_registry implementing TransferPublic", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: JR <121876847+snarkworld@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: JR <121876847+snarkworld@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.