@floorlaunchpad/sdk 0.4.1 → 0.7.0
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/CHANGELOG.md +219 -18
- package/README.md +0 -2
- package/dist/abi/evm-event-names.js +7 -0
- package/dist/abi/evm.gen.js +6 -0
- package/dist/abi/functions.gen.js +49 -1
- package/dist/abi/solana.gen.js +5 -0
- package/dist/config/generated.js +77 -0
- package/dist/errors.js +2 -2
- package/dist/events/types.gen.js +1 -1
- package/dist/evm/chains.js +32 -24
- package/dist/evm/floor/calls.js +5 -0
- package/dist/evm/router.js +1 -25
- package/dist/evm/squid.js +3 -3
- package/dist/generated/interface.gen.js +48 -43
- package/dist/index.js +1 -0
- package/dist/indexer/bodies.js +137 -2
- package/dist/indexer/client.js +10 -1
- package/dist/indexer/contract.js +65 -6
- package/dist/indexer/paths.js +34 -7
- package/dist/indexer/read.js +12 -3
- package/dist/indexer/stream.js +2 -2
- package/dist/math/v2/book.js +40 -7
- package/dist/math/v2/create.js +1 -1
- package/dist/math/v2/fees.js +30 -4
- package/dist/math/v2/milestones.js +1 -1
- package/dist/math/v2/receipt.js +3 -3
- package/dist/math/v2/relay.js +201 -1
- package/dist/math/v2/rows.js +17 -0
- package/dist/math/v2/split.js +60 -15
- package/dist/math/v2/team.js +14 -1
- package/dist/math/v2/trade.js +16 -8
- package/dist/solana/floor/accounts.js +30 -3
- package/dist/solana/floor/events.js +6 -0
- package/dist/solana/floor/instructions.js +23 -1
- package/dist/solana/floor/program.js +3 -0
- package/dist/ton/addresses.js +36 -0
- package/dist/ton/book-check.js +23 -0
- package/dist/ton/book.js +119 -0
- package/dist/ton/cell.js +542 -0
- package/dist/ton/consts.generated.js +17 -0
- package/dist/ton/content.js +83 -0
- package/dist/ton/gas.js +198 -0
- package/dist/ton/governance.js +401 -0
- package/dist/ton/index.js +18 -0
- package/dist/ton/messages.js +340 -0
- package/dist/ton/ops.js +37 -0
- package/dist/ton/price.js +51 -0
- package/dist/ton/quote-entry.js +116 -0
- package/dist/ton/quote.js +25 -0
- package/dist/ton/reader.js +378 -0
- package/dist/ton/types.js +43 -0
- package/dist/ton/wallet.js +26 -0
- package/dist/v2/events.js +2 -0
- package/dist/v2/evm.js +8 -1
- package/dist/v2/layouts.js +7 -1
- package/dist/v2/router.js +2 -2
- package/dist/v2/solana.js +1 -1
- package/dist/v2/solanaSettle.js +2 -0
- package/dist/v2/tx/evm.js +15 -1
- package/docs/aggregator.md +0 -22
- package/docs/bot.md +0 -8
- package/docs/cursor-pages.md +9 -5
- package/docs/frontend.md +0 -2
- package/docs/ton.md +107 -0
- package/docs/wallet.md +0 -2
- package/examples/floor-line.html +1 -1
- package/package.json +6 -1
- package/src/abi/evm-event-names.ts +7 -0
- package/src/abi/evm.gen.ts +6 -0
- package/src/abi/functions.gen.ts +49 -1
- package/src/abi/solana.gen.ts +5 -0
- package/src/config/generated.ts +77 -0
- package/src/errors.ts +2 -2
- package/src/events/types.gen.ts +57 -1
- package/src/evm/chains.ts +34 -28
- package/src/evm/floor/calls.ts +5 -0
- package/src/evm/router.ts +1 -26
- package/src/evm/squid.ts +3 -3
- package/src/generated/interface.gen.ts +48 -43
- package/src/index.ts +1 -0
- package/src/indexer/bodies.ts +144 -2
- package/src/indexer/client.ts +17 -4
- package/src/indexer/contract.ts +66 -7
- package/src/indexer/paths.ts +62 -7
- package/src/indexer/read.ts +14 -5
- package/src/indexer/stream.ts +4 -4
- package/src/math/v2/book.ts +42 -7
- package/src/math/v2/create.ts +1 -1
- package/src/math/v2/fees.ts +30 -4
- package/src/math/v2/milestones.ts +1 -1
- package/src/math/v2/receipt.ts +7 -3
- package/src/math/v2/relay.ts +208 -1
- package/src/math/v2/rows.ts +17 -0
- package/src/math/v2/split.ts +70 -16
- package/src/math/v2/team.ts +14 -1
- package/src/math/v2/trade.ts +16 -8
- package/src/solana/floor/accounts.ts +30 -3
- package/src/solana/floor/events.ts +6 -0
- package/src/solana/floor/instructions.ts +23 -1
- package/src/solana/floor/program.ts +3 -0
- package/src/ton/addresses.ts +38 -0
- package/src/ton/book-check.ts +24 -0
- package/src/ton/book.ts +136 -0
- package/src/ton/cell.ts +547 -0
- package/src/ton/consts.generated.ts +17 -0
- package/src/ton/content.ts +97 -0
- package/src/ton/gas.ts +209 -0
- package/src/ton/governance.ts +452 -0
- package/src/ton/index.ts +18 -0
- package/src/ton/messages.ts +343 -0
- package/src/ton/ops.ts +37 -0
- package/src/ton/price.ts +54 -0
- package/src/ton/quote-entry.ts +138 -0
- package/src/ton/quote.ts +67 -0
- package/src/ton/reader.ts +420 -0
- package/src/ton/types.ts +201 -0
- package/src/ton/wallet.ts +30 -0
- package/src/v2/events.ts +3 -1
- package/src/v2/evm.ts +10 -1
- package/src/v2/layouts.ts +7 -1
- package/src/v2/router.ts +2 -2
- package/src/v2/solana.ts +1 -1
- package/src/v2/solanaSettle.ts +2 -0
- package/src/v2/tx/evm.ts +15 -1
- package/src/v2/types.ts +14 -1
package/src/events/types.gen.ts
CHANGED
|
@@ -136,6 +136,21 @@ export interface SolTraderRefClearedFields {
|
|
|
136
136
|
trader: string;
|
|
137
137
|
records: number;
|
|
138
138
|
}
|
|
139
|
+
export interface SolOgUserSetFields {
|
|
140
|
+
referrer: string;
|
|
141
|
+
from: bigint;
|
|
142
|
+
until: bigint;
|
|
143
|
+
count: number;
|
|
144
|
+
}
|
|
145
|
+
export interface SolOgUserRevokedFields {
|
|
146
|
+
referrer: string;
|
|
147
|
+
until: bigint;
|
|
148
|
+
count: number;
|
|
149
|
+
}
|
|
150
|
+
export interface SolOgSyncedFields {
|
|
151
|
+
referrer: string;
|
|
152
|
+
records: number;
|
|
153
|
+
}
|
|
139
154
|
export interface SolCreatorBuyUnlockedFields {
|
|
140
155
|
launch: string;
|
|
141
156
|
creator: string;
|
|
@@ -412,6 +427,13 @@ export interface SolDeadSyncedFields {
|
|
|
412
427
|
deadTokens: bigint;
|
|
413
428
|
sCirc: bigint;
|
|
414
429
|
}
|
|
430
|
+
export interface SolRefSlicesFields {
|
|
431
|
+
launch: string;
|
|
432
|
+
trader: string;
|
|
433
|
+
traderParts: bigint[];
|
|
434
|
+
creatorParts: bigint[];
|
|
435
|
+
og: number;
|
|
436
|
+
}
|
|
415
437
|
export interface SolGenesisRaiseBoughtFields {
|
|
416
438
|
launch: string;
|
|
417
439
|
trader: string;
|
|
@@ -459,6 +481,9 @@ export type SolanaEventMap = {
|
|
|
459
481
|
TraderRefOpened: SolTraderRefOpenedFields;
|
|
460
482
|
TraderLinkOpened: SolTraderLinkOpenedFields;
|
|
461
483
|
TraderRefCleared: SolTraderRefClearedFields;
|
|
484
|
+
OgUserSet: SolOgUserSetFields;
|
|
485
|
+
OgUserRevoked: SolOgUserRevokedFields;
|
|
486
|
+
OgSynced: SolOgSyncedFields;
|
|
462
487
|
CreatorBuyUnlocked: SolCreatorBuyUnlockedFields;
|
|
463
488
|
RefOwedOpened: SolRefOwedOpenedFields;
|
|
464
489
|
RefsRolled: SolRefsRolledFields;
|
|
@@ -494,6 +519,7 @@ export type SolanaEventMap = {
|
|
|
494
519
|
HolderPositionClosed: SolHolderPositionClosedFields;
|
|
495
520
|
HolderIndexRolled: SolHolderIndexRolledFields;
|
|
496
521
|
DeadSynced: SolDeadSyncedFields;
|
|
522
|
+
RefSlices: SolRefSlicesFields;
|
|
497
523
|
GenesisRaiseBought: SolGenesisRaiseBoughtFields;
|
|
498
524
|
};
|
|
499
525
|
export type SolanaEvent = { [N in keyof SolanaEventMap]: { chain: "solana"; name: N; fields: SolanaEventMap[N] } }[keyof SolanaEventMap];
|
|
@@ -540,6 +566,14 @@ export interface EvmDeadSyncedFields {
|
|
|
540
566
|
deadTokens: bigint;
|
|
541
567
|
sCirc: bigint;
|
|
542
568
|
}
|
|
569
|
+
export interface EvmHolderMovedFields {
|
|
570
|
+
launchId: bigint;
|
|
571
|
+
from: string;
|
|
572
|
+
to: string;
|
|
573
|
+
value: bigint;
|
|
574
|
+
fromBalance: bigint;
|
|
575
|
+
toBalance: bigint;
|
|
576
|
+
}
|
|
543
577
|
export interface EvmBackingCreditedFields {
|
|
544
578
|
launchId: bigint;
|
|
545
579
|
donor: string;
|
|
@@ -562,6 +596,24 @@ export interface EvmTokensBurnedV2Fields {
|
|
|
562
596
|
floorAfterX64: bigint;
|
|
563
597
|
fromShareBought: bigint;
|
|
564
598
|
}
|
|
599
|
+
export interface EvmRefSlicesFields {
|
|
600
|
+
launchId: bigint;
|
|
601
|
+
trader: string;
|
|
602
|
+
traderParts: bigint[];
|
|
603
|
+
creatorParts: bigint[];
|
|
604
|
+
og: bigint;
|
|
605
|
+
}
|
|
606
|
+
export interface EvmOgUserSetFields {
|
|
607
|
+
referrer: string;
|
|
608
|
+
from: bigint;
|
|
609
|
+
until: bigint;
|
|
610
|
+
count: bigint;
|
|
611
|
+
}
|
|
612
|
+
export interface EvmOgUserRevokedFields {
|
|
613
|
+
referrer: string;
|
|
614
|
+
until: bigint;
|
|
615
|
+
count: bigint;
|
|
616
|
+
}
|
|
565
617
|
export interface EvmOptedInFields {
|
|
566
618
|
a: string;
|
|
567
619
|
}
|
|
@@ -803,8 +855,12 @@ export type EvmEventMap = {
|
|
|
803
855
|
Trade: EvmTradeFields;
|
|
804
856
|
HolderIndexRolled: EvmHolderIndexRolledFields;
|
|
805
857
|
DeadSynced: EvmDeadSyncedFields;
|
|
858
|
+
HolderMoved: EvmHolderMovedFields;
|
|
806
859
|
BackingCredited: EvmBackingCreditedFields;
|
|
807
860
|
TokensBurnedV2: EvmTokensBurnedV2Fields;
|
|
861
|
+
RefSlices: EvmRefSlicesFields;
|
|
862
|
+
OgUserSet: EvmOgUserSetFields;
|
|
863
|
+
OgUserRevoked: EvmOgUserRevokedFields;
|
|
808
864
|
OptedIn: EvmOptedInFields;
|
|
809
865
|
ClaimSkipped: EvmClaimSkippedFields;
|
|
810
866
|
Claimed: EvmClaimedFields;
|
|
@@ -840,4 +896,4 @@ export type EvmEventMap = {
|
|
|
840
896
|
};
|
|
841
897
|
export type EvmEvent = { [N in keyof EvmEventMap]: { chain: "evm"; name: N; fields: EvmEventMap[N]; address?: string } }[keyof EvmEventMap];
|
|
842
898
|
|
|
843
|
-
export const SHARED_EVENT_NAMES = ["BackingCredited","Claimed","ConfigWritten","CreatorBuyUnlocked","DeadSynced","Graduated","HandleBound","HolderIndexRolled","HolderWithdrawn","LaunchCreated","MetadataBaseSet","PlatformWithdrawn","PotsSwept","PresetWritten","QuoteWritten","TeamShareBought","TeamSlotMember","TeamSlotOpened","Trade","TraderRefCleared","TraderRefOpened"] as const;
|
|
899
|
+
export const SHARED_EVENT_NAMES = ["BackingCredited","Claimed","ConfigWritten","CreatorBuyUnlocked","DeadSynced","Graduated","HandleBound","HolderIndexRolled","HolderWithdrawn","LaunchCreated","MetadataBaseSet","OgUserRevoked","OgUserSet","PlatformWithdrawn","PotsSwept","PresetWritten","QuoteWritten","RefSlices","TeamShareBought","TeamSlotMember","TeamSlotOpened","Trade","TraderRefCleared","TraderRefOpened"] as const;
|
package/src/evm/chains.ts
CHANGED
|
@@ -22,8 +22,6 @@ export interface ZapRouter {
|
|
|
22
22
|
urFork?: ZapUrFork;
|
|
23
23
|
|
|
24
24
|
zap: string | null;
|
|
25
|
-
|
|
26
|
-
floorRouter: string;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
export interface EvmChain {
|
|
@@ -48,6 +46,8 @@ function strict(a: string): string {
|
|
|
48
46
|
return c;
|
|
49
47
|
}
|
|
50
48
|
|
|
49
|
+
type ZapRouterSpec = Omit<ZapRouter, "zap">;
|
|
50
|
+
|
|
51
51
|
const UR_FORK_OF_SLOT: Readonly<Record<string, ZapUrFork>> = { "aerodrome-ur": "aerodrome", "pancake-ur": "pancake", "ramses-ur": "ramses" };
|
|
52
52
|
function urForkOf(slot: string): ZapUrFork {
|
|
53
53
|
const f = UR_FORK_OF_SLOT[slot];
|
|
@@ -55,8 +55,6 @@ function urForkOf(slot: string): ZapUrFork {
|
|
|
55
55
|
return f;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
type ZapRouterSpec = Omit<ZapRouter, "zap" | "floorRouter">;
|
|
59
|
-
|
|
60
58
|
const r = (slot: string, amm: string, router: string, family: ZapFamily, confidence: ZapRouter["confidence"], optional = false, forkEncoding = false): ZapRouterSpec => ({
|
|
61
59
|
slot,
|
|
62
60
|
amm,
|
|
@@ -93,28 +91,9 @@ export const FLOOR_ZAP_ADDRESSES: Readonly<Record<ChainKey, Readonly<Record<stri
|
|
|
93
91
|
elysium: { "uniswap-ur": strict("0x56F22be922Ffc9e955169E0673D3Ae42B1151995") },
|
|
94
92
|
};
|
|
95
93
|
|
|
96
|
-
export const FLOOR_ROUTER_DEPLOYER = strict("0x3e70158e54E91d2984c0F3B66ce2cE730d1E0e11");
|
|
97
|
-
|
|
98
|
-
const ROUTER_PROXY_INITCODE = "0x67363d3d37363d34f03d5260086018f3";
|
|
99
|
-
|
|
100
|
-
function slotWord(slot: string): Uint8Array {
|
|
101
|
-
const b = new TextEncoder().encode(slot);
|
|
102
|
-
if (b.length === 0 || b.length > 32) throw new RangeError(`a router slot is 1..32 bytes: ${JSON.stringify(slot)}`);
|
|
103
|
-
const w = new Uint8Array(32);
|
|
104
|
-
w.set(b);
|
|
105
|
-
return w;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function floorRouterAddress(slot: string, deployer: string = FLOOR_ROUTER_DEPLOYER): string {
|
|
109
|
-
const s = keccak256(encodeAbi(["string", "bytes32"], ["floor-router.v1.FloorRouter", bytesToHex(slotWord(slot))]));
|
|
110
|
-
const proxy = create2Address({ deployer, salt: s, initCode: ROUTER_PROXY_INITCODE });
|
|
111
|
-
|
|
112
|
-
return checksumAddress(bytesToHex(keccak256(hexToBytes("0xd694" + proxy.slice(2) + "01")).slice(12)));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
94
|
function withBookedZaps(key: ChainKey, rows: readonly ZapRouterSpec[]): ZapRouter[] {
|
|
116
95
|
const book = FLOOR_ZAP_ADDRESSES[key];
|
|
117
|
-
return rows.map((row) => ({ ...row, zap: book[row.slot] ?? null
|
|
96
|
+
return rows.map((row) => ({ ...row, zap: book[row.slot] ?? null }));
|
|
118
97
|
}
|
|
119
98
|
|
|
120
99
|
const UNISWAP_UR = "uniswap-ur";
|
|
@@ -190,10 +169,6 @@ export const EVM_CHAINS: Record<ChainKey, EvmChain> = Object.fromEntries(
|
|
|
190
169
|
CHAIN_REGISTRY.flatMap((c) => (c.family === "evm" ? [[c.slug, { key: c.slug, chainId: c.chainId, name: c.label, nativeSymbol: c.native.symbol, ...ROUTES[c.slug], ...((c.v2DayOne as boolean) === false ? { v2DayOne: false as const } : {}) }]] : [])),
|
|
191
170
|
) as Record<ChainKey, EvmChain>;
|
|
192
171
|
|
|
193
|
-
export const FLOOR_ROUTER_ADDRESSES: Readonly<Record<ChainKey, Readonly<Record<string, string>>>> = Object.freeze(
|
|
194
|
-
Object.fromEntries(Object.values(EVM_CHAINS).map((c) => [c.key, Object.freeze(Object.fromEntries(c.zapRouters.map((r) => [r.slot, r.floorRouter])))])),
|
|
195
|
-
) as Readonly<Record<ChainKey, Readonly<Record<string, string>>>>;
|
|
196
|
-
|
|
197
172
|
export const v2DayOneChains = (): EvmChain[] => Object.values(EVM_CHAINS).filter((c) => c.v2DayOne !== false);
|
|
198
173
|
export const chainById = (chainId: number): EvmChain | null => Object.values(EVM_CHAINS).find((c) => c.chainId === chainId) ?? null;
|
|
199
174
|
|
|
@@ -226,6 +201,37 @@ export function floorAmmAddressV2(p: { deployer: string; proxySalt: string; code
|
|
|
226
201
|
|
|
227
202
|
export const tokenImplAddressV2 = (p: { salt: string; code: string }): string => at(p.salt, p.code);
|
|
228
203
|
|
|
204
|
+
export const LAUNCH_TOKEN_IMPLS = {
|
|
205
|
+
live: "0xF1009235c447fcA25e8792784772EDA720e2b822",
|
|
206
|
+
holderMoved: "0x91E2311c9c77a56945c082dd8d9ff7bF0eC2B79B",
|
|
207
|
+
} as const;
|
|
208
|
+
|
|
209
|
+
export const HOLDER_MOVED_FIRST_LAUNCH_ID: Readonly<Record<ChainKey, number | null>> = {
|
|
210
|
+
ethereum: 1, base: 1, bsc: 1, arbitrum: 1, arc: 1, robinhood: 1, hyperevm: 1, elysium: 1,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export function tokenImplForLaunch(p: { chain: ChainKey; id: bigint | number; firstId?: number | null }): string {
|
|
214
|
+
const first = p.firstId !== undefined ? p.firstId : HOLDER_MOVED_FIRST_LAUNCH_ID[p.chain];
|
|
215
|
+
return first !== null && BigInt(p.id) >= BigInt(first) ? LAUNCH_TOKEN_IMPLS.holderMoved : LAUNCH_TOKEN_IMPLS.live;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function tokenImplOfCode(code: string): string | null {
|
|
219
|
+
const c = code.toLowerCase().replace(/^0x/, "");
|
|
220
|
+
const m = /^363d3d373d3d3d363d73([0-9a-f]{40})5af43d82803e903d91602b57fd5bf3$/.exec(c);
|
|
221
|
+
return m ? "0x" + m[1] : null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const isLaunchTokenImpl = (impl: string | null): boolean =>
|
|
225
|
+
impl !== null && Object.values(LAUNCH_TOKEN_IMPLS).some((a) => a.toLowerCase() === impl.toLowerCase());
|
|
226
|
+
|
|
227
|
+
export function launchTokenCodeKind(code: string): "live" | "holderMoved" | null {
|
|
228
|
+
const i = tokenImplOfCode(code);
|
|
229
|
+
if (i === null) return null;
|
|
230
|
+
if (i === LAUNCH_TOKEN_IMPLS.live.toLowerCase()) return "live";
|
|
231
|
+
if (i === LAUNCH_TOKEN_IMPLS.holderMoved.toLowerCase()) return "holderMoved";
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
|
|
229
235
|
export function zapDeployerAddressV2(p: { floorAmm: string; authority: string; code: string }): string {
|
|
230
236
|
return at(FLOOR_SALTS.zapDeployer, cat(p.code, bytesToHex(encodeAbi(["address", "address"], [p.floorAmm, p.authority]))));
|
|
231
237
|
}
|
package/src/evm/floor/calls.ts
CHANGED
|
@@ -200,6 +200,11 @@ export function traderRefAuthDigest(p: { chainId: bigint; floorAmm: string; trad
|
|
|
200
200
|
return { digest: bytesToHex(d), message: eip191(d) };
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
export function ogUserAuthDigest(p: { chainId: bigint; floorAmm: string; referrer: string; deadline: bigint }): { digest: string; message: string } {
|
|
204
|
+
const d = keccak256(encodeAbi(["string", "uint256", "address", "address", "uint256"], ["floor.amm.ogUser.auth.v1", p.chainId, p.floorAmm, p.referrer, p.deadline]));
|
|
205
|
+
return { digest: bytesToHex(d), message: eip191(d) };
|
|
206
|
+
}
|
|
207
|
+
|
|
203
208
|
export function bindHandleAuthDigest(p: { chainId: bigint; floorAmm: string; handleId: string; wallet: string; quotes: readonly string[]; deadline: bigint }): { digest: string; message: string } {
|
|
204
209
|
const d = keccak256(
|
|
205
210
|
encodeAbi(
|
package/src/evm/router.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
import { encodeFunctionData } from "./items.ts";
|
|
4
4
|
import { deadlineArg } from "./floor/calls.ts";
|
|
5
5
|
import { EVM_NATIVE, NoRouteError, coinKey } from "../route/graph.ts";
|
|
6
|
-
import {
|
|
7
|
-
import type { ChainKey } from "./chains.ts";
|
|
6
|
+
import { chainById } from "./chains.ts";
|
|
8
7
|
import type { Pool } from "../route/graph.ts";
|
|
9
8
|
import type { HopQuote, RouteQuote } from "../route/quote.ts";
|
|
10
9
|
|
|
@@ -208,27 +207,3 @@ export function evmRouteCall(q: RouteQuote, p: { router: string; to: string; dea
|
|
|
208
207
|
const b: RouterBuy = { path: ids(buys), tokenIn: s.tokenOut, amountIn: 0n, swapData: "0x", minQuoteIn: 0n, minTokensOut: mins(buys), to: p.to, deadline: p.deadline };
|
|
209
208
|
return call(encodeRouterSwap(s, b, p.chainId), 0n);
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
export async function floorRouterLive(rpc: { getCode: (address: string) => Promise<string | undefined> }, at: string | { chain: ChainKey; slot: string }): Promise<boolean> {
|
|
213
|
-
const address = floorRouterAt(at);
|
|
214
|
-
const code: unknown = await rpc.getCode(address);
|
|
215
|
-
if (code === undefined) return false;
|
|
216
|
-
if (typeof code !== "string" || !/^0x([0-9a-fA-F]{2})*$/.test(code)) throw new TypeError(`getCode(${address}) returned ${String(code)}, not hex bytes`);
|
|
217
|
-
return code.length > 2;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export async function assertFloorRouterLive(rpc: { getCode: (address: string) => Promise<string | undefined> }, at: string | { chain: ChainKey; slot: string }): Promise<string> {
|
|
221
|
-
const address = floorRouterAt(at);
|
|
222
|
-
if (!(await floorRouterLive(rpc, address))) throw new RangeError(`FloorRouter ${address} has no code on this chain yet: it is derived ahead of its deploy; do not send to it (a native coin sent to it is lost)`);
|
|
223
|
-
return address;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function floorRouterAt(at: string | { chain: ChainKey; slot: string }): string {
|
|
227
|
-
if (typeof at === "string") {
|
|
228
|
-
if (!/^0x[0-9a-fA-F]{40}$/.test(at)) throw new RangeError(`a FloorRouter is a 20-byte address: ${at}`);
|
|
229
|
-
return at;
|
|
230
|
-
}
|
|
231
|
-
const row = EVM_CHAINS[at.chain]?.zapRouters.find((r) => r.slot === at.slot);
|
|
232
|
-
if (row === undefined) throw new RangeError(`no FloorRouter slot ${at.slot} on ${at.chain}`);
|
|
233
|
-
return row.floorRouter;
|
|
234
|
-
}
|
package/src/evm/squid.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type SquidHook = {
|
|
|
39
39
|
|
|
40
40
|
export const SQUID_TOKEN_SCALE = 10n ** 12n;
|
|
41
41
|
|
|
42
|
-
export const SQUID_GAS = { transfer:
|
|
42
|
+
export const SQUID_GAS = { transfer: 100_000, buy: 1_100_000, sell: 850_000, zapBuy: 1_300_000, passOn: 30_000 } as const;
|
|
43
43
|
|
|
44
44
|
type Common = {
|
|
45
45
|
chainId: number | string;
|
|
@@ -96,12 +96,12 @@ export function buyHookErc20(p: Common & { quote: string; minTokensOut: bigint }
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export function buyHookNative(p: Common & { zap: string; swapData: string; minQuoteIn: bigint; minTokensOut: bigint; quote
|
|
99
|
+
export function buyHookNative(p: Common & { zap: string; swapData: string; minQuoteIn: bigint; minTokensOut: bigint; quote: string }): SquidHook {
|
|
100
100
|
checkCommon(p);
|
|
101
101
|
const user = checkUser(p);
|
|
102
102
|
if (p.minQuoteIn <= 0n || p.minTokensOut <= 0n) throw new SquidHookError("NO_MINIMUM", "minQuoteIn and minTokensOut must be > 0");
|
|
103
103
|
const zap = lc(p.zap, "zap");
|
|
104
|
-
const quote = lc(p.quote
|
|
104
|
+
const quote = lc(p.quote, "quote");
|
|
105
105
|
const calls = [
|
|
106
106
|
call(SQUID_CALL.FullNativeBalance, zap, 0n, bytesToHex(encodeCall("buyWithEth(uint256,bytes,uint256,uint256,address,uint256)", [p.launchId, p.swapData, p.minQuoteIn, p.minTokensOut, user, p.deadline])), "0x", SQUID_GAS.zapBuy),
|
|
107
107
|
call(SQUID_CALL.FullNativeBalance, user, 0n, "0x", "0x", SQUID_GAS.passOn),
|
|
@@ -18,17 +18,17 @@ export interface EvmFunctionSelectorRow {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
|
|
21
|
-
{ name: "acceptAuthority", signature: "acceptAuthority()", selector: "0x1580798f", sources: ["floorAmm"] },
|
|
22
|
-
{ name: "accounted", signature: "accounted(address)", selector: "0xee1a56ce", sources: ["floorAmm"] },
|
|
21
|
+
{ name: "acceptAuthority", signature: "acceptAuthority()", selector: "0x1580798f", sources: ["floorAmm","floorAmmGovV2"] },
|
|
22
|
+
{ name: "accounted", signature: "accounted(address)", selector: "0xee1a56ce", sources: ["floorAmm","floorAmmGovV2"] },
|
|
23
23
|
{ name: "addPreset", signature: "addPreset(uint8,bytes)", selector: "0xb88257b1", sources: ["floorAmm"] },
|
|
24
|
-
{ name: "addQuote", signature: "addQuote(address,uint256,uint256)", selector: "0x488c664b", sources: ["floorAmm"] },
|
|
24
|
+
{ name: "addQuote", signature: "addQuote(address,uint256,uint256)", selector: "0x488c664b", sources: ["floorAmm","floorAmmGovV2"] },
|
|
25
25
|
{ name: "addReward", signature: "addReward(uint256)", selector: "0x74de4ec4", sources: ["floorTokenIndexed"] },
|
|
26
26
|
{ name: "allowance", signature: "allowance(address,address)", selector: "0xdd62ed3e", sources: ["floorToken","floorTokenIndexed"] },
|
|
27
27
|
{ name: "approve", signature: "approve(address,uint256)", selector: "0x095ea7b3", sources: ["floorToken","floorTokenIndexed"] },
|
|
28
|
-
{ name: "authority", signature: "authority()", selector: "0xbf7e214f", sources: ["floorAmm"] },
|
|
28
|
+
{ name: "authority", signature: "authority()", selector: "0xbf7e214f", sources: ["floorAmm","floorAmmGovV2"] },
|
|
29
29
|
{ name: "balanceOf", signature: "balanceOf(address)", selector: "0x70a08231", sources: ["floorToken","floorTokenIndexed"] },
|
|
30
30
|
{ name: "bidMoney", signature: "bidMoney(uint256)", selector: "0x8e403c51", sources: ["floorAmmViewsV2"] },
|
|
31
|
-
{ name: "bindHandle", signature: "bindHandle(bytes32,address,address[],uint256,bytes,bytes)", selector: "0xcea3463e", sources: ["floorAmm"] },
|
|
31
|
+
{ name: "bindHandle", signature: "bindHandle(bytes32,address,address[],uint256,bytes,bytes)", selector: "0xcea3463e", sources: ["floorAmm","floorAmmGovV2"] },
|
|
32
32
|
{ name: "bookEngine", signature: "bookEngine()", selector: "0x72148c77", sources: ["floorAmmV2"] },
|
|
33
33
|
{ name: "bookState", signature: "bookState()", selector: "0x2c14e3f2", sources: ["floorTokenIndexed"] },
|
|
34
34
|
{ name: "bookTotals", signature: "bookTotals()", selector: "0xbffc2073", sources: ["floorTokenIndexed"] },
|
|
@@ -42,11 +42,11 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
|
|
|
42
42
|
{ name: "checkPreset", signature: "checkPreset(bytes)", selector: "0x6337513e", sources: ["floorAmm"] },
|
|
43
43
|
{ name: "circulatingOf", signature: "circulatingOf(uint256)", selector: "0x72812fcf", sources: ["floorAmmViewsV2"] },
|
|
44
44
|
{ name: "claim", signature: "claim(address,uint256,uint256[],address[])", selector: "0xa461a90d", sources: ["floorAmm","floorAmmClaimsV2"] },
|
|
45
|
-
{ name: "claimPayoutTo", signature: "claimPayoutTo(address,address)", selector: "0xc14ab75d", sources: ["floorAmm"] },
|
|
46
|
-
{ name: "clearTraderRef", signature: "clearTraderRef(address)", selector: "0x53550430", sources: ["floorAmm"] },
|
|
45
|
+
{ name: "claimPayoutTo", signature: "claimPayoutTo(address,address)", selector: "0xc14ab75d", sources: ["floorAmm","floorAmmGovV2"] },
|
|
46
|
+
{ name: "clearTraderRef", signature: "clearTraderRef(address)", selector: "0x53550430", sources: ["floorAmm","floorAmmGovV2"] },
|
|
47
47
|
{ name: "createBookEngine", signature: "createBookEngine()", selector: "0x0fdf26a7", sources: ["floorAmmCreateV2"] },
|
|
48
48
|
{ name: "createLaunch", signature: "createLaunch((uint8,address,string,string,uint256,uint256,bool,bytes32,uint256,uint16))", selector: "0x25b62f18", sources: ["floorAmm","floorAmmCreateV2"] },
|
|
49
|
-
{ name: "createPaused", signature: "createPaused()", selector: "0xbac7b497", sources: ["floorAmm"] },
|
|
49
|
+
{ name: "createPaused", signature: "createPaused()", selector: "0xbac7b497", sources: ["floorAmm","floorAmmGovV2"] },
|
|
50
50
|
{ name: "creditBacking", signature: "creditBacking(uint256,uint256)", selector: "0x1f341504", sources: ["floorAmmV2"] },
|
|
51
51
|
{ name: "DEAD", signature: "DEAD()", selector: "0x03fd2a45", sources: ["floorTokenIndexed"] },
|
|
52
52
|
{ name: "decimals", signature: "decimals()", selector: "0x313ce567", sources: ["floorToken","floorTokenIndexed"] },
|
|
@@ -55,13 +55,13 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
|
|
|
55
55
|
{ name: "DOMAIN_SEPARATOR", signature: "DOMAIN_SEPARATOR()", selector: "0x3644e515", sources: ["floorToken","floorTokenIndexed"] },
|
|
56
56
|
{ name: "eip712Domain", signature: "eip712Domain()", selector: "0x84b0196e", sources: ["floorTokenIndexed"] },
|
|
57
57
|
{ name: "floorAmm", signature: "floorAmm()", selector: "0x78164d52", sources: ["floorZap"] },
|
|
58
|
-
{ name: "floorTokenAccrued", signature: "floorTokenAccrued(address)", selector: "0xf3a261f9", sources: ["floorAmm"] },
|
|
59
|
-
{ name: "handleOwed", signature: "handleOwed(bytes32,address)", selector: "0xaad2ed5c", sources: ["floorAmm"] },
|
|
60
|
-
{ name: "handleWallet", signature: "handleWallet(bytes32)", selector: "0xc6da686d", sources: ["floorAmm"] },
|
|
58
|
+
{ name: "floorTokenAccrued", signature: "floorTokenAccrued(address)", selector: "0xf3a261f9", sources: ["floorAmm","floorAmmGovV2"] },
|
|
59
|
+
{ name: "handleOwed", signature: "handleOwed(bytes32,address)", selector: "0xaad2ed5c", sources: ["floorAmm","floorAmmGovV2"] },
|
|
60
|
+
{ name: "handleWallet", signature: "handleWallet(bytes32)", selector: "0xc6da686d", sources: ["floorAmm","floorAmmGovV2"] },
|
|
61
61
|
{ name: "holderBook", signature: "holderBook(uint256)", selector: "0xf5d23b14", sources: ["floorAmmViewsV2"] },
|
|
62
|
-
{ name: "holderBucket", signature: "holderBucket(address)", selector: "0x088806d0", sources: ["floorAmm"] },
|
|
63
|
-
{ name: "holderDest", signature: "holderDest()", selector: "0x84a6263a", sources: ["floorAmm"] },
|
|
64
|
-
{ name: "initialize", signature: "initialize(address,address,address,address)", selector: "0xf8c8765e", sources: ["floorAmm"] },
|
|
62
|
+
{ name: "holderBucket", signature: "holderBucket(address)", selector: "0x088806d0", sources: ["floorAmm","floorAmmGovV2"] },
|
|
63
|
+
{ name: "holderDest", signature: "holderDest()", selector: "0x84a6263a", sources: ["floorAmm","floorAmmGovV2"] },
|
|
64
|
+
{ name: "initialize", signature: "initialize(address,address,address,address)", selector: "0xf8c8765e", sources: ["floorAmm","floorAmmGovV2"] },
|
|
65
65
|
{ name: "initialize", signature: "initialize(string,string,uint256)", selector: "0xb119490e", sources: ["floorTokenIndexed"] },
|
|
66
66
|
{ name: "launchBook", signature: "launchBook(uint256)", selector: "0x926310f1", sources: ["floorAmmViewsV2"] },
|
|
67
67
|
{ name: "launchCount", signature: "launchCount()", selector: "0x27cca59f", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
@@ -73,56 +73,61 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
|
|
|
73
73
|
{ name: "launchQuote", signature: "launchQuote(uint256)", selector: "0x98032919", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
74
74
|
{ name: "launchState", signature: "launchState(uint256)", selector: "0xac3307e8", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
75
75
|
{ name: "launchToken", signature: "launchToken(uint256)", selector: "0x6a19197b", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
76
|
-
{ name: "metadataBase", signature: "metadataBase()", selector: "0x65b973c3", sources: ["floorAmm"] },
|
|
76
|
+
{ name: "metadataBase", signature: "metadataBase()", selector: "0x65b973c3", sources: ["floorAmm","floorAmmGovV2"] },
|
|
77
77
|
{ name: "metadataURI", signature: "metadataURI()", selector: "0x03ee438c", sources: ["floorToken","floorTokenIndexed"] },
|
|
78
|
-
{ name: "moveHandleOwed", signature: "moveHandleOwed(bytes32,address[])", selector: "0xc43594a1", sources: ["floorAmm"] },
|
|
78
|
+
{ name: "moveHandleOwed", signature: "moveHandleOwed(bytes32,address[])", selector: "0xc43594a1", sources: ["floorAmm","floorAmmGovV2"] },
|
|
79
79
|
{ name: "name", signature: "name()", selector: "0x06fdde03", sources: ["floorToken","floorTokenIndexed"] },
|
|
80
|
-
{ name: "NATIVE", signature: "NATIVE()", selector: "0xa0cf0aea", sources: ["floorAmm"] },
|
|
81
|
-
{ name: "nativeCreateFee", signature: "nativeCreateFee()", selector: "0x10b51e45", sources: ["floorAmm"] },
|
|
80
|
+
{ name: "NATIVE", signature: "NATIVE()", selector: "0xa0cf0aea", sources: ["floorAmm","floorAmmGovV2"] },
|
|
81
|
+
{ name: "nativeCreateFee", signature: "nativeCreateFee()", selector: "0x10b51e45", sources: ["floorAmm","floorAmmGovV2"] },
|
|
82
82
|
{ name: "nextModule", signature: "nextModule()", selector: "0xf85abfc7", sources: ["floorAmmV2","floorAmmViewsV2","floorAmmCreateV2","floorAmmClaimsV2"] },
|
|
83
83
|
{ name: "nextPresetId", signature: "nextPresetId()", selector: "0xc8a768e6", sources: ["floorAmm"] },
|
|
84
84
|
{ name: "nonces", signature: "nonces(address)", selector: "0x7ecebe00", sources: ["floorToken","floorTokenIndexed"] },
|
|
85
85
|
{ name: "noteBurn", signature: "noteBurn(uint256)", selector: "0x6db7cd01", sources: ["floorAmmCreateV2"] },
|
|
86
86
|
{ name: "noteDead", signature: "noteDead(uint256)", selector: "0xbdf3b0de", sources: ["floorAmmCreateV2"] },
|
|
87
|
+
{ name: "noteMove", signature: "noteMove(address,address,uint256,uint256,uint256)", selector: "0xe6b761ea", sources: ["floorAmmV2"] },
|
|
88
|
+
{ name: "ogCount", signature: "ogCount()", selector: "0x9457990a", sources: ["floorAmmGovV2"] },
|
|
89
|
+
{ name: "ogUserOf", signature: "ogUserOf(address)", selector: "0x6df29e2f", sources: ["floorAmmGovV2"] },
|
|
87
90
|
{ name: "optedIn", signature: "optedIn(address)", selector: "0x4824b8fd", sources: ["floorTokenIndexed"] },
|
|
88
91
|
{ name: "optIn", signature: "optIn()", selector: "0x5b48684e", sources: ["floorTokenIndexed"] },
|
|
89
|
-
{ name: "owedOf", signature: "owedOf(address,address)", selector: "0xfacba08d", sources: ["floorAmm"] },
|
|
90
|
-
{ name: "owedOfMany", signature: "owedOfMany(address,address[])", selector: "0xa1efa4ba", sources: ["floorAmm"] },
|
|
92
|
+
{ name: "owedOf", signature: "owedOf(address,address)", selector: "0xfacba08d", sources: ["floorAmm","floorAmmGovV2"] },
|
|
93
|
+
{ name: "owedOfMany", signature: "owedOfMany(address,address[])", selector: "0xa1efa4ba", sources: ["floorAmm","floorAmmGovV2"] },
|
|
91
94
|
{ name: "owedV2", signature: "owedV2(address,uint256[],address[])", selector: "0xdd3ee1ef", sources: ["floorAmmViewsV2"] },
|
|
92
95
|
{ name: "pairIdOf", signature: "pairIdOf(uint256)", selector: "0x83a74ea3", sources: ["floorAmmViewsV2"] },
|
|
93
|
-
{ name: "payoutOwed", signature: "payoutOwed(address,address)", selector: "0xae3f9120", sources: ["floorAmm"] },
|
|
94
|
-
{ name: "pendingAuthority", signature: "pendingAuthority()", selector: "0xfabb94bb", sources: ["floorAmm"] },
|
|
96
|
+
{ name: "payoutOwed", signature: "payoutOwed(address,address)", selector: "0xae3f9120", sources: ["floorAmm","floorAmmGovV2"] },
|
|
97
|
+
{ name: "pendingAuthority", signature: "pendingAuthority()", selector: "0xfabb94bb", sources: ["floorAmm","floorAmmGovV2"] },
|
|
95
98
|
{ name: "permit", signature: "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)", selector: "0xd505accf", sources: ["floorToken","floorTokenIndexed"] },
|
|
96
|
-
{ name: "platformOwed", signature: "platformOwed(address)", selector: "0x240b9586", sources: ["floorAmm"] },
|
|
99
|
+
{ name: "platformOwed", signature: "platformOwed(address)", selector: "0x240b9586", sources: ["floorAmm","floorAmmGovV2"] },
|
|
97
100
|
{ name: "positionOf", signature: "positionOf(address)", selector: "0xfd2d39c5", sources: ["floorTokenIndexed"] },
|
|
98
101
|
{ name: "predictToken", signature: "predictToken(address,bytes32)", selector: "0x486e36c8", sources: ["floorAmm","floorAmmCreateV2"] },
|
|
99
102
|
{ name: "presetRow", signature: "presetRow(uint8)", selector: "0xa0c15861", sources: ["floorAmm"] },
|
|
100
|
-
{ name: "priceUpdater", signature: "priceUpdater()", selector: "0xfc612a8d", sources: ["floorAmm"] },
|
|
103
|
+
{ name: "priceUpdater", signature: "priceUpdater()", selector: "0xfc612a8d", sources: ["floorAmm","floorAmmGovV2"] },
|
|
101
104
|
{ name: "program", signature: "program()", selector: "0xc860ebc6", sources: ["floorToken","floorTokenIndexed"] },
|
|
102
105
|
{ name: "proxiableUUID", signature: "proxiableUUID()", selector: "0x52d1902d", sources: ["floorAmmV2"] },
|
|
103
106
|
{ name: "quoteBuy", signature: "quoteBuy(uint256,uint256,address)", selector: "0xec7a34c9", sources: ["floorAmm","floorAmmV2"] },
|
|
104
|
-
{ name: "quoteEntry", signature: "quoteEntry(address)", selector: "0x77665076", sources: ["floorAmm"] },
|
|
105
|
-
{ name: "quoteRisk", signature: "quoteRisk(address)", selector: "0x1461d14e", sources: ["floorAmm"] },
|
|
106
|
-
{ name: "quotes", signature: "quotes()", selector: "0xd6a5d7db", sources: ["floorAmm"] },
|
|
107
|
+
{ name: "quoteEntry", signature: "quoteEntry(address)", selector: "0x77665076", sources: ["floorAmm","floorAmmGovV2"] },
|
|
108
|
+
{ name: "quoteRisk", signature: "quoteRisk(address)", selector: "0x1461d14e", sources: ["floorAmm","floorAmmGovV2"] },
|
|
109
|
+
{ name: "quotes", signature: "quotes()", selector: "0xd6a5d7db", sources: ["floorAmm","floorAmmGovV2"] },
|
|
107
110
|
{ name: "quoteSell", signature: "quoteSell(uint256,uint256,address)", selector: "0x0cff08d1", sources: ["floorAmm","floorAmmV2"] },
|
|
108
|
-
{ name: "referralAuthority", signature: "referralAuthority()", selector: "0x2fe0a99a", sources: ["floorAmm"] },
|
|
111
|
+
{ name: "referralAuthority", signature: "referralAuthority()", selector: "0x2fe0a99a", sources: ["floorAmm","floorAmmGovV2"] },
|
|
109
112
|
{ name: "releaseSkipped", signature: "releaseSkipped(address)", selector: "0x215fa9eb", sources: ["floorTokenIndexed"] },
|
|
113
|
+
{ name: "revokeOgUser", signature: "revokeOgUser(address)", selector: "0x52e52ecc", sources: ["floorAmmGovV2"] },
|
|
110
114
|
{ name: "router", signature: "router()", selector: "0xf887ea40", sources: ["floorZap"] },
|
|
111
115
|
{ name: "sell", signature: "sell(uint256,uint256,uint256,address,uint256)", selector: "0xbadb999b", sources: ["floorAmm","floorAmmV2"] },
|
|
112
116
|
{ name: "sellFromBalance", signature: "sellFromBalance(uint256,uint256,address,uint256)", selector: "0x611b00a8", sources: ["floorAmm","floorAmmV2"] },
|
|
113
117
|
{ name: "sellWithPermit", signature: "sellWithPermit(uint256,uint256,uint256,address,uint256,uint256,uint8,bytes32,bytes32)", selector: "0x2ab030d3", sources: ["floorAmm","floorAmmV2"] },
|
|
114
|
-
{ name: "setCreatePaused", signature: "setCreatePaused(bool)", selector: "0x83bcec85", sources: ["floorAmm"] },
|
|
115
|
-
{ name: "setHolderDest", signature: "setHolderDest(address)", selector: "0x6ad3e66d", sources: ["floorAmm"] },
|
|
116
|
-
{ name: "setMetadataBase", signature: "setMetadataBase(string)", selector: "0xd3811c0f", sources: ["floorAmm"] },
|
|
117
|
-
{ name: "setNativeCreateFee", signature: "setNativeCreateFee(uint256)", selector: "0xa4433667", sources: ["floorAmm"] },
|
|
118
|
+
{ name: "setCreatePaused", signature: "setCreatePaused(bool)", selector: "0x83bcec85", sources: ["floorAmm","floorAmmGovV2"] },
|
|
119
|
+
{ name: "setHolderDest", signature: "setHolderDest(address)", selector: "0x6ad3e66d", sources: ["floorAmm","floorAmmGovV2"] },
|
|
120
|
+
{ name: "setMetadataBase", signature: "setMetadataBase(string)", selector: "0xd3811c0f", sources: ["floorAmm","floorAmmGovV2"] },
|
|
121
|
+
{ name: "setNativeCreateFee", signature: "setNativeCreateFee(uint256)", selector: "0xa4433667", sources: ["floorAmm","floorAmmGovV2"] },
|
|
122
|
+
{ name: "setOgUser", signature: "setOgUser(address,uint256,bytes)", selector: "0x02cb4469", sources: ["floorAmmGovV2"] },
|
|
118
123
|
{ name: "setPresetEnabled", signature: "setPresetEnabled(uint8,bool)", selector: "0x673fb9a9", sources: ["floorAmm"] },
|
|
119
|
-
{ name: "setPriceUpdater", signature: "setPriceUpdater(address)", selector: "0x97c4a5f3", sources: ["floorAmm"] },
|
|
120
|
-
{ name: "setQuoteCap", signature: "setQuoteCap(address,uint128)", selector: "0x42adf398", sources: ["floorAmm"] },
|
|
121
|
-
{ name: "setQuotePrice", signature: "setQuotePrice(address,uint256)", selector: "0x3857ed9e", sources: ["floorAmm"] },
|
|
122
|
-
{ name: "setReferralAuthority", signature: "setReferralAuthority(address)", selector: "0x46325d7a", sources: ["floorAmm"] },
|
|
123
|
-
{ name: "setTimelock", signature: "setTimelock(address)", selector: "0xbdacb303", sources: ["floorAmm"] },
|
|
124
|
-
{ name: "setTraderRef", signature: "setTraderRef(address,address[3],uint256,bytes,bytes)", selector: "0xd7426758", sources: ["floorAmm"] },
|
|
125
|
-
{ name: "setTreasury", signature: "setTreasury(address)", selector: "0xf0f44260", sources: ["floorAmm"] },
|
|
124
|
+
{ name: "setPriceUpdater", signature: "setPriceUpdater(address)", selector: "0x97c4a5f3", sources: ["floorAmm","floorAmmGovV2"] },
|
|
125
|
+
{ name: "setQuoteCap", signature: "setQuoteCap(address,uint128)", selector: "0x42adf398", sources: ["floorAmm","floorAmmGovV2"] },
|
|
126
|
+
{ name: "setQuotePrice", signature: "setQuotePrice(address,uint256)", selector: "0x3857ed9e", sources: ["floorAmm","floorAmmGovV2"] },
|
|
127
|
+
{ name: "setReferralAuthority", signature: "setReferralAuthority(address)", selector: "0x46325d7a", sources: ["floorAmm","floorAmmGovV2"] },
|
|
128
|
+
{ name: "setTimelock", signature: "setTimelock(address)", selector: "0xbdacb303", sources: ["floorAmm","floorAmmGovV2"] },
|
|
129
|
+
{ name: "setTraderRef", signature: "setTraderRef(address,address[3],uint256,bytes,bytes)", selector: "0xd7426758", sources: ["floorAmm","floorAmmGovV2"] },
|
|
130
|
+
{ name: "setTreasury", signature: "setTreasury(address)", selector: "0xf0f44260", sources: ["floorAmm","floorAmmGovV2"] },
|
|
126
131
|
{ name: "simBuy", signature: "simBuy(uint256,uint256,address)", selector: "0xf69acbed", sources: ["floorAmmV2"] },
|
|
127
132
|
{ name: "simSell", signature: "simSell(uint256,uint256,address)", selector: "0xd3536ecd", sources: ["floorAmmV2"] },
|
|
128
133
|
{ name: "symbol", signature: "symbol()", selector: "0x95d89b41", sources: ["floorToken","floorTokenIndexed"] },
|
|
@@ -132,19 +137,19 @@ export const EVM_FUNCTION_SELECTORS: readonly EvmFunctionSelectorRow[] = [
|
|
|
132
137
|
{ name: "teamShareOf", signature: "teamShareOf(uint256,address)", selector: "0xb2280af2", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
133
138
|
{ name: "teamSlotAdd", signature: "teamSlotAdd(uint256,bytes32,uint8,uint256,bool)", selector: "0xd5402e81", sources: ["floorAmm","floorAmmClaimsV2"] },
|
|
134
139
|
{ name: "teamSlotOf", signature: "teamSlotOf(uint256)", selector: "0x8744aded", sources: ["floorAmmViewsV2"] },
|
|
135
|
-
{ name: "timelock", signature: "timelock()", selector: "0xd33219b4", sources: ["floorAmm"] },
|
|
140
|
+
{ name: "timelock", signature: "timelock()", selector: "0xd33219b4", sources: ["floorAmm","floorAmmGovV2"] },
|
|
136
141
|
{ name: "TOKEN_SCALE", signature: "TOKEN_SCALE()", selector: "0xcae07d2a", sources: ["floorTokenIndexed"] },
|
|
137
142
|
{ name: "tokenImplV2", signature: "tokenImplV2()", selector: "0x01b9b386", sources: ["floorAmmCreateV2"] },
|
|
138
143
|
{ name: "TOTAL_SUPPLY", signature: "TOTAL_SUPPLY()", selector: "0x902d55a5", sources: ["floorTokenIndexed"] },
|
|
139
144
|
{ name: "totalSupply", signature: "totalSupply()", selector: "0x18160ddd", sources: ["floorToken","floorTokenIndexed"] },
|
|
140
145
|
{ name: "traderRef", signature: "traderRef(address)", selector: "0xcfc18291", sources: ["floorAmm","floorAmmViewsV2"] },
|
|
141
146
|
{ name: "transfer", signature: "transfer(address,uint256)", selector: "0xa9059cbb", sources: ["floorToken","floorTokenIndexed"] },
|
|
142
|
-
{ name: "transferAuthority", signature: "transferAuthority(address)", selector: "0x3078db6c", sources: ["floorAmm"] },
|
|
147
|
+
{ name: "transferAuthority", signature: "transferAuthority(address)", selector: "0x3078db6c", sources: ["floorAmm","floorAmmGovV2"] },
|
|
143
148
|
{ name: "transferFrom", signature: "transferFrom(address,address,uint256)", selector: "0x23b872dd", sources: ["floorToken","floorTokenIndexed"] },
|
|
144
|
-
{ name: "treasury", signature: "treasury()", selector: "0x61d027b3", sources: ["floorAmm"] },
|
|
149
|
+
{ name: "treasury", signature: "treasury()", selector: "0x61d027b3", sources: ["floorAmm","floorAmmGovV2"] },
|
|
145
150
|
{ name: "unlockCreatorBuy", signature: "unlockCreatorBuy(uint256)", selector: "0xf03d6d5e", sources: ["floorAmm","floorAmmClaimsV2"] },
|
|
146
151
|
{ name: "updatePreset", signature: "updatePreset(uint8,bytes)", selector: "0x005d9e72", sources: ["floorAmm"] },
|
|
147
|
-
{ name: "updateQuote", signature: "updateQuote(address,bool,uint256,uint256)", selector: "0x21593d6e", sources: ["floorAmm"] },
|
|
152
|
+
{ name: "updateQuote", signature: "updateQuote(address,bool,uint256,uint256)", selector: "0x21593d6e", sources: ["floorAmm","floorAmmGovV2"] },
|
|
148
153
|
{ name: "UPGRADE_INTERFACE_VERSION", signature: "UPGRADE_INTERFACE_VERSION()", selector: "0xad3cb1cc", sources: ["floorAmmV2"] },
|
|
149
154
|
{ name: "upgradeToAndCall", signature: "upgradeToAndCall(address,bytes)", selector: "0x4f1ef286", sources: ["floorAmmV2"] },
|
|
150
155
|
{ name: "withdrawHolder", signature: "withdrawHolder(address,uint256)", selector: "0xfb90c8bf", sources: ["floorAmm","floorAmmCreateV2"] },
|
package/src/index.ts
CHANGED
|
@@ -87,6 +87,7 @@ export * as abi from "./abi/index.ts";
|
|
|
87
87
|
export * as v2Press from "./v2/press.ts";
|
|
88
88
|
export * as v2ReceiptTx from "./v2/receipt-tx.ts";
|
|
89
89
|
export * as config from "./config/index.ts";
|
|
90
|
+
export * as ton from "./ton/index.ts";
|
|
90
91
|
export * as fixtures from "./fixtures.ts";
|
|
91
92
|
export * as client from "./client/index.ts";
|
|
92
93
|
export * as errors from "./errors.ts";
|