@chainlink/ace 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/.foundry-version +1 -0
  2. package/.github/CODEOWNERS +1 -0
  3. package/.github/workflows/auto-release-version.yml +107 -0
  4. package/.github/workflows/create-version-pr.yml +95 -0
  5. package/.github/workflows/forge-docs.yml +90 -0
  6. package/.github/workflows/forge-test.yml +59 -0
  7. package/.solhint-test.json +18 -0
  8. package/.solhint.json +16 -0
  9. package/.solhintignore +3 -0
  10. package/.solhintignore-test +2 -0
  11. package/Glossary.md +141 -0
  12. package/LICENSE +59 -0
  13. package/README.md +218 -0
  14. package/assets/chainlink-logo.svg +21 -0
  15. package/chainlink-ace-License-grants +2 -0
  16. package/foundry.toml +33 -0
  17. package/getting_started/GETTING_STARTED.md +477 -0
  18. package/getting_started/MyVault.sol +48 -0
  19. package/getting_started/advanced/.env.example +36 -0
  20. package/getting_started/advanced/GETTING_STARTED_ADVANCED.md +431 -0
  21. package/getting_started/advanced/SanctionsList.sol +25 -0
  22. package/getting_started/advanced/SanctionsPolicy.sol +58 -0
  23. package/package.json +41 -0
  24. package/packages/cross-chain-identity/README.md +148 -0
  25. package/packages/cross-chain-identity/docs/API_GUIDE.md +120 -0
  26. package/packages/cross-chain-identity/docs/API_REFERENCE.md +271 -0
  27. package/packages/cross-chain-identity/docs/CONCEPTS.md +253 -0
  28. package/packages/cross-chain-identity/docs/CREDENTIAL_FLOW.md +195 -0
  29. package/packages/cross-chain-identity/docs/SECURITY.md +70 -0
  30. package/packages/cross-chain-identity/src/CredentialRegistry.sol +245 -0
  31. package/packages/cross-chain-identity/src/CredentialRegistryIdentityValidator.sol +339 -0
  32. package/packages/cross-chain-identity/src/CredentialRegistryIdentityValidatorPolicy.sol +71 -0
  33. package/packages/cross-chain-identity/src/IdentityRegistry.sol +123 -0
  34. package/packages/cross-chain-identity/src/TrustedIssuerRegistry.sol +140 -0
  35. package/packages/cross-chain-identity/src/interfaces/ICredentialDataValidator.sol +30 -0
  36. package/packages/cross-chain-identity/src/interfaces/ICredentialRegistry.sol +170 -0
  37. package/packages/cross-chain-identity/src/interfaces/ICredentialRequirements.sol +192 -0
  38. package/packages/cross-chain-identity/src/interfaces/ICredentialValidator.sol +37 -0
  39. package/packages/cross-chain-identity/src/interfaces/IIdentityRegistry.sol +85 -0
  40. package/packages/cross-chain-identity/src/interfaces/IIdentityValidator.sol +18 -0
  41. package/packages/cross-chain-identity/src/interfaces/ITrustedIssuerRegistry.sol +61 -0
  42. package/packages/cross-chain-identity/test/CredentialRegistry.t.sol +220 -0
  43. package/packages/cross-chain-identity/test/CredentialRegistryIdentityValidator.t.sol +554 -0
  44. package/packages/cross-chain-identity/test/CredentialRegistryIdentityValidatorPolicy.t.sol +114 -0
  45. package/packages/cross-chain-identity/test/IdentityRegistry.t.sol +106 -0
  46. package/packages/cross-chain-identity/test/IdentityValidator.t.sol +969 -0
  47. package/packages/cross-chain-identity/test/TrustedIssuerRegistry.t.sol +123 -0
  48. package/packages/cross-chain-identity/test/helpers/BaseProxyTest.sol +112 -0
  49. package/packages/cross-chain-identity/test/helpers/MockCredentialDataValidator.sol +26 -0
  50. package/packages/cross-chain-identity/test/helpers/MockCredentialRegistryReverting.sol +131 -0
  51. package/packages/policy-management/README.md +197 -0
  52. package/packages/policy-management/docs/API_GUIDE.md +290 -0
  53. package/packages/policy-management/docs/API_REFERENCE.md +173 -0
  54. package/packages/policy-management/docs/CONCEPTS.md +156 -0
  55. package/packages/policy-management/docs/CUSTOM_POLICIES_TUTORIAL.md +195 -0
  56. package/packages/policy-management/docs/POLICY_ORDERING_GUIDE.md +91 -0
  57. package/packages/policy-management/docs/SECURITY.md +57 -0
  58. package/packages/policy-management/src/core/Policy.sol +124 -0
  59. package/packages/policy-management/src/core/PolicyEngine.sol +382 -0
  60. package/packages/policy-management/src/core/PolicyFactory.sol +92 -0
  61. package/packages/policy-management/src/core/PolicyProtected.sol +126 -0
  62. package/packages/policy-management/src/extractors/ComplianceTokenForceTransferExtractor.sol +57 -0
  63. package/packages/policy-management/src/extractors/ComplianceTokenFreezeUnfreezeExtractor.sol +54 -0
  64. package/packages/policy-management/src/extractors/ComplianceTokenMintBurnExtractor.sol +61 -0
  65. package/packages/policy-management/src/extractors/ERC20ApproveExtractor.sol +57 -0
  66. package/packages/policy-management/src/extractors/ERC20TransferExtractor.sol +62 -0
  67. package/packages/policy-management/src/extractors/ERC3643ForcedTransferExtractor.sol +56 -0
  68. package/packages/policy-management/src/extractors/ERC3643FreezeUnfreezeExtractor.sol +55 -0
  69. package/packages/policy-management/src/extractors/ERC3643MintBurnExtractor.sol +51 -0
  70. package/packages/policy-management/src/extractors/ERC3643SetAddressFrozenExtractor.sol +51 -0
  71. package/packages/policy-management/src/interfaces/IExtractor.sol +17 -0
  72. package/packages/policy-management/src/interfaces/IMapper.sol +17 -0
  73. package/packages/policy-management/src/interfaces/IPolicy.sol +61 -0
  74. package/packages/policy-management/src/interfaces/IPolicyEngine.sol +264 -0
  75. package/packages/policy-management/src/interfaces/IPolicyProtected.sol +48 -0
  76. package/packages/policy-management/src/policies/AllowPolicy.sol +104 -0
  77. package/packages/policy-management/src/policies/BypassPolicy.sol +90 -0
  78. package/packages/policy-management/src/policies/IntervalPolicy.sol +223 -0
  79. package/packages/policy-management/src/policies/MaxPolicy.sol +73 -0
  80. package/packages/policy-management/src/policies/OnlyAuthorizedSenderPolicy.sol +84 -0
  81. package/packages/policy-management/src/policies/OnlyOwnerPolicy.sol +35 -0
  82. package/packages/policy-management/src/policies/PausePolicy.sol +82 -0
  83. package/packages/policy-management/src/policies/README.md +632 -0
  84. package/packages/policy-management/src/policies/RejectPolicy.sol +89 -0
  85. package/packages/policy-management/src/policies/RoleBasedAccessControlPolicy.sol +162 -0
  86. package/packages/policy-management/src/policies/SecureMintPolicy.sol +271 -0
  87. package/packages/policy-management/src/policies/VolumePolicy.sol +133 -0
  88. package/packages/policy-management/src/policies/VolumeRatePolicy.sol +192 -0
  89. package/packages/policy-management/test/PolicyEngine.t.sol +368 -0
  90. package/packages/policy-management/test/PolicyFactory.t.sol +114 -0
  91. package/packages/policy-management/test/PolicyProtectedToken.t.sol +75 -0
  92. package/packages/policy-management/test/extractors/ComplianceTokenForceTransferExtractor.t.sol +59 -0
  93. package/packages/policy-management/test/extractors/ComplianceTokenFreezeUnfreezeExtractor.t.sol +74 -0
  94. package/packages/policy-management/test/extractors/ComplianceTokenMintBurnExtractor.t.sol +92 -0
  95. package/packages/policy-management/test/extractors/ERC20ApproveExtractor.t.sol +58 -0
  96. package/packages/policy-management/test/extractors/ERC3643ForcedTransferExtractor.t.sol +59 -0
  97. package/packages/policy-management/test/extractors/ERC3643FreezeUnfreezeExtractor.t.sol +74 -0
  98. package/packages/policy-management/test/extractors/ERC3643MintBurnExtractor.t.sol +73 -0
  99. package/packages/policy-management/test/extractors/ERC3643SetAddressFrozenExtractor.t.sol +56 -0
  100. package/packages/policy-management/test/helpers/BaseProxyTest.sol +75 -0
  101. package/packages/policy-management/test/helpers/CustomMapper.sol +26 -0
  102. package/packages/policy-management/test/helpers/DummyExtractor.sol +11 -0
  103. package/packages/policy-management/test/helpers/ExpectedParameterPolicy.sol +39 -0
  104. package/packages/policy-management/test/helpers/MockAggregatorV3.sol +51 -0
  105. package/packages/policy-management/test/helpers/MockToken.sol +66 -0
  106. package/packages/policy-management/test/helpers/MockTokenExtractor.sol +34 -0
  107. package/packages/policy-management/test/helpers/PolicyAlwaysAllowed.sol +45 -0
  108. package/packages/policy-management/test/helpers/PolicyAlwaysContinue.sol +23 -0
  109. package/packages/policy-management/test/helpers/PolicyAlwaysRejected.sol +23 -0
  110. package/packages/policy-management/test/helpers/PolicyFailingRun.sol +22 -0
  111. package/packages/policy-management/test/policies/AllowPolicy.t.sol +174 -0
  112. package/packages/policy-management/test/policies/BypassPolicy.t.sol +159 -0
  113. package/packages/policy-management/test/policies/IntervalPolicy.t.sol +307 -0
  114. package/packages/policy-management/test/policies/MaxPolicy.t.sol +54 -0
  115. package/packages/policy-management/test/policies/OnlyAuthorizedSenderPolicy.t.sol +95 -0
  116. package/packages/policy-management/test/policies/OnlyOwnerPolicy.t.sol +47 -0
  117. package/packages/policy-management/test/policies/PausePolicy.t.sol +75 -0
  118. package/packages/policy-management/test/policies/RejectPolicy.t.sol +182 -0
  119. package/packages/policy-management/test/policies/RoleBasedAccessControlPolicy.t.sol +223 -0
  120. package/packages/policy-management/test/policies/SecureMintPolicy.t.sol +442 -0
  121. package/packages/policy-management/test/policies/VolumePolicy.t.sol +158 -0
  122. package/packages/policy-management/test/policies/VolumeRatePolicy.t.sol +165 -0
  123. package/packages/tokens/erc-20/src/ComplianceTokenERC20.sol +345 -0
  124. package/packages/tokens/erc-20/src/ComplianceTokenStoreERC20.sol +29 -0
  125. package/packages/tokens/erc-20/test/ComplianceTokenERC20.t.sol +556 -0
  126. package/packages/tokens/erc-20/test/helpers/BaseProxyTest.sol +75 -0
  127. package/packages/tokens/erc-3643/README.md +24 -0
  128. package/packages/tokens/erc-3643/src/ComplianceTokenERC3643.sol +564 -0
  129. package/packages/tokens/erc-3643/src/ComplianceTokenStoreERC3643.sol +30 -0
  130. package/packages/tokens/erc-3643/test/ComplianceTokenERC3643.t.sol +815 -0
  131. package/packages/tokens/erc-3643/test/helpers/BaseProxyTest.sol +76 -0
  132. package/packages/tokens/erc-3643/test/helpers/ExpectedContextPolicy.sol +32 -0
  133. package/packages/vendor/erc-3643/compliance/modular/IModularCompliance.sol +220 -0
  134. package/packages/vendor/erc-3643/registry/interface/IClaimTopicsRegistry.sol +101 -0
  135. package/packages/vendor/erc-3643/registry/interface/IIdentityRegistry.sol +251 -0
  136. package/packages/vendor/erc-3643/registry/interface/IIdentityRegistryStorage.sol +191 -0
  137. package/packages/vendor/erc-3643/registry/interface/ITrustedIssuersRegistry.sol +161 -0
  138. package/packages/vendor/erc-3643/token/IToken.sol +457 -0
  139. package/packages/vendor/onchain-id/interface/IClaimIssuer.sol +53 -0
  140. package/packages/vendor/onchain-id/interface/IERC734.sol +110 -0
  141. package/packages/vendor/onchain-id/interface/IERC735.sol +105 -0
  142. package/packages/vendor/onchain-id/interface/IIdentity.sol +26 -0
  143. package/packages/vendor/onchain-id/interface/IImplementationAuthority.sol +21 -0
  144. package/remappings.txt +6 -0
  145. package/script/DeployComplianceTokenERC20.s.sol +191 -0
  146. package/script/DeployComplianceTokenERC3643.s.sol +208 -0
  147. package/script/DeploySimpleComplianceToken.s.sol +38 -0
  148. package/script/getting_started/DeployGettingStarted.s.sol +74 -0
  149. package/script/getting_started/advanced/DeployAdvancedGettingStarted.s.sol +332 -0
  150. package/script/getting_started/advanced/DeploySanctionsList.s.sol +26 -0
@@ -0,0 +1 @@
1
+ v0.3.0
@@ -0,0 +1 @@
1
+ * @smartcontractkit/capital-markets
@@ -0,0 +1,107 @@
1
+ name: Auto Release on Version PR Merge
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+
7
+ jobs:
8
+ extract-version:
9
+ name: Extract Version
10
+ runs-on: ubuntu-latest
11
+ if: |
12
+ github.event.pull_request.merged == true &&
13
+ contains(github.event.pull_request.labels.*.name, 'release')
14
+ permissions:
15
+ contents: none
16
+ outputs:
17
+ version: ${{ steps.extract-version.outputs.version }}
18
+ steps:
19
+ - name: Extract version from PR title
20
+ id: extract-version
21
+ env:
22
+ PR_TITLE: ${{ github.event.pull_request.title }}
23
+ run: |
24
+ # Extract version from PR title like "Release v1.2.3"
25
+ VERSION=$(echo "$PR_TITLE" | sed -n 's/Release v\([0-9]\+\.[0-9]\+\.[0-9]\+\)/\1/p')
26
+ if [ -z "$VERSION" ]; then
27
+ echo "Could not extract version from PR title: $PR_TITLE"
28
+ exit 1
29
+ fi
30
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
31
+ echo "Extracted version: $VERSION"
32
+
33
+ create-release:
34
+ name: Create Release
35
+ needs: extract-version
36
+ runs-on: ubuntu-latest
37
+ permissions:
38
+ contents: write
39
+ pull-requests: write
40
+ actions: write
41
+ steps:
42
+ - name: Checkout repository
43
+ uses: actions/checkout@v4
44
+ with:
45
+ fetch-depth: 0 # Fetch full history for better release notes
46
+
47
+ - name: Create Release
48
+ id: create-release
49
+ uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
50
+ with:
51
+ tag_name: v${{ needs.extract-version.outputs.version }}
52
+ name: Release v${{ needs.extract-version.outputs.version }}
53
+ generate_release_notes: true
54
+ make_latest: true
55
+ body: |
56
+ ## Release v${{ needs.extract-version.outputs.version }}
57
+
58
+ This release was automatically created when PR #${{ github.event.pull_request.number }} was merged.
59
+
60
+ **PR Details:**
61
+ - Title: ${{ github.event.pull_request.title }}
62
+ - Author: ${{ github.event.pull_request.user.login }}
63
+ - Merged by: ${{ github.event.pull_request.merged_by.login }}
64
+
65
+ **Changes:**
66
+ ${{ github.event.pull_request.body }}
67
+
68
+ - name: Comment on PR
69
+ uses: actions/github-script@v7
70
+ env:
71
+ RELEASE_VERSION: ${{ needs.extract-version.outputs.version }}
72
+ RELEASE_URL: ${{ steps.create-release.outputs.url }}
73
+ with:
74
+ script: |
75
+ const { data: comment } = await github.rest.issues.createComment({
76
+ owner: context.repo.owner,
77
+ repo: context.repo.repo,
78
+ issue_number: context.payload.pull_request.number,
79
+ body: `🎉 **Release Created Successfully!**
80
+
81
+ Release v${process.env.RELEASE_VERSION} has been created and is now available.
82
+
83
+ **Release Details:**
84
+ - Tag: \`v${process.env.RELEASE_VERSION}\`
85
+ - Release URL: ${process.env.RELEASE_URL}
86
+
87
+ Thank you for contributing to this release! 🚀`
88
+ });
89
+
90
+ - name: Delete Release Branch
91
+ uses: actions/github-script@v7
92
+ with:
93
+ script: |
94
+ const branchName = context.payload.pull_request.head.ref;
95
+ console.log(`Deleting branch: ${branchName}`);
96
+
97
+ try {
98
+ await github.rest.git.deleteRef({
99
+ owner: context.repo.owner,
100
+ repo: context.repo.repo,
101
+ ref: `heads/${branchName}`
102
+ });
103
+ console.log(`Successfully deleted branch: ${branchName}`);
104
+ } catch (error) {
105
+ console.log(`Failed to delete branch ${branchName}:`, error.message);
106
+ // Don't fail the workflow if branch deletion fails
107
+ }
@@ -0,0 +1,95 @@
1
+ name: Create Version Update PR
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: 'Version to release (e.g. 1.0.0)'
8
+ required: true
9
+ target_branch:
10
+ description: 'Target branch for the PR (default: main)'
11
+ required: false
12
+ default: 'main'
13
+
14
+ jobs:
15
+ verify-version:
16
+ name: Verify version
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ contents: none
20
+ steps:
21
+ - name: Check if version is valid
22
+ run: |
23
+ if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
24
+ echo "Invalid version format. Please use semantic versioning (e.g. 1.0.0)."
25
+ exit 1
26
+ fi
27
+
28
+ create-version-pr:
29
+ name: Create Version Update PR
30
+ needs: verify-version
31
+ runs-on: ubuntu-latest
32
+ permissions:
33
+ contents: write
34
+ pull-requests: write
35
+ steps:
36
+ - name: Checkout repository
37
+ uses: actions/checkout@v4
38
+ with:
39
+ token: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0
42
+ name: Install pnpm
43
+ with:
44
+ version: 8
45
+ run_install: false
46
+
47
+ - name: Create version branch
48
+ run: |
49
+ git config user.name "github-actions"
50
+ git config user.email "github-actions@users.noreply.github.com"
51
+ git checkout -b release/v${{ inputs.version }}
52
+
53
+ - name: Update package.json version
54
+ run: pnpm version --no-git-tag-version --allow-same-version ${{ inputs.version }}
55
+
56
+ - name: Commit version changes
57
+ run: |
58
+ git add package.json
59
+ git commit -m "chore: update package.json to version ${{ inputs.version }} for release"
60
+
61
+ - name: Push version branch
62
+ run: git push origin release/v${{ inputs.version }}
63
+
64
+ - name: Create Pull Request
65
+ uses: actions/github-script@v7
66
+ with:
67
+ script: |
68
+ const { data: pr } = await github.rest.pulls.create({
69
+ owner: context.repo.owner,
70
+ repo: context.repo.repo,
71
+ title: `Release v${{ inputs.version }}`,
72
+ head: `release/v${{ inputs.version }}`,
73
+ base: '${{ inputs.target_branch }}',
74
+ body: `## Release v${{ inputs.version }}
75
+
76
+ This PR updates the package.json version to ${{ inputs.version }} for release.
77
+
78
+ **Note**: This PR was automatically created by the release workflow. Merging this PR will trigger the release creation.
79
+
80
+ ### Changes
81
+ - Updated package.json version to ${{ inputs.version }}
82
+ - Target branch: \`${{ inputs.target_branch }}\``
83
+ });
84
+
85
+ console.log(`Created PR #${pr.number}: ${pr.html_url}`);
86
+
87
+ // Add labels to the PR
88
+ await github.rest.issues.addLabels({
89
+ owner: context.repo.owner,
90
+ repo: context.repo.repo,
91
+ issue_number: pr.number,
92
+ labels: ['release', 'automated']
93
+ });
94
+
95
+ console.log(`Added labels to PR #${pr.number}: release, automated`);
@@ -0,0 +1,90 @@
1
+ name: Deploy Forge docs site to Pages
2
+
3
+ on:
4
+ # Runs on pushes targeting the default branch
5
+ push:
6
+ branches: ["main"]
7
+
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19
+ concurrency:
20
+ group: "pages"
21
+ cancel-in-progress: false
22
+
23
+ jobs:
24
+ # Build job
25
+ build:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - name: Checkout
29
+ uses: actions/checkout@v4
30
+
31
+ - name: Install Node.js
32
+ uses: actions/setup-node@v4
33
+ with:
34
+ node-version: 20
35
+
36
+ - name: Read foundry version from .foundry-version
37
+ shell: bash
38
+ run: |
39
+ echo "FOUNDRY_VERSION=$(cat .foundry-version)" >> $GITHUB_ENV
40
+
41
+ - name: Install Foundry
42
+ uses: foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e #v1.5.0
43
+ with:
44
+ version: ${{ env.FOUNDRY_VERSION }}
45
+
46
+ - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0
47
+ name: Install pnpm
48
+ with:
49
+ version: 8
50
+ run_install: false
51
+
52
+ - name: Get pnpm store directory
53
+ shell: bash
54
+ run: |
55
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
56
+
57
+ - uses: actions/cache@v4
58
+ name: Setup pnpm cache
59
+ with:
60
+ path: ${{ env.STORE_PATH }}
61
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
62
+ restore-keys: |
63
+ ${{ runner.os }}-pnpm-store-
64
+
65
+ - name: Install dependencies
66
+ run: pnpm install
67
+
68
+ - name: Setup Pages
69
+ id: pages
70
+ uses: actions/configure-pages@v5
71
+
72
+ - name: Build with forge
73
+ run: forge doc --build
74
+
75
+ - name: Upload artifact
76
+ uses: actions/upload-pages-artifact@v3
77
+ with:
78
+ path: docs/book
79
+
80
+ # Deployment job
81
+ deploy:
82
+ environment:
83
+ name: github-pages
84
+ url: ${{ steps.deployment.outputs.page_url }}
85
+ runs-on: ubuntu-latest
86
+ needs: build
87
+ steps:
88
+ - name: Deploy to GitHub Pages
89
+ id: deployment
90
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,59 @@
1
+ on:
2
+ - push
3
+ - pull_request
4
+
5
+ env:
6
+ FOUNDRY_PROFILE: ci
7
+
8
+ jobs:
9
+ test-scripts:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Install Node.js
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 20
19
+
20
+ - name: Read foundry version from .foundry-version
21
+ shell: bash
22
+ run: |
23
+ echo "FOUNDRY_VERSION=$(cat .foundry-version)" >> $GITHUB_ENV
24
+
25
+ - name: Install Foundry
26
+ uses: foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e #v1.5.0
27
+ with:
28
+ version: ${{ env.FOUNDRY_VERSION }}
29
+
30
+ - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d #v3.0.0
31
+ name: Install pnpm
32
+ with:
33
+ version: 8
34
+ run_install: false
35
+
36
+ - name: Get pnpm store directory
37
+ shell: bash
38
+ run: |
39
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40
+
41
+ - uses: actions/cache@v4
42
+ name: Setup pnpm cache
43
+ with:
44
+ path: ${{ env.STORE_PATH }}
45
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46
+ restore-keys: |
47
+ ${{ runner.os }}-pnpm-store-
48
+
49
+ - name: Install dependencies
50
+ run: pnpm install
51
+
52
+ - name: Run lint check
53
+ run: pnpm run fmt:check && pnpm run lint
54
+
55
+ - name: Run build
56
+ run: pnpm build
57
+
58
+ - name: Run test
59
+ run: pnpm test
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "solhint:recommended",
3
+ "rules": {
4
+ "code-complexity": ["error", 8],
5
+ "contract-name-capwords": "off",
6
+ "compiler-version": ["error", ">=0.8.20"],
7
+ "func-name-mixedcase": "off",
8
+ "func-visibility": ["error", { "ignoreConstructors": true }],
9
+ "max-line-length": ["error", 121],
10
+ "reason-string": ["warn", { "maxLength": 40 }],
11
+ "gas-custom-errors": "off",
12
+ "named-parameters-mapping": "warn",
13
+ "no-console": "off",
14
+ "not-rely-on-time": "off",
15
+ "one-contract-per-file": "off",
16
+ "var-name-mixedcase": "off"
17
+ }
18
+ }
package/.solhint.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "solhint:recommended",
3
+ "rules": {
4
+ "code-complexity": ["error", 8],
5
+ "compiler-version": ["error", ">=0.8.20"],
6
+ "func-name-mixedcase": "off",
7
+ "func-visibility": ["error", { "ignoreConstructors": true }],
8
+ "max-line-length": ["error", 121],
9
+ "reason-string": ["warn", { "maxLength": 52 }],
10
+ "gas-custom-errors": "off",
11
+ "named-parameters-mapping": "warn",
12
+ "not-rely-on-time": "off",
13
+ "one-contract-per-file": "off",
14
+ "var-name-mixedcase": "off"
15
+ }
16
+ }
package/.solhintignore ADDED
@@ -0,0 +1,3 @@
1
+ **/*.t.sol
2
+ packages/vendor/
3
+ node_modules/
@@ -0,0 +1,2 @@
1
+ packages/vendor/
2
+ node_modules/
package/Glossary.md ADDED
@@ -0,0 +1,141 @@
1
+ # Glossary
2
+
3
+ - [AML (Anti-Money Laundering)](#aml-anti-money-laundering)
4
+ - [CCID (Cross-Chain Identifier)](#ccid-cross-chain-identifier)
5
+ - [Composability](#composability)
6
+ - [Context Parameters](#context-parameters)
7
+ - [Credential](#credential)
8
+ - [Credential Registry](#credential-registry)
9
+ - [ERC-20](#erc-20)
10
+ - [ERC-165](#erc-165)
11
+ - [Extractors and Mappers](#extractors-and-mappers)
12
+ - [KYC (Know Your Customer)](#kyc-know-your-customer)
13
+ - [Offchain Proofs](#offchain-proofs)
14
+ - [PII (Personally Identifiable Information)](#pii-personally-identifiable-information)
15
+ - [Policy](#policy)
16
+ - [Policy Engine](#policy-engine)
17
+ - [Policy Management](#policy-management)
18
+ - [Proof-of-Reserves (PoR)](#proof-of-reserves-por)
19
+ - [Quota Policy](#quota-policy)
20
+ - [Real-World Assets (RWA)](#real-world-assets-rwa)
21
+ - [Trusted Verifier](#trusted-verifier)
22
+ - [Validators](#validators)
23
+ - [Identity Validator](#identity-validator)
24
+ - [Credential Registry Validator](#credential-registry-validator)
25
+ - [Credential Data Validator](#credential-data-validator)
26
+
27
+ ---
28
+
29
+ ### **AML (Anti-Money Laundering)**
30
+
31
+ A set of laws, regulations, and procedures designed to prevent criminals from disguising illegally obtained funds as
32
+ legitimate income.
33
+
34
+ ### **CCID (Cross-Chain Identifier)**
35
+
36
+ A 32-byte identifier used in the [**Cross-Chain Identity**](/packages/cross-chain-identity) standard to uniquely
37
+ represent an entity across multiple blockchains. It maps local blockchain addresses to a unified identity, facilitating
38
+ credential management and cross-chain interoperability.
39
+
40
+ ### **Composability**
41
+
42
+ The ability to integrate and combine modular components or standards in a flexible manner. For example, the [**Policy
43
+ Management**](/packages/policy-management) standard enables dynamic rule enforcement by chaining multiple policies.
44
+
45
+ ### **Context Parameters**
46
+
47
+ Additional data passed as a `bytes` array to certain functions for compliance or authorization purposes. E.g.:
48
+ cryptographic proofs, regulatory authorizations, or external references.
49
+
50
+ ### **Credential**
51
+
52
+ A verifiable attribute (e.g., KYC, AML compliance, Accredited Investor status) linked to a **CCID** in the [**Cross-Chain Identity**](/packages/cross-chain-identity) standard. Credentials are stored in registries and can be
53
+ validated by external entities without revealing sensitive information.
54
+
55
+ ### **Credential Registry**
56
+
57
+ A component of the [**Cross-Chain Identity**](/packages/cross-chain-identity) standard that manages the lifecycle of
58
+ credentials linked to CCIDs. It supports registration, validation, removal, and renewal of credentials.
59
+
60
+ ### **ERC-20**
61
+
62
+ [ERC20](https://eips.ethereum.org/EIPS/eip-20) is a widely used Ethereum token standard defining rules for fungible
63
+ tokens.
64
+
65
+ ### **ERC-165**
66
+
67
+ [ERC165](https://eips.ethereum.org/EIPS/eip-165) is an Ethereum standard that enables contracts to declare the
68
+ interfaces they implement, facilitating interface detection.
69
+
70
+ ### **Extractors and Mappers**
71
+
72
+ Components in the [**Policy Management**](/packages/policy-management) standard that process raw transaction data into
73
+ structured formats for policy consumption. Extractors parse inputs, while mappers transform them into policy-specific
74
+ formats.
75
+
76
+ ### **KYC (Know Your Customer)**
77
+
78
+ [KYC](https://www.swift.com/your-needs/financial-crime-cyber-security/know-your-customer-kyc/meaning-kyc) is a
79
+ compliance process requiring financial institutions to verify the identity of their clients and the nature of their
80
+ activities.
81
+
82
+ ### **Offchain Proofs**
83
+
84
+ Verification mechanisms (e.g., zk-proofs) performed outside the blockchain to ensure compliance or authenticity without
85
+ revealing sensitive information.
86
+
87
+ ### **PII (Personally Identifiable Information)**
88
+
89
+ [PII](https://www.dol.gov/general/ppii) is information that can identify an individual, such as a name, address, or
90
+ national ID number. The [**Cross-Chain Identity**](/packages/cross-chain-identity) standard avoids storing PII onchain,
91
+ using hashed references instead.
92
+
93
+ ### **Policy**
94
+
95
+ A self-contained module in the [**Policy Management**](/packages/policy-management) standard that enforces specific
96
+ rules, such as access control or compliance quotas.
97
+
98
+ ### **Policy Engine**
99
+
100
+ A central component of the [**Policy Management**](/packages/policy-management) standard that manages the execution of
101
+ multiple policies for a method selector. It coordinates the evaluation of policies in sequence and enforces dynamic
102
+ outcomes.
103
+
104
+ ### **Policy Management**
105
+
106
+ A [standard](/packages/policy-management) defining a modular policy engine for enforcing compliance, business rules, and
107
+ access control in smart contracts. It supports dynamic policy updates without redeploying the core contract.
108
+
109
+ ### **Proof-of-Reserves (PoR)**
110
+
111
+ [Proof-of-Reserves](https://chain.link/education-hub/proof-of-reserves) is a mechanism for verifying that a custodian
112
+ holds sufficient reserves to back assets it has issued.
113
+
114
+ ### **Quota Policy**
115
+
116
+ A policy module in the [**Policy Management**](/packages/policy-management) standard that restricts the use of a method
117
+ to a predefined limit. It enforces compliance by rejecting transactions that exceed the allowed quota.
118
+
119
+ ### **Real-World Assets (RWA)**
120
+
121
+ [Real-World Assets](https://chain.link/education-hub/real-world-assets-rwas-explained) are physical or traditional
122
+ financial assets tokenized on blockchain platforms, such as real estate or securities. The **Permissioned Token**
123
+ standard supports regulatory compliance for tokenized RWAs.
124
+
125
+ ### **Trusted Verifier**
126
+
127
+ A trusted verifier within the [**Cross-Chain Identity**](/packages/cross-chain-identity) standard is an offchain entity
128
+ authorized to conduct external checks (e.g., KYC, AML) and to register the resulting credentials onchain. This approach
129
+ ensures privacy by storing only PII-redacted data onchain.
130
+
131
+ ### **Validators**
132
+
133
+ Smart contracts in the [**Cross-Chain Identity**](/packages/cross-chain-identity) standard that verifies whether a given
134
+ identity or credential meets certain criteria:
135
+
136
+ - **Identity Validator**: Confirms an account has a valid CCID mapping and contains all the required credentials,
137
+ utilizing one or more sets of registries.
138
+ - **Credential Registry Validator**: Inspects a single registry to confirm whether a credential is present, valid, or
139
+ unexpired for a given CCID.
140
+ - **Credential Data Validator**: Examines the data attached to a credential for correctness, integrity, or adherence to
141
+ specific formats.
package/LICENSE ADDED
@@ -0,0 +1,59 @@
1
+ Business Source License 1.1
2
+
3
+ Copyright (c) 2025 Chainlink Labs Inc. and affiliates.
4
+
5
+ Business Source License 1.1
6
+
7
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
8
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
9
+
10
+ ---
11
+
12
+ Parameters
13
+
14
+ Licensor: Chainlink Labs Inc. and affiliates.
15
+
16
+ Licensed Work: chainlink-ace
17
+ The Licensed Work is (c) 2025 SmartContract Chainlink Limited SEZC
18
+
19
+ Additional Use Grant: Any uses listed and defined in this repository
20
+
21
+ Change Date: October 6, 2029
22
+
23
+ Change License: MIT
24
+
25
+ ---
26
+
27
+ Terms
28
+
29
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
30
+
31
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
32
+
33
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
34
+
35
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
36
+
37
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
38
+
39
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
40
+
41
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
42
+
43
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
44
+
45
+ MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark "Business Source License", as long as you comply with the Covenants of Licensor below.
46
+
47
+ ---
48
+
49
+ Covenants of Licensor
50
+
51
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
52
+
53
+ 1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
54
+
55
+ 2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None".
56
+
57
+ 3. To specify a Change Date.
58
+
59
+ 4. Not to modify this License in any other way.