|
1 | 1 | /** |
2 | | - * TIP20 Token Standard ABI (Skeleton) |
| 2 | + * TIP-20 Token Standard ABI |
3 | 3 | * |
4 | | - * TODO: Update this file when TIP20 ABI becomes available |
| 4 | + * TIP-20 is Tempo's token standard, similar to ERC-20 but with: |
| 5 | + * - 6 decimal places (instead of 18) |
| 6 | + * - transferWithMemo function for attaching metadata |
5 | 7 | */ |
6 | 8 |
|
7 | 9 | /** |
8 | | - * Placeholder TIP20 ABI |
9 | | - * This is an empty array that should be replaced with the actual ABI |
| 10 | + * TIP-20 transferWithMemo ABI |
| 11 | + * Standard function for TIP-20 token transfers with memo field |
10 | 12 | */ |
11 | | -export const TIP20_ABI = [] as const; |
| 13 | +export const TIP20_TRANSFER_WITH_MEMO_ABI = [ |
| 14 | + { |
| 15 | + type: 'function', |
| 16 | + name: 'transferWithMemo', |
| 17 | + inputs: [ |
| 18 | + { name: 'to', type: 'address' }, |
| 19 | + { name: 'amount', type: 'uint256' }, |
| 20 | + { name: 'memo', type: 'bytes32' }, |
| 21 | + ], |
| 22 | + outputs: [{ name: '', type: 'bool' }], |
| 23 | + stateMutability: 'nonpayable', |
| 24 | + }, |
| 25 | +] as const; |
12 | 26 |
|
13 | 27 | /** |
14 | | - * Placeholder for TIP20 Factory ABI |
| 28 | + * Standard TIP-20 token ABI (similar to ERC-20) |
15 | 29 | */ |
16 | | -export const TIP20_FACTORY_ABI = [] as const; |
17 | | - |
18 | | -/** |
19 | | - * Get the method signature for TIP20 transfer |
20 | | - * TODO: Update with actual method name if different from ERC20 |
21 | | - */ |
22 | | -export function getTip20TransferSignature(): string { |
23 | | - return 'transfer(address,uint256)'; |
24 | | -} |
25 | | - |
26 | | -/** |
27 | | - * Get the method signature for TIP20 transferFrom |
28 | | - * TODO: Update with actual method name if different from ERC20 |
29 | | - */ |
30 | | -export function getTip20TransferFromSignature(): string { |
31 | | - return 'transferFrom(address,address,uint256)'; |
32 | | -} |
| 30 | +export const TIP20_ABI = [ |
| 31 | + { |
| 32 | + type: 'function', |
| 33 | + name: 'balanceOf', |
| 34 | + inputs: [{ name: 'account', type: 'address' }], |
| 35 | + outputs: [{ name: '', type: 'uint256' }], |
| 36 | + stateMutability: 'view', |
| 37 | + }, |
| 38 | + { |
| 39 | + type: 'function', |
| 40 | + name: 'transfer', |
| 41 | + inputs: [ |
| 42 | + { name: 'to', type: 'address' }, |
| 43 | + { name: 'amount', type: 'uint256' }, |
| 44 | + ], |
| 45 | + outputs: [{ name: '', type: 'bool' }], |
| 46 | + stateMutability: 'nonpayable', |
| 47 | + }, |
| 48 | + { |
| 49 | + type: 'function', |
| 50 | + name: 'transferFrom', |
| 51 | + inputs: [ |
| 52 | + { name: 'from', type: 'address' }, |
| 53 | + { name: 'to', type: 'address' }, |
| 54 | + { name: 'amount', type: 'uint256' }, |
| 55 | + ], |
| 56 | + outputs: [{ name: '', type: 'bool' }], |
| 57 | + stateMutability: 'nonpayable', |
| 58 | + }, |
| 59 | + ...TIP20_TRANSFER_WITH_MEMO_ABI, |
| 60 | +] as const; |
0 commit comments