Skip to content

Commit a4cbc75

Browse files
committed
feat: add PumpClaw action provider
Add comprehensive PumpClaw action provider for Base mainnet with the following actions: - create_token: Create new tokens with Uniswap V4 liquidity (FREE, 0 ETH) - get_token_info: Get detailed token information from factory registry - list_tokens: List all tokens created on PumpClaw - buy_token: Buy tokens with ETH via SwapRouter - sell_token: Sell tokens for ETH via SwapRouter (with automatic approval) - set_image_url: Update token image (creator only) Key features: - FREE deployment (0 ETH cost) - 80% creator fees on all trades - LP locked forever (cannot rug) - Built on Uniswap V4 Factory: 0xe5bCa0eDe9208f7Ee7FCAFa0415Ca3DC03e16a90 SwapRouter: 0x3A9c65f4510de85F1843145d637ae895a2Fe04BE Includes: - Comprehensive test coverage with Jest mocks - Proper Zod schemas with validation - Error handling for all edge cases - Network support: Base mainnet only
1 parent e44e0e4 commit a4cbc75

File tree

7 files changed

+1219
-0
lines changed

7 files changed

+1219
-0
lines changed

typescript/agentkit/src/action-providers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export * from "./farcaster";
1919
export * from "./jupiter";
2020
export * from "./messari";
2121
export * from "./pyth";
22+
export * from "./pumpclaw";
2223
export * from "./moonwell";
2324
export * from "./morpho";
2425
export * from "./opensea";
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# PumpClaw Action Provider
2+
3+
This directory contains the **PumpclawActionProvider** implementation, which provides actions to interact with the **PumpClaw protocol** on Base mainnet.
4+
5+
## Directory Structure
6+
7+
```
8+
pumpclaw/
9+
├── pumpclawActionProvider.ts # Main provider with PumpClaw functionality
10+
├── pumpclawActionProvider.test.ts # Test file for PumpClaw provider
11+
├── constants.ts # PumpClaw contract constants and ABIs
12+
├── schemas.ts # PumpClaw action schemas
13+
├── index.ts # Main exports
14+
└── README.md # This file
15+
```
16+
17+
## Actions
18+
19+
- `create_token`: Create a new token via PumpClaw factory with Uniswap V4 liquidity
20+
- `get_token_info`: Get detailed information about a PumpClaw token
21+
- `list_tokens`: List all tokens created on PumpClaw
22+
- `buy_token`: Buy tokens with ETH via SwapRouter
23+
- `sell_token`: Sell tokens for ETH via SwapRouter
24+
- `set_image_url`: Update token image (creator only)
25+
26+
## Adding New Actions
27+
28+
To add new PumpClaw actions:
29+
30+
1. Define your action schema in `schemas.ts`
31+
2. Implement the action in `pumpclawActionProvider.ts`
32+
3. Add tests in `pumpclawActionProvider.test.ts`
33+
34+
## Network Support
35+
36+
The PumpClaw provider supports Base mainnet only.
37+
38+
## PumpClaw Advantages
39+
40+
- **FREE deployment**: 0 ETH cost to create tokens
41+
- **80% creator fees**: Creators earn 80% of all trading fees
42+
- **LP locked forever**: Liquidity cannot be rugged
43+
- **Uniswap V4**: Built on the latest Uniswap infrastructure
44+
45+
## Contract Addresses
46+
47+
- **Factory**: `0xe5bCa0eDe9208f7Ee7FCAFa0415Ca3DC03e16a90` (Base mainnet)
48+
- **SwapRouter**: `0x3A9c65f4510de85F1843145d637ae895a2Fe04BE` (Base mainnet)
49+
50+
## Notes
51+
52+
PumpClaw is a free token launcher that uses Uniswap V4 to provide deep liquidity and fair token launches. The protocol is designed to prevent rug pulls by locking liquidity forever and rewarding creators with a significant share of trading fees.
53+
54+
For more information on the **PumpClaw protocol**, visit [PumpClaw](https://pumpclaw.fun).
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
import type { Abi } from "abitype";
2+
3+
export const SUPPORTED_NETWORKS = ["base-mainnet"];
4+
5+
/**
6+
* PumpClaw Factory contract ABI - minimal functions needed for PumpClaw interactions.
7+
*/
8+
export const PUMPCLAW_FACTORY_ABI: Abi = [
9+
{
10+
type: "function",
11+
name: "createToken",
12+
inputs: [
13+
{ name: "name", type: "string", internalType: "string" },
14+
{ name: "symbol", type: "string", internalType: "string" },
15+
{ name: "imageUrl", type: "string", internalType: "string" },
16+
{ name: "totalSupply", type: "uint256", internalType: "uint256" },
17+
{ name: "initialFdv", type: "uint256", internalType: "uint256" },
18+
{ name: "creator", type: "address", internalType: "address" },
19+
],
20+
outputs: [{ name: "token", type: "address", internalType: "address" }],
21+
stateMutability: "payable",
22+
},
23+
{
24+
type: "function",
25+
name: "getTokenInfo",
26+
inputs: [{ name: "token", type: "address", internalType: "address" }],
27+
outputs: [
28+
{ name: "name", type: "string", internalType: "string" },
29+
{ name: "symbol", type: "string", internalType: "string" },
30+
{ name: "imageUrl", type: "string", internalType: "string" },
31+
{ name: "totalSupply", type: "uint256", internalType: "uint256" },
32+
{ name: "creator", type: "address", internalType: "address" },
33+
{ name: "pool", type: "address", internalType: "address" },
34+
{ name: "createdAt", type: "uint256", internalType: "uint256" },
35+
],
36+
stateMutability: "view",
37+
},
38+
{
39+
type: "function",
40+
name: "getTokenCount",
41+
inputs: [],
42+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
43+
stateMutability: "view",
44+
},
45+
{
46+
type: "function",
47+
name: "getTokens",
48+
inputs: [
49+
{ name: "offset", type: "uint256", internalType: "uint256" },
50+
{ name: "limit", type: "uint256", internalType: "uint256" },
51+
],
52+
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
53+
stateMutability: "view",
54+
},
55+
{
56+
type: "function",
57+
name: "setImageUrl",
58+
inputs: [
59+
{ name: "token", type: "address", internalType: "address" },
60+
{ name: "imageUrl", type: "string", internalType: "string" },
61+
],
62+
outputs: [],
63+
stateMutability: "nonpayable",
64+
},
65+
] as const;
66+
67+
/**
68+
* PumpClaw SwapRouter contract ABI - minimal functions needed for swap interactions.
69+
*/
70+
export const PUMPCLAW_SWAPROUTER_ABI: Abi = [
71+
{
72+
type: "function",
73+
name: "buyTokens",
74+
inputs: [
75+
{ name: "token", type: "address", internalType: "address" },
76+
{ name: "minTokensOut", type: "uint256", internalType: "uint256" },
77+
],
78+
outputs: [],
79+
stateMutability: "payable",
80+
},
81+
{
82+
type: "function",
83+
name: "sellTokens",
84+
inputs: [
85+
{ name: "token", type: "address", internalType: "address" },
86+
{ name: "tokensIn", type: "uint256", internalType: "uint256" },
87+
{ name: "minEthOut", type: "uint256", internalType: "uint256" },
88+
],
89+
outputs: [],
90+
stateMutability: "nonpayable",
91+
},
92+
] as const;
93+
94+
/**
95+
* ERC20 token ABI - standard functions needed for token interactions.
96+
*/
97+
export const ERC20_ABI: Abi = [
98+
{
99+
type: "function",
100+
name: "symbol",
101+
inputs: [],
102+
outputs: [{ name: "", type: "string", internalType: "string" }],
103+
stateMutability: "view",
104+
},
105+
{
106+
type: "function",
107+
name: "decimals",
108+
inputs: [],
109+
outputs: [{ name: "", type: "uint8", internalType: "uint8" }],
110+
stateMutability: "view",
111+
},
112+
{
113+
type: "function",
114+
name: "totalSupply",
115+
inputs: [],
116+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
117+
stateMutability: "view",
118+
},
119+
{
120+
type: "function",
121+
name: "balanceOf",
122+
inputs: [{ name: "account", type: "address", internalType: "address" }],
123+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
124+
stateMutability: "view",
125+
},
126+
{
127+
type: "function",
128+
name: "approve",
129+
inputs: [
130+
{ name: "spender", type: "address", internalType: "address" },
131+
{ name: "amount", type: "uint256", internalType: "uint256" },
132+
],
133+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
134+
stateMutability: "nonpayable",
135+
},
136+
{
137+
type: "function",
138+
name: "allowance",
139+
inputs: [
140+
{ name: "owner", type: "address", internalType: "address" },
141+
{ name: "spender", type: "address", internalType: "address" },
142+
],
143+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
144+
stateMutability: "view",
145+
},
146+
] as const;
147+
148+
/**
149+
* Contract addresses on Base mainnet.
150+
*/
151+
export const PUMPCLAW_CONTRACT_ADDRESSES = {
152+
"base-mainnet": {
153+
Factory: "0xe5bCa0eDe9208f7Ee7FCAFa0415Ca3DC03e16a90",
154+
SwapRouter: "0x3A9c65f4510de85F1843145d637ae895a2Fe04BE",
155+
},
156+
} as const;
157+
158+
/**
159+
* Gets the PumpClaw Factory contract address for the specified network.
160+
*
161+
* @param network - The network ID to get the contract address for.
162+
* @returns The contract address for the specified network.
163+
* @throws Error if the specified network is not supported.
164+
*/
165+
export function getFactoryAddress(network: string): string {
166+
const addresses =
167+
PUMPCLAW_CONTRACT_ADDRESSES[
168+
network.toLowerCase() as keyof typeof PUMPCLAW_CONTRACT_ADDRESSES
169+
];
170+
if (!addresses) {
171+
throw new Error(
172+
`Unsupported network: ${network}. Supported: ${Object.keys(PUMPCLAW_CONTRACT_ADDRESSES).join(", ")}`,
173+
);
174+
}
175+
return addresses.Factory;
176+
}
177+
178+
/**
179+
* Gets the PumpClaw SwapRouter contract address for the specified network.
180+
*
181+
* @param network - The network ID to get the contract address for.
182+
* @returns The contract address for the specified network.
183+
* @throws Error if the specified network is not supported.
184+
*/
185+
export function getSwapRouterAddress(network: string): string {
186+
const addresses =
187+
PUMPCLAW_CONTRACT_ADDRESSES[
188+
network.toLowerCase() as keyof typeof PUMPCLAW_CONTRACT_ADDRESSES
189+
];
190+
if (!addresses) {
191+
throw new Error(
192+
`Unsupported network: ${network}. Supported: ${Object.keys(PUMPCLAW_CONTRACT_ADDRESSES).join(", ")}`,
193+
);
194+
}
195+
return addresses.SwapRouter;
196+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./schemas";
2+
export * from "./pumpclawActionProvider";

0 commit comments

Comments
 (0)