将此 ABI 作为可直接复制的 JavaScript/TypeScript 常量,用于 Viem、Ethers、机器人、仪表盘和自定义集成。Documentation Index
Fetch the complete documentation index at: https://docs.lfg.rich/llms.txt
Use this file to discover all available pages before exploring further.
这是连接已部署 Factory 合约的运行时 ABI。针对已经部署的合约创建
ethers.Contract、viem 调用或 Web3.py 合约对象时,不需要 constructor 条目。export const FACTORY_ABI = [
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "poolManager",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "hook",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "creationFee",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "POOL_FEE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint24"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "TICK_SPACING",
"inputs": [],
"outputs": [
{
"name": "",
"type": "int24"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "INIT_SQRT_PRICE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint160"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "allTokens",
"inputs": [
{
"name": "index",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "tokenToCreator",
"inputs": [
{
"name": "token",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "tokenInfoMap",
"inputs": [
{
"name": "token",
"type": "address"
}
],
"outputs": [
{
"name": "tokenAddress",
"type": "address"
},
{
"name": "tokenId",
"type": "uint256"
},
{
"name": "creator",
"type": "address"
},
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "poolId",
"type": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "createToken",
"inputs": [
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "totalFeeBps",
"type": "uint256"
}
],
"outputs": [
{
"name": "token",
"type": "address"
},
{
"name": "poolId",
"type": "bytes32"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "setCreationFee",
"inputs": [
{
"name": "newFee",
"type": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "transferOwnership",
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawAll",
"inputs": [
{
"name": "to",
"type": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "totalTokens",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "isOfficialToken",
"inputs": [
{
"name": "token",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getTokenInfo",
"inputs": [
{
"name": "token",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "tokenAddress",
"type": "address"
},
{
"name": "tokenId",
"type": "uint256"
},
{
"name": "creator",
"type": "address"
},
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "poolId",
"type": "bytes32"
}
]
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getUserTokens",
"inputs": [
{
"name": "user",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "address[]"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getPoolKey",
"inputs": [
{
"name": "token",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "tuple",
"components": [
{
"name": "currency0",
"type": "address"
},
{
"name": "currency1",
"type": "address"
},
{
"name": "fee",
"type": "uint24"
},
{
"name": "tickSpacing",
"type": "int24"
},
{
"name": "hooks",
"type": "address"
}
]
}
],
"stateMutability": "view"
},
{
"type": "event",
"name": "TokenCreated",
"inputs": [
{
"name": "token",
"type": "address",
"indexed": true
},
{
"name": "tokenId",
"type": "uint256",
"indexed": true
},
{
"name": "creator",
"type": "address",
"indexed": true
},
{
"name": "name",
"type": "string",
"indexed": false
},
{
"name": "symbol",
"type": "string",
"indexed": false
},
{
"name": "poolId",
"type": "bytes32",
"indexed": false
}
]
},
{
"type": "event",
"name": "CreationFeeUpdated",
"inputs": [
{
"name": "oldFee",
"type": "uint256",
"indexed": false
},
{
"name": "newFee",
"type": "uint256",
"indexed": false
}
]
},
{
"type": "event",
"name": "Withdrawn",
"inputs": [
{
"name": "to",
"type": "address",
"indexed": true
},
{
"name": "amount",
"type": "uint256",
"indexed": false
}
]
},
{
"type": "error",
"name": "NotOwner",
"inputs": []
},
{
"type": "error",
"name": "ZeroAddress",
"inputs": []
},
{
"type": "error",
"name": "EmptyName",
"inputs": []
},
{
"type": "error",
"name": "EmptySymbol",
"inputs": []
},
{
"type": "error",
"name": "InvalidFee",
"inputs": []
},
{
"type": "error",
"name": "InsufficientPayment",
"inputs": []
},
{
"type": "error",
"name": "WithdrawFailed",
"inputs": []
},
{
"type": "receive",
"stateMutability": "payable"
}
] as const;

