Skip to content

Commit b2b3ea5

Browse files
authored
Clean up final comments
1 parent 4eb8c83 commit b2b3ea5

6 files changed

Lines changed: 3 additions & 162 deletions

File tree

arc-0020/IARC20/program.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"description": "",
55
"license": "MIT",
6-
"leo": "4.0.2",
6+
"leo": "4.1.0",
77
"dependencies": null,
88
"dev_dependencies": null
99
}

arc-0020/README.md

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,53 +28,6 @@ Without a standard interface, every DeFi program must import each token at compi
2828

2929
The fungible token interface. Every ARC-20 token must implement these functions and **`view fn`** accessors:
3030

31-
```leo
32-
interface IARC20 {
33-
record Token {
34-
owner: address,
35-
amount: u128,
36-
..
37-
}
38-
//=============================================================
39-
// TRANSFER FUNCTIONS
40-
//=============================================================
41-
fn transfer_public(public recipient: address, public amount: u128) -> Final;
42-
fn transfer_private(private input: Token, private recipient: address, private amount: u128) -> (Token, Token);
43-
fn transfer_private_to_public(private input: Token, public recipient: address, private amount: u128) -> (Token, Final);
44-
fn transfer_public_to_private(private recipient: address, public amount: u128) -> (Token, Final);
45-
fn transfer_public_as_signer(public recipient: address, public amount: u128) -> Final;
46-
fn transfer_from_public(public owner: address, public recipient: address, public amount: u128) -> Final;
47-
fn transfer_from_public_to_private(
48-
public owner: address,
49-
private recipient: address,
50-
public amount: u128,
51-
) -> (Token, Final);
52-
53-
//=============================================================
54-
// APPROVAL FUNCTIONS
55-
//=============================================================
56-
fn approve_public(public spender: address, public amount: u128) -> Final;
57-
fn unapprove_public(public spender: address, public amount: u128) -> Final;
58-
59-
//=============================================================
60-
// JOIN/SPLIT FUNCTIONS
61-
//=============================================================
62-
fn join(private input_1: Token, private input_2: Token) -> Token;
63-
fn split(private input: Token, private amount: u128) -> (Token, Token);
64-
65-
//=============================================================
66-
// VIEW FUNCTIONS
67-
//=============================================================
68-
view fn balance_of(account: address) -> u128;
69-
view fn allowance(owner: address, spender: address) -> u128;
70-
view fn supply() -> u128;
71-
view fn max_supply() -> u128;
72-
view fn decimals() -> u8;
73-
view fn name() -> identifier;
74-
view fn symbol() -> identifier;
75-
}
76-
```
77-
7831
### Record Types
7932

8033
**Token** -- Represents a private token balance. Implementations may add additional fields beyond `owner` and `amount`:

arc-0022/IARC22/program.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"description": "",
55
"license": "MIT",
6-
"leo": "4.0.2",
6+
"leo": "4.1.0",
77
"dependencies": null,
88
"dev_dependencies": null
99
}

arc-0022/IARC22/src/lib.leo

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -108,36 +108,6 @@ fn verify_non_inclusion(addr: address, merkle_proofs: [MerkleProof; 2]) -> field
108108
return root1;
109109
}
110110

111-
interface IARC22Freezelist {
112-
// Initializes the freeze list and the admin. Sets the block height window, the initial empty Merkle root,
113-
fn initialize(public admin: address, public blocks: u32) -> Final;
114-
115-
// Freezes or unfreezes an account based on the action flag (true = freeze, false = unfreeze)
116-
fn update_freeze_list(
117-
public account: address,
118-
public is_frozen: bool,
119-
public index: u32,
120-
public existing_root: field,
121-
public new_root: field,
122-
) -> Final;
123-
124-
// Verifies that an account is not currently frozen.
125-
fn verify_non_inclusion_pub(public account: address) -> Final;
126-
127-
// Verifies that an account is not included in the freeze list Merkle tree.
128-
fn verify_non_inclusion_priv(account: address, merkle_proof: [MerkleProof; 2u32]) -> Final;
129-
130-
//=============================================================
131-
// VIEW FUNCTIONS
132-
//=============================================================
133-
view fn is_frozen_address(account: address) -> bool;
134-
view fn is_frozen_index(index: u32) -> bool;
135-
view fn current_freeze_list_root() -> field;
136-
view fn previous_freeze_list_root() -> field;
137-
view fn root_updated_height() -> u32;
138-
view fn block_height_window() -> u32;
139-
}
140-
141111
interface IARC22 {
142112
record Token {
143113
owner: address,

arc-0022/README.md

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ARC-22 defines a compliant fungible token interface for Aleo. It modifies [ARC-2
1414

1515
## Motivation
1616

17-
ARC-20 provides a minimal token standard but lacks regulatory compliance features required by many real-world token deployments. Regulated tokens compliance mechanisms such as:
17+
ARC-20 provides a minimal token standard but lacks regulatory compliance features required by many real-world token deployments. Regulated tokens need compliance mechanisms such as:
1818

1919
1. **Freeze lists** to block sanctioned or compromised addresses from transacting
2020
2. **Audit trails** for private transfers, enabling authorized investigators to review token movements without exposing sender identity to the public
@@ -34,74 +34,6 @@ The ARC-22 standard provides a library ([`IARC22`](./IARC22)), which is composed
3434

3535
The compliant token surface adds freeze-list enforcement (via Merkle non-inclusion proofs on private sends) and investigator-visible **`ComplianceRecord`** outputs on every transition that materially changes a balance. Mappings and storage variables are intentionally **not** part of the interface; only function signatures and the records (**`Token`**, **`ComplianceRecord`**) form the contract.
3636

37-
```leo
38-
interface IARC22 {
39-
record Token {
40-
owner: address,
41-
amount: u128,
42-
..
43-
}
44-
45-
record ComplianceRecord {
46-
owner: address, // INVESTIGATOR_ADDRESS
47-
amount: u128,
48-
sender: address, // ZERO_ADDRESS for mint paths
49-
recipient: address, // ZERO_ADDRESS for burn paths
50-
..
51-
}
52-
53-
//=============================================================
54-
// APPROVAL FUNCTIONS
55-
//=============================================================
56-
fn approve_public(public spender: address, public amount: u128) -> Final;
57-
fn unapprove_public(public spender: address, public amount: u128) -> Final;
58-
59-
//=============================================================
60-
// TRANSFER FUNCTIONS
61-
//=============================================================
62-
fn transfer_public(public recipient: address, public amount: u128) -> Final;
63-
fn transfer_private(
64-
private recipient: address,
65-
private amount: u128,
66-
private input_record: Token,
67-
private sender_merkle_proofs: [MerkleProof; 2u32],
68-
) -> (ComplianceRecord, Token, Token, Final);
69-
fn transfer_private_to_public(
70-
public recipient: address,
71-
public amount: u128,
72-
private input_record: Token,
73-
private sender_merkle_proofs: [MerkleProof; 2u32],
74-
) -> (ComplianceRecord, Token, Final);
75-
fn transfer_public_to_private(recipient: address, public amount: u128) -> (
76-
ComplianceRecord, Token, Final,
77-
);
78-
fn transfer_from_public(public owner: address, public recipient: address, public amount: u128) -> Final;
79-
fn transfer_from_public_to_private(
80-
public owner: address,
81-
private recipient: address,
82-
public amount: u128,
83-
) -> (ComplianceRecord, Token, Final);
84-
fn transfer_public_as_signer(public recipient: address, public amount: u128) -> Final;
85-
86-
//=============================================================
87-
// JOIN/SPLIT FUNCTIONS
88-
//=============================================================
89-
fn join(input_1: Token, input_2: Token) -> Token;
90-
fn split(input: Token, amount: u128) -> (Token, Token);
91-
92-
//=============================================================
93-
// VIEW FUNCTIONS
94-
//=============================================================
95-
view fn balance_of(account: address) -> u128;
96-
view fn allowance(owner: address, spender: address) -> u128;
97-
view fn supply() -> u128;
98-
view fn max_supply() -> u128;
99-
view fn decimals() -> u8;
100-
view fn name() -> identifier;
101-
view fn symbol() -> identifier;
102-
}
103-
```
104-
10537
**Merkle non-inclusion proofs** are required only on transitions where the sender is private -- **`transfer_private`** and **`transfer_private_to_public`**. Transitions where the sender is public -- **`transfer_public_to_private`** and **`transfer_from_public_to_private`** -- check the sender against the freeze list directly via **`is_frozen_address`** (or the equivalent **`verify_non_inclusion_pub`** helper).
10638

10739
**Compliance coverage.** Every transition that moves balances on a private path -- **`transfer_private`**, **`transfer_private_to_public`**, **`transfer_public_to_private`**, and **`transfer_from_public_to_private`** -- emits a **`ComplianceRecord`** owned by **`INVESTIGATOR_ADDRESS`**, so the investigator can decrypt the full sender / recipient / amount tuple whenever at least one side is private.

arc-0022/freezelist/tests/test_arc22freezelist.leo

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)