@0xmonaco/contracts
Smart contract ABIs and addresses for the Monaco protocol. This package provides the interface definitions and deployed addresses for all Monaco protocol contracts.
Note: This package currently only contains the Vault contract. Additional contracts will be added as they are deployed.
Installation
npm install @0xmonaco/contracts
Usage
Contract Addresses and ABIs
Access contract addresses and ABIs for different networks:
import { CONTRACT_ADDRESSES, CONTRACT_ABIS } from "@0xmonaco/contracts";
const atlanticAddresses = CONTRACT_ADDRESSES[1328];
const { vault: vaultAddress } = atlanticAddresses;
import { createPublicClient, http } from "viem";
const client = createPublicClient({
chain: {
id: 1328,
name: "atlantic-2",
rpcUrls: {
default: { http: ["https://evm-rpc.testnet.sei.io"] },
public: { http: ["https://evm-rpc.testnet.sei.io"] },
},
},
transport: http(),
});
const vaultContract = {
address: vaultAddress,
abi: CONTRACT_ABIS.vault,
client,
};
Contract Overview
Core Protocol Contracts
Vault
- Manages user balances and deposits
- Handles token transfers for trades
- Ensures secure fund management
Note: Additional contracts (CLOB, Order Book, State, Symphony Adapter) will be documented as they are deployed and integrated.
Network Support
The package currently supports the following networks:
-
Atlantic-2 (Testnet)
- Chain ID: 1328
- Used for testing and development
-
Pacific-1 (Mainnet)
- Chain ID: 1329
- Production environment (Coming Soon)
Contract Addresses
Each network has the following contracts deployed:
interface ContractAddresses {
vault: string;
}
Token Configuration
The package provides token configurations for different networks:
import { TESTNET_TOKENS } from "@0xmonaco/contracts";
const mockUSDC = TESTNET_TOKENS.MockUSDC;
const mockMTK = TESTNET_TOKENS.MockMTK;
console.log(`MockUSDC address: ${mockUSDC.address}`);
console.log(`MockUSDC decimals: ${mockUSDC.decimals}`);
Available Tokens
Testnet (Atlantic-2)
- MockUSDC:
0x6A86dA986797D59A839D136dB490292Cd560C131
(6 decimals)
- MockMTK:
0x428F82f1ECa4AA6f6c75D77cBd2a9ceB94cde343
(18 decimals)
ABI Reference
The package exports a consolidated CONTRACT_ABIS
object:
import { CONTRACT_ABIS } from "@0xmonaco/contracts";
const clobAbi = CONTRACT_ABIS.clob;
const vaultAbi = CONTRACT_ABIS.vault;
Available ABIs in CONTRACT_ABIS
:
vault
: Vault contract interface
Development
Adding New Contracts
- Create a new file in
src/abis/
for the contract ABI
- Export the ABI as a named constant
- Add the export to
src/abis/index.ts
- Add the contract address to
CONTRACT_ADDRESSES
in src/index.ts
Updating Contract Addresses
When deploying new contracts:
- Update the addresses in
src/index.ts
- Update the network documentation if needed
- Consider adding a migration guide for users
Best Practices
- Keep ABIs up to date with deployed contracts
- Document any breaking changes
- Maintain backward compatibility when possible
- Test contract interactions on testnet before mainnet deployment