@vorionsys/basis 1.0.1
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.
- package/.env.example +22 -0
- package/AMOY-MIGRATION.md +188 -0
- package/DEPLOY-AMOY.md +368 -0
- package/DEPLOY-NOW.md +216 -0
- package/DEPLOYMENT.md +239 -0
- package/GET-WALLET.md +286 -0
- package/QUICK-WALLET-SETUP.md +268 -0
- package/README.md +195 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +236 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +204 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.json +328 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.json +113 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.json +97 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.json +114 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +444 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json +45 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol/ERC721Enumerable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol/ERC721Enumerable.json +521 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.json +476 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol/IERC721Enumerable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol/IERC721Enumerable.json +352 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.json +341 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol/ERC721Utils.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol/ERC721Utils.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Panic.sol/Panic.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Panic.sol/Panic.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +37 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +65 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +10 -0
- package/artifacts/build-info/357d1bba4062d461f497f221490811a3.json +1 -0
- package/artifacts/contracts/AgentCard.sol/AgentCard.dbg.json +4 -0
- package/artifacts/contracts/AgentCard.sol/AgentCard.json +1430 -0
- package/build_errors.txt +0 -0
- package/build_output.txt +0 -0
- package/cache/solidity-files-cache.json +885 -0
- package/contracts/AgentCard.sol +478 -0
- package/contracts/deploy/01-deploy-agentcard.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/kya/accountability.d.ts.map +1 -0
- package/dist/kya/accountability.js +100 -0
- package/dist/kya/authorization.d.ts.map +1 -0
- package/dist/kya/authorization.js +258 -0
- package/dist/kya/behavior.d.ts.map +1 -0
- package/dist/kya/behavior.js +142 -0
- package/dist/kya/identity.d.ts.map +1 -0
- package/dist/kya/identity.js +187 -0
- package/dist/kya/index.d.ts.map +1 -0
- package/dist/kya/index.js +99 -0
- package/dist/kya/types.d.ts.map +1 -0
- package/dist/kya/types.js +5 -0
- package/dist/trust-1000-agents.test.d.ts.map +1 -0
- package/dist/trust-1000-agents.test.js +608 -0
- package/dist/trust-capabilities.d.ts.map +1 -0
- package/dist/trust-capabilities.js +478 -0
- package/dist/trust-factors.d.ts.map +1 -0
- package/dist/trust-factors.js +588 -0
- package/dist/trust-factors.test.d.ts.map +1 -0
- package/dist/trust-factors.test.js +179 -0
- package/dist/validation-gate.d.ts.map +1 -0
- package/dist/validation-gate.js +468 -0
- package/dist/validation-gate.test.d.ts.map +1 -0
- package/dist/validation-gate.test.js +419 -0
- package/hardhat.config.ts +55 -0
- package/package.json +57 -0
- package/scripts/certify-agent.ts +91 -0
- package/scripts/deploy-agentcard.ts +63 -0
- package/scripts/mint-agentcard.ts +87 -0
- package/specs/adversarial-sandbox-test-suite.md +1055 -0
- package/specs/kya-framework.md +910 -0
- package/specs/trust-factors-v2.md +437 -0
- package/src/index.ts +14 -0
- package/src/kya/accountability.ts +132 -0
- package/src/kya/authorization.ts +325 -0
- package/src/kya/behavior.ts +169 -0
- package/src/kya/identity.ts +224 -0
- package/src/kya/index.ts +125 -0
- package/src/kya/types.ts +242 -0
- package/src/trust-1000-agents.test.ts +745 -0
- package/src/trust-capabilities.ts +517 -0
- package/src/trust-factors.test.ts +241 -0
- package/src/trust-factors.ts +666 -0
- package/src/validation-gate.test.ts +531 -0
- package/src/validation-gate.ts +665 -0
- package/test-kya-simple.ts +258 -0
- package/test-kya.ts +245 -0
- package/tsconfig.json +14 -0
- package/typechain-types/@openzeppelin/contracts/access/AccessControl.ts +324 -0
- package/typechain-types/@openzeppelin/contracts/access/IAccessControl.ts +292 -0
- package/typechain-types/@openzeppelin/contracts/access/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/index.ts +11 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/IERC4906.ts +462 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/index.ts +6 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/ERC721.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.ts +393 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721Receiver.ts +110 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.ts +470 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.ts +489 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.ts +443 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/index.ts +7 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/index.ts +8 -0
- package/typechain-types/@openzeppelin/contracts/token/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/utils/Strings.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/index.ts +8 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/ERC165.ts +94 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/IERC165.ts +94 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/@openzeppelin/index.ts +5 -0
- package/typechain-types/common.ts +131 -0
- package/typechain-types/contracts/AgentCard.ts +1415 -0
- package/typechain-types/contracts/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.ts +250 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +218 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC4906__factory.ts +339 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.ts +127 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.ts +111 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.ts +128 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/ERC721__factory.ts +455 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/IERC721Receiver__factory.ts +59 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.ts +307 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable__factory.ts +535 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage__factory.ts +490 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable__factory.ts +366 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata__factory.ts +355 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.ts +90 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.ts +41 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.ts +41 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.ts +118 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/index.ts +4 -0
- package/typechain-types/factories/contracts/AgentCard__factory.ts +1480 -0
- package/typechain-types/factories/contracts/index.ts +4 -0
- package/typechain-types/factories/index.ts +5 -0
- package/typechain-types/index.ts +44 -0
- package/vitest.config.ts +8 -0
package/.env.example
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Private key for deployment (DO NOT COMMIT ACTUAL .env FILE)
|
|
2
|
+
PRIVATE_KEY=your_private_key_here
|
|
3
|
+
|
|
4
|
+
# RPC URLs
|
|
5
|
+
# Amoy Testnet (Current - uses POL token)
|
|
6
|
+
AMOY_RPC_URL=https://rpc-amoy.polygon.technology
|
|
7
|
+
|
|
8
|
+
# Mumbai Testnet (DEPRECATED)
|
|
9
|
+
MUMBAI_RPC_URL=https://rpc-mumbai.maticvigil.com
|
|
10
|
+
|
|
11
|
+
# Polygon Mainnet
|
|
12
|
+
POLYGON_RPC_URL=https://polygon-rpc.com
|
|
13
|
+
|
|
14
|
+
# Certifier address (AgentAnchor certifier)
|
|
15
|
+
CERTIFIER_ADDRESS=0x...
|
|
16
|
+
|
|
17
|
+
# PolygonScan API key (for contract verification)
|
|
18
|
+
POLYGONSCAN_API_KEY=your_polygonscan_api_key
|
|
19
|
+
|
|
20
|
+
# Gas reporting
|
|
21
|
+
REPORT_GAS=false
|
|
22
|
+
COINMARKETCAP_API_KEY=your_coinmarketcap_api_key
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# ⚠️ Polygon Mumbai → Amoy Migration Guide
|
|
2
|
+
|
|
3
|
+
## What Changed?
|
|
4
|
+
|
|
5
|
+
Polygon deprecated Mumbai testnet in favor of Amoy testnet on **October 13, 2024**.
|
|
6
|
+
|
|
7
|
+
### Key Changes
|
|
8
|
+
|
|
9
|
+
| Property | Mumbai (Old) | Amoy (New) |
|
|
10
|
+
|----------|--------------|------------|
|
|
11
|
+
| **Status** | ❌ Deprecated | ✅ Active |
|
|
12
|
+
| **Chain ID** | 80001 | **80002** |
|
|
13
|
+
| **Native Token** | MATIC | **POL** |
|
|
14
|
+
| **RPC URL** | https://rpc-mumbai.maticvigil.com | **https://rpc-amoy.polygon.technology** |
|
|
15
|
+
| **Faucet** | (deprecated) | **https://faucet.polygon.technology** |
|
|
16
|
+
| **Block Explorer** | https://mumbai.polygonscan.com | **https://amoy.polygonscan.com** |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Quick Migration Steps
|
|
21
|
+
|
|
22
|
+
### 1. Update Hardhat Config ✅ (Already Done)
|
|
23
|
+
|
|
24
|
+
Your `hardhat.config.ts` now includes Amoy network:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
amoy: {
|
|
28
|
+
url: 'https://rpc-amoy.polygon.technology',
|
|
29
|
+
chainId: 80002,
|
|
30
|
+
// ... other config
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Update Environment Variables ✅ (Already Done)
|
|
35
|
+
|
|
36
|
+
Your `.env.example` now includes:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Amoy Testnet (Current)
|
|
40
|
+
AMOY_RPC_URL=https://rpc-amoy.polygon.technology
|
|
41
|
+
|
|
42
|
+
# Mumbai Testnet (DEPRECATED)
|
|
43
|
+
MUMBAI_RPC_URL=https://rpc-mumbai.maticvigil.com
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Copy `.env.example` to `.env` and add your private key.
|
|
47
|
+
|
|
48
|
+
### 3. Update Package Scripts ✅ (Already Done)
|
|
49
|
+
|
|
50
|
+
New scripts available:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm run deploy:amoy # Deploy to Amoy (recommended)
|
|
54
|
+
npm run verify:amoy # Verify on Amoy
|
|
55
|
+
npm run deploy:mumbai # Deploy to Mumbai (deprecated)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 4. Get POL Tokens from Faucet
|
|
59
|
+
|
|
60
|
+
**New Faucet URL**: https://faucet.polygon.technology/
|
|
61
|
+
|
|
62
|
+
1. Select **"Amoy"** network
|
|
63
|
+
2. Paste your wallet address
|
|
64
|
+
3. Get POL tokens (not MATIC!)
|
|
65
|
+
|
|
66
|
+
### 5. Update MetaMask Network
|
|
67
|
+
|
|
68
|
+
Add Amoy to MetaMask:
|
|
69
|
+
|
|
70
|
+
- **Network Name**: Polygon Amoy Testnet
|
|
71
|
+
- **RPC URL**: https://rpc-amoy.polygon.technology
|
|
72
|
+
- **Chain ID**: 80002
|
|
73
|
+
- **Currency Symbol**: POL
|
|
74
|
+
- **Block Explorer**: https://amoy.polygonscan.com
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Updated Commands
|
|
79
|
+
|
|
80
|
+
### Deploy to Amoy (Recommended)
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Deploy contract
|
|
84
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
85
|
+
|
|
86
|
+
# Mint AgentCard
|
|
87
|
+
npx hardhat run scripts/mint-agentcard.ts --network amoy
|
|
88
|
+
|
|
89
|
+
# Certify agent
|
|
90
|
+
npx hardhat run scripts/certify-agent.ts --network amoy
|
|
91
|
+
|
|
92
|
+
# Verify contract
|
|
93
|
+
npx hardhat verify --network amoy <CONTRACT_ADDRESS>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Deploy to Mumbai (Deprecated, but still works for now)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# If you MUST use Mumbai
|
|
100
|
+
npx hardhat run scripts/deploy-agentcard.ts --network mumbai
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Warning**: Mumbai will be discontinued. Migrate to Amoy ASAP.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Why the Change?
|
|
108
|
+
|
|
109
|
+
1. **POL Migration**: Polygon transitioned from MATIC to POL token
|
|
110
|
+
2. **Infrastructure Upgrade**: New infrastructure for better performance
|
|
111
|
+
3. **Future-Proofing**: Align testnet with mainnet upgrades
|
|
112
|
+
4. **Mumbai Sunset**: Mumbai will be fully deprecated soon
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Contract Compatibility
|
|
117
|
+
|
|
118
|
+
✅ **Good News**: Your smart contracts work on both networks!
|
|
119
|
+
|
|
120
|
+
- Same Solidity version (0.8.20)
|
|
121
|
+
- Same opcodes and features
|
|
122
|
+
- Same OpenZeppelin libraries
|
|
123
|
+
- No code changes needed
|
|
124
|
+
|
|
125
|
+
The only differences are:
|
|
126
|
+
- Network configuration (RPC, chain ID)
|
|
127
|
+
- Native token name (MATIC → POL)
|
|
128
|
+
- Block explorer URLs
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Recommended Action
|
|
133
|
+
|
|
134
|
+
**For New Deployments**: Use Amoy
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
cd C:\Axiom\packages\basis
|
|
138
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**For Existing Mumbai Deployments**:
|
|
142
|
+
|
|
143
|
+
1. Test on Amoy
|
|
144
|
+
2. Plan migration timeline
|
|
145
|
+
3. Update documentation
|
|
146
|
+
4. Migrate when ready
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Updated Documentation
|
|
151
|
+
|
|
152
|
+
All documentation has been updated:
|
|
153
|
+
|
|
154
|
+
- ✅ `hardhat.config.ts` - Amoy network added
|
|
155
|
+
- ✅ `.env.example` - Amoy RPC URLs
|
|
156
|
+
- ✅ `package.json` - Amoy deploy scripts
|
|
157
|
+
- ✅ `DEPLOY-AMOY.md` - Complete Amoy guide
|
|
158
|
+
- ✅ `deploy-agentcard.ts` - Amoy URLs
|
|
159
|
+
- ✅ `mint-agentcard.ts` - Amoy explorer links
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Resources
|
|
164
|
+
|
|
165
|
+
- **Polygon Amoy Docs**: https://docs.polygon.technology/tools/faucets/
|
|
166
|
+
- **Faucet**: https://faucet.polygon.technology/
|
|
167
|
+
- **Block Explorer**: https://amoy.polygonscan.com
|
|
168
|
+
- **RPC Status**: https://chainlist.org/chain/80002
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Need Help?
|
|
173
|
+
|
|
174
|
+
**Configuration files are ready** - just follow `DEPLOY-AMOY.md`!
|
|
175
|
+
|
|
176
|
+
Quick start:
|
|
177
|
+
```bash
|
|
178
|
+
cd C:\Axiom\packages\basis
|
|
179
|
+
# 1. Get POL from faucet
|
|
180
|
+
# 2. Add private key to .env
|
|
181
|
+
# 3. Deploy!
|
|
182
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
**Last Updated**: 2026-01-22
|
|
188
|
+
**Status**: ✅ Migration Complete - Ready for Amoy Deployment
|
package/DEPLOY-AMOY.md
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
# 🚀 AgentCard Deployment Guide - Polygon Amoy Testnet
|
|
2
|
+
|
|
3
|
+
## ⚠️ Important: Mumbai → Amoy Migration
|
|
4
|
+
|
|
5
|
+
**Mumbai testnet has been deprecated!** Use **Amoy testnet** instead.
|
|
6
|
+
|
|
7
|
+
**Key Changes**:
|
|
8
|
+
- Testnet: Mumbai (deprecated) → **Amoy** (current)
|
|
9
|
+
- Native Token: MATIC → **POL**
|
|
10
|
+
- Chain ID: 80001 → **80002**
|
|
11
|
+
- RPC URL: New Amoy endpoints
|
|
12
|
+
- Faucet: New Amoy faucet
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Prerequisites ✅
|
|
17
|
+
|
|
18
|
+
1. **Node.js** 22+ and npm ✅ (Already installed)
|
|
19
|
+
2. **Dependencies** ✅ (Already installed - 474 packages)
|
|
20
|
+
3. **Contract Compiled** ✅ (23 Solidity files)
|
|
21
|
+
4. **Polygon Amoy testnet** POL tokens (from faucet)
|
|
22
|
+
5. **Private key** with funds
|
|
23
|
+
6. **PolygonScan API key** (optional, for verification)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1: Get Testnet POL (5 minutes)
|
|
28
|
+
|
|
29
|
+
### Polygon Amoy Faucet
|
|
30
|
+
|
|
31
|
+
Visit: **https://faucet.polygon.technology/**
|
|
32
|
+
|
|
33
|
+
1. Select **"Amoy"** testnet (not Mumbai!)
|
|
34
|
+
2. Paste your wallet address
|
|
35
|
+
3. Click **"Submit"**
|
|
36
|
+
4. Wait 1-2 minutes for POL tokens
|
|
37
|
+
|
|
38
|
+
**Recommended**: Get 1-2 POL (enough for ~100 mints)
|
|
39
|
+
|
|
40
|
+
**Alternative Faucets**:
|
|
41
|
+
- https://www.alchemy.com/faucets/polygon-amoy
|
|
42
|
+
- https://www.allthatnode.com/faucet/polygon.dsrv
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 2: Configure Environment
|
|
47
|
+
|
|
48
|
+
Your `.env` file already exists. Update it:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cd C:\Axiom\packages\basis
|
|
52
|
+
|
|
53
|
+
# Edit .env file
|
|
54
|
+
code .env # or notepad .env
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Required configuration:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Your deployment wallet private key (must start with 0x)
|
|
61
|
+
# ⚠️ TESTNET ONLY - Never use mainnet keys!
|
|
62
|
+
PRIVATE_KEY=0x1234567890abcdef... # 66 characters total
|
|
63
|
+
|
|
64
|
+
# Amoy RPC (default works, or use custom)
|
|
65
|
+
AMOY_RPC_URL=https://rpc-amoy.polygon.technology
|
|
66
|
+
|
|
67
|
+
# Optional: For contract verification on PolygonScan
|
|
68
|
+
POLYGONSCAN_API_KEY=YOUR_API_KEY_HERE
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Get PolygonScan API Key** (free):
|
|
72
|
+
1. Visit https://polygonscan.com/apis
|
|
73
|
+
2. Sign up for free account
|
|
74
|
+
3. Create API key
|
|
75
|
+
4. Copy to .env
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Step 3: Deploy to Amoy Testnet (2 minutes)
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cd C:\Axiom\packages\basis
|
|
83
|
+
|
|
84
|
+
# Deploy AgentCard contract
|
|
85
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Expected Output**:
|
|
89
|
+
```
|
|
90
|
+
Deploying AgentCard with account: 0x...
|
|
91
|
+
Account balance: 1.5 POL
|
|
92
|
+
|
|
93
|
+
✅ AgentCard deployed to: 0x1234567890abcdef1234567890abcdef12345678
|
|
94
|
+
Granting CERTIFIER_ROLE to deployer...
|
|
95
|
+
✅ CERTIFIER_ROLE granted
|
|
96
|
+
|
|
97
|
+
📋 Deployment Summary:
|
|
98
|
+
=====================
|
|
99
|
+
Contract Address: 0x1234567890abcdef1234567890abcdef12345678
|
|
100
|
+
Deployer: 0x...
|
|
101
|
+
Network: amoy
|
|
102
|
+
Chain ID: 80002
|
|
103
|
+
|
|
104
|
+
🔗 View on PolygonScan:
|
|
105
|
+
https://amoy.polygonscan.com/address/0x1234567890abcdef1234567890abcdef12345678
|
|
106
|
+
|
|
107
|
+
📝 Next Steps:
|
|
108
|
+
1. Save contract address: 0x1234567890abcdef1234567890abcdef12345678
|
|
109
|
+
2. Verify contract: npx hardhat verify --network amoy 0x...
|
|
110
|
+
3. Mint AgentCard: npx hardhat run scripts/mint-agentcard.ts --network amoy
|
|
111
|
+
4. Certify agent: npx hardhat run scripts/certify-agent.ts --network amoy
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**📝 SAVE THE CONTRACT ADDRESS** - you'll need it!
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Step 4: Verify Contract on PolygonScan (2 minutes)
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx hardhat verify --network amoy <CONTRACT_ADDRESS>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**View on PolygonScan**:
|
|
125
|
+
```
|
|
126
|
+
https://amoy.polygonscan.com/address/<CONTRACT_ADDRESS>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Note**: Contract works without verification, but verification allows anyone to read the contract code directly on PolygonScan.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Step 5: Mint First AgentCard (CC Agent)
|
|
134
|
+
|
|
135
|
+
Update the contract address in the mint script:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Edit scripts/mint-agentcard.ts
|
|
139
|
+
code scripts/mint-agentcard.ts
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Find line ~15 and replace with your contract address:
|
|
143
|
+
```typescript
|
|
144
|
+
const agentCard = await AgentCard.attach(
|
|
145
|
+
'0xYOUR_CONTRACT_ADDRESS_FROM_STEP_3' // <-- Update this
|
|
146
|
+
);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Then mint:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npx hardhat run scripts/mint-agentcard.ts --network amoy
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Expected Output**:
|
|
156
|
+
```
|
|
157
|
+
Minting AgentCard with account: 0x...
|
|
158
|
+
Account balance: 1.48 POL
|
|
159
|
+
AgentCard contract: 0x...
|
|
160
|
+
|
|
161
|
+
Minting transaction submitted: 0xabc123...
|
|
162
|
+
|
|
163
|
+
✅ AgentCard minted successfully!
|
|
164
|
+
Token ID: 0
|
|
165
|
+
DID: did:vorion:google:cc-agent-v1
|
|
166
|
+
Owner: 0x...
|
|
167
|
+
Name: CC AI Agent (Google Labs)
|
|
168
|
+
|
|
169
|
+
📋 AgentCard Details:
|
|
170
|
+
-------------------
|
|
171
|
+
DID: did:vorion:google:cc-agent-v1
|
|
172
|
+
Name: CC AI Agent (Google Labs)
|
|
173
|
+
Description: Personal productivity agent for Google Workspace integration
|
|
174
|
+
Trust Score: 0
|
|
175
|
+
Tier: 0 (T0 - Sandbox)
|
|
176
|
+
Certified: false
|
|
177
|
+
Capabilities: [ 'gmail_read', 'gmail_send', 'calendar_read', 'calendar_write', 'drive_read', 'workspace_summarize' ]
|
|
178
|
+
|
|
179
|
+
🔗 View on PolygonScan:
|
|
180
|
+
https://amoy.polygonscan.com/token/0x.../0
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Step 6: Certify Agent with AgentAnchor
|
|
186
|
+
|
|
187
|
+
Update contract address in certify script:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
code scripts/certify-agent.ts
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Then certify:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
npx hardhat run scripts/certify-agent.ts --network amoy
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Expected Output**:
|
|
200
|
+
```
|
|
201
|
+
Certifying AgentCard #0...
|
|
202
|
+
Trust Score: 350 (T2: Standard)
|
|
203
|
+
Expiry: 2027-01-22
|
|
204
|
+
|
|
205
|
+
Transaction submitted: 0xdef456...
|
|
206
|
+
|
|
207
|
+
✅ Agent certified successfully!
|
|
208
|
+
DID: did:vorion:google:cc-agent-v1
|
|
209
|
+
Trust Score: 350
|
|
210
|
+
Tier: 2 (T2 - Standard)
|
|
211
|
+
Certified: true
|
|
212
|
+
Certifier: 0x...
|
|
213
|
+
Expires: 2027-01-22
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## You've Deployed! 🎉
|
|
219
|
+
|
|
220
|
+
### What You Now Have:
|
|
221
|
+
|
|
222
|
+
1. ✅ **AgentCard NFT Contract** deployed on Polygon Amoy
|
|
223
|
+
2. ✅ **First AgentCard** minted (Token ID: 0)
|
|
224
|
+
3. ✅ **CC Agent Certified** with T2 trust score (350)
|
|
225
|
+
4. ✅ **On-Chain Identity** for `did:vorion:google:cc-agent-v1`
|
|
226
|
+
|
|
227
|
+
### View Your Work:
|
|
228
|
+
|
|
229
|
+
**PolygonScan** (Amoy):
|
|
230
|
+
```
|
|
231
|
+
https://amoy.polygonscan.com/address/<YOUR_CONTRACT_ADDRESS>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Your NFT**:
|
|
235
|
+
```
|
|
236
|
+
https://amoy.polygonscan.com/token/<CONTRACT_ADDRESS>?a=0
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Network Information
|
|
242
|
+
|
|
243
|
+
### Polygon Amoy Testnet
|
|
244
|
+
|
|
245
|
+
| Property | Value |
|
|
246
|
+
|----------|-------|
|
|
247
|
+
| **Network Name** | Polygon Amoy Testnet |
|
|
248
|
+
| **Chain ID** | 80002 |
|
|
249
|
+
| **Currency** | POL (not MATIC!) |
|
|
250
|
+
| **RPC URL** | https://rpc-amoy.polygon.technology |
|
|
251
|
+
| **Block Explorer** | https://amoy.polygonscan.com |
|
|
252
|
+
| **Faucet** | https://faucet.polygon.technology |
|
|
253
|
+
|
|
254
|
+
### Add to MetaMask
|
|
255
|
+
|
|
256
|
+
1. Open MetaMask
|
|
257
|
+
2. Click network dropdown
|
|
258
|
+
3. Click "Add Network"
|
|
259
|
+
4. Enter details above
|
|
260
|
+
5. Save
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Common Issues & Solutions
|
|
265
|
+
|
|
266
|
+
### "Insufficient funds for gas"
|
|
267
|
+
- Get more testnet POL from faucet
|
|
268
|
+
- Check balance: Account balance shown in deployment output
|
|
269
|
+
|
|
270
|
+
### "Network error"
|
|
271
|
+
- Amoy testnet might be congested
|
|
272
|
+
- Try again in a few minutes
|
|
273
|
+
- Or use alternative RPC: https://polygon-amoy-bor-rpc.publicnode.com
|
|
274
|
+
|
|
275
|
+
### "Contract verification failed"
|
|
276
|
+
- Make sure PolygonScan API key is correct
|
|
277
|
+
- Try again after a few minutes
|
|
278
|
+
- Verification is optional - contract works without it
|
|
279
|
+
|
|
280
|
+
### "Invalid account" error
|
|
281
|
+
- Private key must start with `0x`
|
|
282
|
+
- Private key must be exactly 66 characters (0x + 64 hex chars)
|
|
283
|
+
- Make sure no extra spaces in .env file
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Next Steps
|
|
288
|
+
|
|
289
|
+
### Immediate
|
|
290
|
+
1. ✅ View your contract on PolygonScan
|
|
291
|
+
2. ✅ Share contract address with team
|
|
292
|
+
3. ✅ Test minting more AgentCards
|
|
293
|
+
|
|
294
|
+
### Integration
|
|
295
|
+
4. Update AgentAnchor portal with contract address
|
|
296
|
+
5. Integrate KYA SDK for verification
|
|
297
|
+
6. Connect CC Agent to use AgentCard
|
|
298
|
+
7. Implement multi-persona architecture
|
|
299
|
+
|
|
300
|
+
### Production
|
|
301
|
+
8. Test thoroughly on Amoy
|
|
302
|
+
9. Deploy to Polygon mainnet (when ready)
|
|
303
|
+
10. Launch bai-cc.com with Vorion integration
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Scripts Reference
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Compile contract
|
|
311
|
+
npx hardhat compile
|
|
312
|
+
|
|
313
|
+
# Deploy to Amoy (recommended)
|
|
314
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
315
|
+
|
|
316
|
+
# Deploy to Mumbai (deprecated)
|
|
317
|
+
npx hardhat run scripts/deploy-agentcard.ts --network mumbai
|
|
318
|
+
|
|
319
|
+
# Mint AgentCard
|
|
320
|
+
npx hardhat run scripts/mint-agentcard.ts --network amoy
|
|
321
|
+
|
|
322
|
+
# Certify agent
|
|
323
|
+
npx hardhat run scripts/certify-agent.ts --network amoy
|
|
324
|
+
|
|
325
|
+
# Verify contract
|
|
326
|
+
npx hardhat verify --network amoy <CONTRACT_ADDRESS>
|
|
327
|
+
|
|
328
|
+
# Check contract compilation
|
|
329
|
+
npx hardhat compile
|
|
330
|
+
|
|
331
|
+
# Clean build artifacts
|
|
332
|
+
npx hardhat clean
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Cost Estimates
|
|
338
|
+
|
|
339
|
+
**Polygon Amoy Testnet** (all free testnet POL):
|
|
340
|
+
- Deploy AgentCard: ~0.01 POL (~$0.00)
|
|
341
|
+
- Mint AgentCard: ~0.002 POL (~$0.00)
|
|
342
|
+
- Certify Agent: ~0.001 POL (~$0.00)
|
|
343
|
+
|
|
344
|
+
**Polygon Mainnet** (real POL):
|
|
345
|
+
- Deploy AgentCard: ~0.02 POL (~$0.016 USD)
|
|
346
|
+
- Mint AgentCard: ~0.005 POL (~$0.004 USD)
|
|
347
|
+
- Certify Agent: ~0.002 POL (~$0.0016 USD)
|
|
348
|
+
|
|
349
|
+
**Total for 1 agent (mainnet)**: ~$0.022 USD
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## You're Ready to Deploy! 🎯
|
|
354
|
+
|
|
355
|
+
**Estimated time**: 10-15 minutes total
|
|
356
|
+
**Estimated cost**: Free on Amoy testnet!
|
|
357
|
+
|
|
358
|
+
**Start here**:
|
|
359
|
+
```bash
|
|
360
|
+
cd C:\Axiom\packages\basis
|
|
361
|
+
npx hardhat run scripts/deploy-agentcard.ts --network amoy
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
**Happy deploying on Amoy!** 🚀
|
|
367
|
+
|
|
368
|
+
*Note: If you need to deploy to Mumbai for compatibility with existing infrastructure, replace `--network amoy` with `--network mumbai` in all commands. However, Mumbai will be discontinued, so migrate to Amoy as soon as possible.*
|