@0xmonaco/contracts 0.0.0-develop-20260120180031

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/README.md ADDED
@@ -0,0 +1,151 @@
1
+ # @0xmonaco/contracts
2
+
3
+ Smart contract ABIs and addresses for the Monaco protocol. This package provides the interface definitions and deployed addresses for all Monaco protocol contracts.
4
+
5
+ **Note:** This package currently only contains the Vault contract. Additional contracts will be added as they are deployed.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @0xmonaco/contracts
11
+ ```
12
+
13
+ **Note:** This package is typically installed as a dependency of `@0xmonaco/core` or `@0xmonaco/types`, but you can install it directly if you only need contract ABIs and addresses.
14
+
15
+ ## Usage
16
+
17
+ ### Contract Addresses and ABIs
18
+
19
+ Access contract addresses and ABIs for different networks:
20
+
21
+ ```typescript
22
+ import { CONTRACT_ADDRESSES, CONTRACT_ABIS } from "@0xmonaco/contracts";
23
+
24
+ // Get contract addresses for Atlantic-2 testnet (chain ID 1328)
25
+ const atlanticAddresses = CONTRACT_ADDRESSES[1328];
26
+ const { vault: vaultAddress } = atlanticAddresses;
27
+
28
+ // Get contract addresses for Pacific-1 mainnet (chain ID 1329) - Coming Soon
29
+ // const pacificAddresses = CONTRACT_ADDRESSES[1329];
30
+
31
+ // Create contract instances using viem
32
+ import { createPublicClient, http } from "viem";
33
+
34
+ const client = createPublicClient({
35
+ chain: {
36
+ id: 1328, // Atlantic-2 testnet
37
+ name: "atlantic-2",
38
+ rpcUrls: {
39
+ default: { http: ["https://evm-rpc.testnet.sei.io"] },
40
+ public: { http: ["https://evm-rpc.testnet.sei.io"] },
41
+ },
42
+ },
43
+ transport: http(),
44
+ });
45
+
46
+ // Example of creating a contract instance
47
+ const vaultContract = {
48
+ address: vaultAddress,
49
+ abi: CONTRACT_ABIS.vault,
50
+ client,
51
+ };
52
+ ```
53
+
54
+ ## Contract Overview
55
+
56
+ ### Core Protocol Contracts
57
+
58
+ #### Vault
59
+
60
+ - Manages user balances and deposits
61
+ - Handles token transfers for trades
62
+ - Ensures secure fund management
63
+
64
+ **Note:** Additional contracts (CLOB, Order Book, State, Symphony Adapter) will be documented as they are deployed and integrated.
65
+
66
+ ## Network Support
67
+
68
+ The package currently supports the following networks:
69
+
70
+ - **Atlantic-2 (Testnet)**
71
+
72
+ - Chain ID: 1328
73
+ - Used for testing and development
74
+
75
+ - **Pacific-1 (Mainnet)**
76
+ - Chain ID: 1329
77
+ - Production environment (Coming Soon)
78
+
79
+ ## Contract Addresses
80
+
81
+ Each network has the following contracts deployed:
82
+
83
+ ```typescript
84
+ interface ContractAddresses {
85
+ /** Vault contract for managing user balances */
86
+ vault: string;
87
+ }
88
+ ```
89
+
90
+ ## Token Configuration
91
+
92
+ The package provides token configurations for different networks:
93
+
94
+ ```typescript
95
+ import { TESTNET_TOKENS } from "@0xmonaco/contracts";
96
+
97
+ // Access testnet tokens
98
+ const mockUSDC = TESTNET_TOKENS.MockUSDC;
99
+ const mockMTK = TESTNET_TOKENS.MockMTK;
100
+
101
+ // Use token information
102
+ console.log(`MockUSDC address: ${mockUSDC.address}`);
103
+ console.log(`MockUSDC decimals: ${mockUSDC.decimals}`);
104
+ ```
105
+
106
+ ### Available Tokens
107
+
108
+ #### Testnet (Atlantic-2)
109
+ - **MockUSDC**: `0x6A86dA986797D59A839D136dB490292Cd560C131` (6 decimals)
110
+ - **MockMTK**: `0x428F82f1ECa4AA6f6c75D77cBd2a9ceB94cde343` (18 decimals)
111
+
112
+
113
+
114
+ ## ABI Reference
115
+
116
+ The package exports a consolidated `CONTRACT_ABIS` object:
117
+
118
+ ```typescript
119
+ import { CONTRACT_ABIS } from "@0xmonaco/contracts";
120
+
121
+ const clobAbi = CONTRACT_ABIS.clob;
122
+ const vaultAbi = CONTRACT_ABIS.vault;
123
+ ```
124
+
125
+ Available ABIs in `CONTRACT_ABIS`:
126
+
127
+ - `vault`: Vault contract interface
128
+
129
+ ## Development
130
+
131
+ ### Adding New Contracts
132
+
133
+ 1. Create a new file in `src/abis/` for the contract ABI
134
+ 2. Export the ABI as a named constant
135
+ 3. Add the export to `src/abis/index.ts`
136
+ 4. Add the contract address to `CONTRACT_ADDRESSES` in `src/index.ts`
137
+
138
+ ### Updating Contract Addresses
139
+
140
+ When deploying new contracts:
141
+
142
+ 1. Update the addresses in `src/index.ts`
143
+ 2. Update the network documentation if needed
144
+ 3. Consider adding a migration guide for users
145
+
146
+ ### Best Practices
147
+
148
+ - Keep ABIs up to date with deployed contracts
149
+ - Document any breaking changes
150
+ - Maintain backward compatibility when possible
151
+ - Test contract interactions on testnet before mainnet deployment
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract ABIs
3
+ *
4
+ * This module exports all contract ABIs for the Monaco protocol.
5
+ * Each ABI provides type-safe contract interaction capabilities.
6
+ */
7
+ export { VAULT_ABI } from "./vault";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abis/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Contract ABIs
3
+ *
4
+ * This module exports all contract ABIs for the Monaco protocol.
5
+ * Each ABI provides type-safe contract interaction capabilities.
6
+ */
7
+ export { VAULT_ABI } from "./vault"; // Vault for managing user balances
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abis/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC,CAAC,mCAAmC"}