Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
57b3232
erc3643 base
Mar 20, 2025
2237e18
add UCEF3643 tests
Mar 20, 2025
b725a71
improve testing
Mar 20, 2025
ba4795c
add more tests
Mar 20, 2025
bea4689
improve mock contracts
Mar 20, 2025
8a8a141
test token pause
Mar 20, 2025
d1194de
remove amount from freeze and unfreeze events
Mar 20, 2025
3569f37
deploy ucef3643
Mar 20, 2025
b494ae4
correct allowance require message
Mar 21, 2025
982c590
copy deploy-full-suite.fixture and create deploy script
Mar 21, 2025
d43c64f
add progress logs
Mar 21, 2025
a6a7782
improve and split deploy script
Mar 25, 2025
117e078
inject provider on random accounts
Mar 25, 2025
005b8d3
test token behind a proxy contract
Mar 26, 2025
a730529
allow identity balance
Mar 27, 2025
1e64388
fix and split deploy-suite script
Mar 28, 2025
32d1058
Merge pull request #4 from appliedblockchain/erc3643-identity-privacy
zeluisping Oct 13, 2025
b27de58
patch imported packages
Mar 29, 2025
88010ba
split ucef and ucef3643 token into separate packages
Mar 31, 2025
4c383d0
fix ignition script and better types
Mar 31, 2025
b7ff418
add ucef3643 ignition modules
Mar 31, 2025
4a8881c
add documentation
Mar 31, 2025
205ba3b
Merge pull request #5 from appliedblockchain/multi-packages
zeluisping Oct 13, 2025
9bebb2e
patch imported packages
Mar 29, 2025
da48832
split ucef and ucef3643 token into separate packages
Mar 31, 2025
5657e10
fix ignition script and better types
Mar 31, 2025
6497baf
add ucef3643 ignition modules
Mar 31, 2025
c2b00fb
add documentation
Mar 31, 2025
de68dfa
Add MIT license
Apr 11, 2025
763aad6
Merge pull request #6 from appliedblockchain/license
zeluisping Oct 13, 2025
40739f4
chore: run pnpm upgrade
zeluisping Sep 23, 2025
c7f5866
fix: unmet SDR peer dependencies
zeluisping Sep 23, 2025
8bb8ab7
chore: fix unmet peer dependencies
zeluisping Sep 23, 2025
1ad6ff5
chore: upgrade dependencies on packages
zeluisping Sep 23, 2025
dfd7172
chore: lock dependency versions
zeluisping Oct 10, 2025
230d7e5
chore: configure pnpm security settings
zeluisping Oct 10, 2025
aecdcae
chore: update pnpm-lock
zeluisping Oct 12, 2025
4a6166d
feat: add private events to UCEF
zeluisping Sep 24, 2025
ce7a851
feat: align event privacy in UCEFOwned
zeluisping Sep 24, 2025
2f7f375
feat: align event privacy in UCEFRegulated
zeluisping Sep 24, 2025
6327b20
feat: align event privacy in UCEFSharable
zeluisping Sep 24, 2025
3ae53ad
fix: improper viewers getter definitions
zeluisping Sep 25, 2025
3b402fb
feat: provide full event context to viewer getters
zeluisping Sep 25, 2025
8ab6cfe
chore: UCEFSharable add clarification in security considerations
zeluisping Sep 25, 2025
0c2087a
fix: UCEFOwned improper approval event viewers
zeluisping Oct 1, 2025
b04021e
feat: add enhanced NatSpec for event type constants
zeluisping Oct 1, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ dist
.env.test.local
.env.production.local

.vscode
.vscode

.DS_Store
out
5 changes: 5 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": "./node_modules/hardhat/register.js",
"timeout": 40000,
"_": ["test/**/*.ts"]
}
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Security settings
minimum-release-age=1440
audit-level=moderate
ignore-scripts=true
package-manager-strict=true

# Registry configurations
@appliedblockchain:registry=https://npm.pkg.github.com
@tokenysolutions:registry=https://npm.pkg.github.com
@onchain-id:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
4 changes: 2 additions & 2 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SILENTDATA_CHAIN_ID=<silent_data_chain_id>
### 2. Compile Contracts

```bash
pnpm compile
pnpm compile:all
```

### 3. Deploy to Silent Data
Expand All @@ -50,7 +50,7 @@ pnpm install
### 2. Compile Contracts

```bash
pnpm compile
pnpm compile:all
```

### 3. Run Local Hardhat Node
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Applied Blockchain Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The rapid growth of decentralised finance highlights a critical tension between

**An unopinionated implementation**

To achieve a truly unopinionated implementation, cryptographic details should be abstracted away from the Solidity interface. This ensures that different cryptographic approaches can be swapped without altering the contracts external behaviour. Furthermore, logic around permissions and visibility controls should be programmable using standard Solidity constructs, avoiding proprietary libraries or custom extensions. The UCEF approach preserves the ERC-20 standards simplicity and composability while enabling flexible privacy rules that can adapt to evolving security requirements and compliance needs.
To achieve a truly unopinionated implementation, cryptographic details should be abstracted away from the Solidity interface. This ensures that different cryptographic approaches can be swapped without altering the contract's external behaviour. Furthermore, logic around permissions and visibility controls should be programmable using standard Solidity constructs, avoiding proprietary libraries or custom extensions. The UCEF approach preserves the ERC-20 standard's simplicity and composability while enabling flexible privacy rules that can adapt to evolving security requirements and compliance needs.

## ***Features***

Expand Down Expand Up @@ -44,3 +44,7 @@ A range of examples are available at: [contracts/examples/](contracts/examples/)
## **Adopted By**
<a href="https://silentdata.com/"><img src="https://github.com/user-attachments/assets/36ea4772-23c8-4c7a-ad2e-e3d6ee40ef9a" alt="Light Silent Data Logo" width="300"/></a>

## **License**

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

181 changes: 181 additions & 0 deletions UCEF3643.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# UCEF3643 Testing and Deployment Guide

This guide provides comprehensive instructions for testing and deploying the UCEF3643 token implementation.

## Prerequisites

- Node.js (v14 or higher)
- pnpm (recommended) or npm
- Hardhat
- Access to Silent Data credentials (for Silent Data deployment)

## Project Structure

The UCEF3643 implementation is located in the `packages/ucef-3643` directory, The root directory includes:
- Test fixtures
- Deployment script (scripts/deploy-suite.ts)
- Ignition module (ignition/modules/UCEF3643.ts)

## Testing

### Running Tests

1. Install dependencies:
```bash
pnpm install
```

2. Compile contracts:
```bash
pnpm compile:all
```

3. Run all tests:
```bash
pnpm test
```

4. Run specific test file:
```bash
pnpm test -- test/UCEF3643.test.ts
```


## Deployment

### Local Development

1. Start local Hardhat node:
```bash
pnpm chain
```

2. Configure environment:
Create a `.env` file in the root directory:
```env
PRIVATE_KEY=<deployer_private_key>
```

3. Deploy using Ignition:
```bash
pnpm deploy:module UCEF3643
```

### Silent Data Deployment

1. Configure environment:
Create a `.env` file with Silent Data credentials:
```env
PRIVATE_KEY=<deployer_private_key>
SILENTDATA_RPC_URL=<silent_data_rpc_url>
SILENTDATA_CHAIN_ID=<silent_data_chain_id>
```

2. Deploy to Silent Data:
```bash
pnpm deploy:module UCEF3643 silentdata
```

### Available Modules
| Module Name | Description |
|------------|-------------|
| UCEF3643 | Basic UCEF3643 token deployment without initialization |
| UCEF3643Init | UCEF3643 token deployment with mock registry/compliance and initialization |
| UCEF3643Proxy | UCEF3643 token deployment with proxy pattern for upgradability |


### Deployment Script

The deployment script (`scripts/deploy-suite.ts`) deploys the complete UCEF3643 suite including:
- ClaimTopicsRegistry
- TrustedIssuersRegistry
- IdentityRegistryStorage
- IdentityRegistry
- ModularCompliance
- TREXImplementationAuthority
- Token implementation

To use the deployment script:
```bash
pnpm script deploy-basic-suite
```

To use the deployment script with Silent Data network:
```bash
pnpm script deploy-basic-suite silentdata
```

The script will output the deployment addresses to the a file `DeploymentOutput.json` in the `out` directory. It's possible to export the private keys of the accounts by prepending the `EXPORT_PRIVATE_KEYS` environment variable to `true`.

```bash
EXPORT_PRIVATE_KEYS=true pnpm script deploy-basic-suite
```

## Contract Features

The UCEF3643 implementation includes:
- ERC-3643 compliance
- Identity verification
- Compliance checks
- Token freezing capabilities
- Transfer restrictions
- Agent management

## Troubleshooting

If you encounter issues:

1. Clean build artifacts:
```bash
pnpm clean:all
```

2. Recompile contracts:
```bash
pnpm compile:all
```

3. Verify environment configuration
4. Check network connectivity
5. Ensure sufficient funds for deployment

It's possible to compile each package individually:

Compile root contracts:
```bash
pnpm compile
```

Compile UCEF package contracts:
```bash
pnpm ucef compile
```

Compile UCEF3643 package contracts:
```bash
pnpm ucef-3643 compile
```

## Important Notes

- Always test thoroughly on local network before deployment
- Keep private keys and API credentials secure
- Back up deployment addresses and transaction hashes
- Monitor gas prices for optimal deployment timing
- Ensure all required contracts are properly deployed in the correct order

## Development Workflow

1. Make changes to contracts
2. Run tests to verify changes
3. Deploy to local network for testing
4. Deploy to testnet if required
5. Deploy to production network

## Security Considerations

- Verify all contract interactions
- Implement proper access controls
- Test all security-critical functions
- Review compliance requirements
- Monitor for potential vulnerabilities
3 changes: 1 addition & 2 deletions contracts/examples/UCEFCustom.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../token/UCEF.sol";
import "../extensions/UCEFOwned.sol";
import {UCEF} from "@appliedblockchain/ucef/contracts/UCEF.sol";

contract UCEFCustom is UCEF {
address public regulator;
Expand Down
5 changes: 3 additions & 2 deletions contracts/examples/UCEFOnlyOwner.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../extensions/UCEFOwned.sol";
import {UCEFOwned} from "@appliedblockchain/ucef/contracts/UCEFOwned.sol";

contract UCEFOnlyOwner is UCEFOwned {
constructor() UCEF("UCEFOnlyOwner", "uOOT") {}
constructor() UCEFOwned("UCEFOnlyOwner", "uOOT") {}

function mint(address account, uint256 amount) public {
_mint(account, amount);
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/UCEFOnlyOwnerAndRegulator.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../extensions/UCEFRegulated.sol";
import {UCEFRegulated} from "@appliedblockchain/ucef/contracts/UCEFRegulated.sol";

contract UCEFOnlyOwnerAndRegulator is UCEFRegulated {

constructor() UCEF('UCEFOnlyOwnerAndRegulator', 'uOOT') UCEFRegulated(msg.sender) {}
constructor() UCEFRegulated(msg.sender, 'UCEFOnlyOwnerAndRegulator', 'uOOT') {}

function mint(address account, uint256 amount) public {
_mint(account, amount);
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/UCEFOnlyOwnerSharable.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../extensions/UCEFSharable.sol";
import {UCEFSharable} from "@appliedblockchain/ucef/contracts/UCEFSharable.sol";

contract UCEFOnlyOwnerSharable is UCEFSharable {

constructor() UCEF('UCEFOnlyOwnerSharable', 'uOOT') UCEFSharable(msg.sender) {}
constructor() UCEFSharable(msg.sender, 'UCEFOnlyOwnerSharable', 'uOOT') {}

function mint(address account, uint256 amount) public {
_mint(account, amount);
Expand Down
6 changes: 3 additions & 3 deletions contracts/examples/UCEFOnlyOwnerWithPermit.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "../extensions/UCEFOwned.sol";
import "../extensions/UCEFPermit.sol";
import {UCEFOwned, UCEF} from "@appliedblockchain/ucef/contracts/UCEFOwned.sol";
import {UCEFPermit} from "@appliedblockchain/ucef/contracts/extensions/UCEFPermit.sol";

contract UCEFOnlyOwnerWithPermit is UCEFOwned, UCEFPermit {
constructor() UCEF("UCEFOnlyOwner", "uOOT") UCEFPermit("UCEFOnlyOwner") {}
constructor() UCEFOwned("UCEFOnlyOwner", "uOOT") UCEFPermit("UCEFOnlyOwner") {}

function mint(address account, uint256 amount) public {
_mint(account, amount);
Expand Down
Loading