@logswap/sdk 0.5.69 → 0.5.71
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/dist/admin.d.ts +11 -7
- package/dist/admin.js +16 -8
- package/dist/client.d.ts +1 -1
- package/dist/client.js +3 -1
- package/dist/fpool.d.ts +36 -95
- package/dist/fpool.js +52 -20
- package/dist/generated.d.ts +110 -349
- package/dist/generated.js +83 -240
- package/package.json +1 -1
- package/src/admin.ts +25 -10
- package/src/client.ts +3 -1
- package/src/fpool.ts +69 -27
- package/src/generated.ts +83 -240
package/src/fpool.ts
CHANGED
|
@@ -42,8 +42,8 @@ import { fPoolManagerAbi, logswapRouterAbi, padPolicyAbi, polPolicyAbi, policyRe
|
|
|
42
42
|
*/
|
|
43
43
|
export { fPoolManagerAbi, padPolicyAbi, polPolicyAbi, privatePolicyAbi, publicPolicyAbi };
|
|
44
44
|
/**
|
|
45
|
-
* What every protocol policy shares (`FPolicyBase`): the roles and their handover
|
|
46
|
-
* `maxHarvest
|
|
45
|
+
* What every protocol policy shares (`FPolicyBase`): the roles and their handover and the
|
|
46
|
+
* `maxHarvest` readout (a harvest has no cut, decisions 056). `polPolicyAbi` is a superset of it and carries nothing that collides, so it stands
|
|
47
47
|
* in for the base — a call through it to any of the four policies decodes the base's functions.
|
|
48
48
|
*/
|
|
49
49
|
export const fPolicyBaseAbi = polPolicyAbi;
|
|
@@ -1079,7 +1079,7 @@ export async function fPoolIdOf(c: LogswapClient, a: Omit<FPoolCreateArgs, "acco
|
|
|
1079
1079
|
/**
|
|
1080
1080
|
* Rebuild a live pool's KEY from its id: the `FInitialize` log carries every field but the salt,
|
|
1081
1081
|
* which is taken from `opts.salt` (zero by default — every pool the SDK's create flow makes
|
|
1082
|
-
* without naming one). The result is checked against the id, so a wrong salt throws rather than
|
|
1082
|
+
* without naming one; a pad's carries its split, so it is rebuilt from the policy's record with nonce 0 — pass `opts.salt` for another nonce). The result is checked against the id, so a wrong salt throws rather than
|
|
1083
1083
|
* returning a key that names another pool. What {@link fPoolMigrate} needs when handed an id.
|
|
1084
1084
|
*/
|
|
1085
1085
|
export async function fPoolKeyOfPool(c: LogswapClient, poolId: Hex, opts: { salt?: Hex; fromBlock?: bigint } = {}): Promise<FPoolKey> {
|
|
@@ -1104,6 +1104,16 @@ export async function fPoolKeyOfPool(c: LogswapClient, poolId: Hex, opts: { salt
|
|
|
1104
1104
|
creator: a.creator,
|
|
1105
1105
|
salt: opts.salt ?? ZERO_SALT,
|
|
1106
1106
|
};
|
|
1107
|
+
if (fPoolIdOfKey(key).toLowerCase() !== poolId.toLowerCase() && opts.salt === undefined) {
|
|
1108
|
+
// a pad's salt carries its split (decisions 056): rebuild it from the policy's record with the default nonce
|
|
1109
|
+
try {
|
|
1110
|
+
const [creatorShare, burnPerRung] = (await c.public.readContract({ address: a.policy, abi: padPolicyAbi, functionName: "splitOf", args: [poolId] } as never)) as readonly [bigint, bigint, bigint];
|
|
1111
|
+
const padKey = { ...key, salt: padSalt({ creatorShare, burnPerRung }) };
|
|
1112
|
+
if (fPoolIdOfKey(padKey).toLowerCase() === poolId.toLowerCase()) return padKey;
|
|
1113
|
+
} catch {
|
|
1114
|
+
/* not a pad: fall through to the error */
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1107
1117
|
if (fPoolIdOfKey(key).toLowerCase() !== poolId.toLowerCase()) {
|
|
1108
1118
|
throw new Error(`logswap: F pool ${poolId} was not born with salt ${key.salt} — pass its salt, or its whole key`);
|
|
1109
1119
|
}
|
|
@@ -1785,7 +1795,6 @@ export interface FPoolControlled {
|
|
|
1785
1795
|
export type FPoolRules =
|
|
1786
1796
|
| {
|
|
1787
1797
|
kind: "pad";
|
|
1788
|
-
harvestCut: bigint;
|
|
1789
1798
|
/** The pad's graduation count: the pool's generation (F version 21 — `PadPolicy.rung` is gone). */
|
|
1790
1799
|
gen: number;
|
|
1791
1800
|
/** @deprecated Equal to {@link gen} since F version 21, kept for callers; read `gen`. */
|
|
@@ -1793,43 +1802,81 @@ export type FPoolRules =
|
|
|
1793
1802
|
/** The pot the next graduation needs: `PadPolicy.threshold(gen)`. */
|
|
1794
1803
|
threshold: bigint;
|
|
1795
1804
|
pot: bigint;
|
|
1805
|
+
/** This pad's split, recorded at its birth from the key's salt and never changed (decisions 056): the creator's cut of the pot, the protocol's, and the burn per rung. The rest of the pot is bought in. */
|
|
1796
1806
|
creatorShare: bigint;
|
|
1797
1807
|
protocolShare: bigint;
|
|
1798
1808
|
burnPerRung: bigint;
|
|
1809
|
+
/** The ranges the collector's policy holds NOW for the pads born after this read: what a new creator may choose. */
|
|
1810
|
+
ranges: PadRanges;
|
|
1799
1811
|
}
|
|
1800
|
-
| { kind: "pol";
|
|
1801
|
-
| { kind: "public";
|
|
1802
|
-
| { kind: "private";
|
|
1812
|
+
| { kind: "pol"; keepQuote: bigint; minQuoteAtSeed: bigint }
|
|
1813
|
+
| { kind: "public"; curated: boolean }
|
|
1814
|
+
| { kind: "private"; gateMint: boolean; gateSwap: boolean; operator: Address };
|
|
1815
|
+
|
|
1816
|
+
/** The collector's ranges on a pad's creator choices (`PadPolicy`, decisions 056), WAD fractions: of the pot, and of every reserve per rung. */
|
|
1817
|
+
export interface PadRanges {
|
|
1818
|
+
/** The protocol's share of the pot, recorded into each pad at birth. */
|
|
1819
|
+
protocolShare: bigint;
|
|
1820
|
+
creatorShareMin: bigint;
|
|
1821
|
+
creatorShareMax: bigint;
|
|
1822
|
+
burnMin: bigint;
|
|
1823
|
+
burnMax: bigint;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
const MAX_U64 = (1n << 64n) - 1n;
|
|
1827
|
+
const MAX_U128 = (1n << 128n) - 1n;
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* The salt that carries a pad's split (`PadPolicy.pack`, decisions 056): `creatorShare` in the top 64 bits, `burnPerRung` in
|
|
1831
|
+
* the next 64 (WAD fractions), a nonce in the low 128 that tells two otherwise identical pads apart. It is part of the pool's
|
|
1832
|
+
* identity, so it is chosen at launch (`FPoolLaunchArgs.salt`) and never changes; the policy refuses a split outside its ranges.
|
|
1833
|
+
*/
|
|
1834
|
+
export function padSalt(s: { creatorShare: bigint; burnPerRung: bigint; nonce?: bigint }): Hex {
|
|
1835
|
+
const nonce = s.nonce ?? 0n;
|
|
1836
|
+
if (s.creatorShare < 0n || s.creatorShare > MAX_U64 || s.burnPerRung < 0n || s.burnPerRung > MAX_U64) throw new Error("logswap: a pad's split is a WAD fraction that fits 64 bits");
|
|
1837
|
+
if (nonce < 0n || nonce > MAX_U128) throw new Error("logswap: a pad salt's nonce fits 128 bits");
|
|
1838
|
+
return `0x${((s.creatorShare << 192n) | (s.burnPerRung << 128n) | nonce).toString(16).padStart(64, "0")}` as Hex;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
/** The inverse of {@link padSalt}. */
|
|
1842
|
+
export function padSplitOfSalt(salt: Hex): { creatorShare: bigint; burnPerRung: bigint; nonce: bigint } {
|
|
1843
|
+
const v = BigInt(salt);
|
|
1844
|
+
return { creatorShare: v >> 192n, burnPerRung: (v >> 128n) & MAX_U64, nonce: v & MAX_U128 };
|
|
1845
|
+
}
|
|
1803
1846
|
|
|
1804
1847
|
/** The policy's terms for one pool, by its kind. */
|
|
1805
1848
|
export async function getFPoolRules(c: LogswapClient, s: Pick<FPoolState, "poolId" | "policy" | "kind" | "gen">, roles?: FPoolRoles): Promise<FPoolRules> {
|
|
1806
1849
|
const rd = <T>(abi: readonly unknown[], functionName: string, args: readonly unknown[] = []) =>
|
|
1807
1850
|
c.public.readContract({ address: s.policy, abi, functionName, args } as never) as Promise<T>;
|
|
1808
|
-
const harvestCut = await rd<bigint>(fPolicyBaseAbi, "harvestCut");
|
|
1809
1851
|
switch (s.kind) {
|
|
1810
1852
|
case "pad": {
|
|
1811
1853
|
// the rung is the manager's generation (F version 21): a move carries it, nothing to ask the policy
|
|
1812
1854
|
const gen = s.gen;
|
|
1813
|
-
const [
|
|
1814
|
-
rd<bigint>(padPolicyAbi, "
|
|
1815
|
-
rd<bigint>(padPolicyAbi, "protocolShare"),
|
|
1816
|
-
rd<bigint>(padPolicyAbi, "burnPerRung"),
|
|
1855
|
+
const [split, pot, threshold, protocolNow, creatorShareMin, creatorShareMax, burnMin, burnMax] = await Promise.all([
|
|
1856
|
+
rd<readonly [bigint, bigint, bigint]>(padPolicyAbi, "splitOf", [s.poolId]),
|
|
1817
1857
|
fPoolDividendOf(c, s.poolId, DEAD_ADDRESS, gen),
|
|
1818
1858
|
rd<bigint>(padPolicyAbi, "threshold", [BigInt(gen)]),
|
|
1859
|
+
rd<bigint>(padPolicyAbi, "protocolShare"),
|
|
1860
|
+
rd<bigint>(padPolicyAbi, "creatorShareMin"),
|
|
1861
|
+
rd<bigint>(padPolicyAbi, "creatorShareMax"),
|
|
1862
|
+
rd<bigint>(padPolicyAbi, "burnMin"),
|
|
1863
|
+
rd<bigint>(padPolicyAbi, "burnMax"),
|
|
1819
1864
|
]);
|
|
1820
|
-
|
|
1865
|
+
const [creatorShare, burnPerRung, protocolShare] = split;
|
|
1866
|
+
const ranges: PadRanges = { protocolShare: protocolNow, creatorShareMin, creatorShareMax, burnMin, burnMax };
|
|
1867
|
+
return { kind: "pad", gen, rung: gen, threshold, pot, creatorShare, protocolShare, burnPerRung, ranges };
|
|
1821
1868
|
}
|
|
1822
1869
|
case "pol": {
|
|
1823
1870
|
const [keepQuote, minQuoteAtSeed] = await Promise.all([rd<bigint>(polPolicyAbi, "keepQuote"), rd<bigint>(polPolicyAbi, "minQuoteAtSeed")]);
|
|
1824
|
-
return { kind: "pol",
|
|
1871
|
+
return { kind: "pol", keepQuote, minQuoteAtSeed };
|
|
1825
1872
|
}
|
|
1826
1873
|
case "public": {
|
|
1827
1874
|
const curated = await rd<boolean>(publicPolicyAbi, "curated");
|
|
1828
|
-
return { kind: "public",
|
|
1875
|
+
return { kind: "public", curated };
|
|
1829
1876
|
}
|
|
1830
1877
|
case "private": {
|
|
1831
1878
|
const r = roles ?? (await getFPoolRoles(c, s.poolId, s));
|
|
1832
|
-
return { kind: "private",
|
|
1879
|
+
return { kind: "private", gateMint: r.gateMint, gateSwap: r.gateSwap, operator: fPoolOperatorOf(r) };
|
|
1833
1880
|
}
|
|
1834
1881
|
}
|
|
1835
1882
|
}
|
|
@@ -1867,24 +1914,20 @@ export async function fPoolsControlledBy(
|
|
|
1867
1914
|
/**
|
|
1868
1915
|
* Every holder of a pool's shares, from the ERC-6909 Transfer stream — the id is an indexed
|
|
1869
1916
|
* topic, so one filtered log query aggregates the whole ledger. The 0xdead entry is the
|
|
1870
|
-
* MIN_SHARES lock from seeding; callers usually label rather than hide it.
|
|
1917
|
+
* MIN_SHARES lock from seeding; callers usually label rather than hide it. Pass `indexer`: a node
|
|
1918
|
+
* prunes its logs (anvil keeps about a day), and a ledger rebuilt from a pruned stream loses every
|
|
1919
|
+
* holder minted before the cut.
|
|
1871
1920
|
*/
|
|
1872
1921
|
export async function fPoolShareHolders(
|
|
1873
1922
|
c: LogswapClient,
|
|
1874
1923
|
poolIdHex: Hex,
|
|
1875
|
-
opts: { fromBlock?: bigint; gen?: bigint | number } = {},
|
|
1924
|
+
opts: { fromBlock?: bigint; gen?: bigint | number; indexer?: string } = {},
|
|
1876
1925
|
): Promise<Array<{ holder: Address; shares: bigint }>> {
|
|
1877
1926
|
type Ev = Extract<(typeof fPoolManagerAbi)[number], { type: "event"; name: "Transfer" }>;
|
|
1878
1927
|
const ev = fPoolManagerAbi.find((x): x is Ev => x.type === "event" && x.name === "Transfer");
|
|
1879
1928
|
if (!ev) throw new Error("logswap: 6909 Transfer event missing from the generated ABI");
|
|
1880
1929
|
const id = fPoolShareId(poolIdHex, opts.gen ?? (await fPoolGen(c, poolIdHex)));
|
|
1881
|
-
const logs = await c.
|
|
1882
|
-
address: c.addresses.fPoolManager!,
|
|
1883
|
-
event: ev,
|
|
1884
|
-
args: { id },
|
|
1885
|
-
fromBlock: opts.fromBlock ?? 0n,
|
|
1886
|
-
toBlock: "latest",
|
|
1887
|
-
});
|
|
1930
|
+
const { logs } = await getEventLogs(c, { indexer: opts.indexer, address: c.addresses.fPoolManager!, event: ev, args: { id }, fromBlock: opts.fromBlock });
|
|
1888
1931
|
const bal = new Map<string, bigint>();
|
|
1889
1932
|
for (const l of logs) {
|
|
1890
1933
|
const a = l.args as { from: Address; to: Address; amount: bigint };
|
|
@@ -1898,8 +1941,7 @@ export async function fPoolShareHolders(
|
|
|
1898
1941
|
}
|
|
1899
1942
|
|
|
1900
1943
|
/**
|
|
1901
|
-
* What a policy answers `onRegenerate` with
|
|
1902
|
-
* `IFPolicy.Terms`. `carried` is F version 21's fifth word — the holder the next generation
|
|
1944
|
+
* What a policy answers `onRegenerate` with: `IFPolicy.Terms`. `carried` is F version 21's fifth word — the holder the next generation
|
|
1903
1945
|
* carries beside the dead shares; the reply is exactly 160 bytes.
|
|
1904
1946
|
*/
|
|
1905
1947
|
export interface FPolicyTerms {
|
package/src/generated.ts
CHANGED
|
@@ -1100,13 +1100,6 @@ export const fPoolManagerAbi = [
|
|
|
1100
1100
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1101
1101
|
stateMutability: 'view',
|
|
1102
1102
|
},
|
|
1103
|
-
{
|
|
1104
|
-
type: 'function',
|
|
1105
|
-
inputs: [],
|
|
1106
|
-
name: 'HARVEST_CUT_MAX',
|
|
1107
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1108
|
-
stateMutability: 'view',
|
|
1109
|
-
},
|
|
1110
1103
|
{
|
|
1111
1104
|
type: 'function',
|
|
1112
1105
|
inputs: [],
|
|
@@ -3713,7 +3706,14 @@ export const padPolicyAbi = [
|
|
|
3713
3706
|
{
|
|
3714
3707
|
type: 'function',
|
|
3715
3708
|
inputs: [],
|
|
3716
|
-
name: '
|
|
3709
|
+
name: 'burnMax',
|
|
3710
|
+
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
3711
|
+
stateMutability: 'view',
|
|
3712
|
+
},
|
|
3713
|
+
{
|
|
3714
|
+
type: 'function',
|
|
3715
|
+
inputs: [],
|
|
3716
|
+
name: 'burnMin',
|
|
3717
3717
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
3718
3718
|
stateMutability: 'view',
|
|
3719
3719
|
},
|
|
@@ -3727,14 +3727,14 @@ export const padPolicyAbi = [
|
|
|
3727
3727
|
{
|
|
3728
3728
|
type: 'function',
|
|
3729
3729
|
inputs: [],
|
|
3730
|
-
name: '
|
|
3730
|
+
name: 'creatorShareMax',
|
|
3731
3731
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
3732
3732
|
stateMutability: 'view',
|
|
3733
3733
|
},
|
|
3734
3734
|
{
|
|
3735
3735
|
type: 'function',
|
|
3736
3736
|
inputs: [],
|
|
3737
|
-
name: '
|
|
3737
|
+
name: 'creatorShareMin',
|
|
3738
3738
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
3739
3739
|
stateMutability: 'view',
|
|
3740
3740
|
},
|
|
@@ -3796,37 +3796,6 @@ export const padPolicyAbi = [
|
|
|
3796
3796
|
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
3797
3797
|
stateMutability: 'view',
|
|
3798
3798
|
},
|
|
3799
|
-
{
|
|
3800
|
-
type: 'function',
|
|
3801
|
-
inputs: [
|
|
3802
|
-
{
|
|
3803
|
-
name: 'a',
|
|
3804
|
-
internalType: 'struct IFPolicy.Ask',
|
|
3805
|
-
type: 'tuple',
|
|
3806
|
-
components: [
|
|
3807
|
-
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
3808
|
-
{ name: 'gen', internalType: 'uint256', type: 'uint256' },
|
|
3809
|
-
{
|
|
3810
|
-
name: 'action',
|
|
3811
|
-
internalType: 'enum IFPolicy.Action',
|
|
3812
|
-
type: 'uint8',
|
|
3813
|
-
},
|
|
3814
|
-
{ name: 'who', internalType: 'address', type: 'address' },
|
|
3815
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
3816
|
-
{ name: 'income', internalType: 'uint256', type: 'uint256' },
|
|
3817
|
-
{ name: 'Q', internalType: 'uint256', type: 'uint256' },
|
|
3818
|
-
{ name: 'L', internalType: 'uint256', type: 'uint256' },
|
|
3819
|
-
{ name: 'n', internalType: 'uint256', type: 'uint256' },
|
|
3820
|
-
],
|
|
3821
|
-
},
|
|
3822
|
-
],
|
|
3823
|
-
name: 'onHarvest',
|
|
3824
|
-
outputs: [
|
|
3825
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
3826
|
-
{ name: 'cut', internalType: 'uint256', type: 'uint256' },
|
|
3827
|
-
],
|
|
3828
|
-
stateMutability: 'view',
|
|
3829
|
-
},
|
|
3830
3799
|
{
|
|
3831
3800
|
type: 'function',
|
|
3832
3801
|
inputs: [
|
|
@@ -3904,6 +3873,17 @@ export const padPolicyAbi = [
|
|
|
3904
3873
|
],
|
|
3905
3874
|
stateMutability: 'nonpayable',
|
|
3906
3875
|
},
|
|
3876
|
+
{
|
|
3877
|
+
type: 'function',
|
|
3878
|
+
inputs: [
|
|
3879
|
+
{ name: 'creatorShare', internalType: 'uint256', type: 'uint256' },
|
|
3880
|
+
{ name: 'burnPerRung', internalType: 'uint256', type: 'uint256' },
|
|
3881
|
+
{ name: 'nonce', internalType: 'uint128', type: 'uint128' },
|
|
3882
|
+
],
|
|
3883
|
+
name: 'pack',
|
|
3884
|
+
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
3885
|
+
stateMutability: 'pure',
|
|
3886
|
+
},
|
|
3907
3887
|
{
|
|
3908
3888
|
type: 'function',
|
|
3909
3889
|
inputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
@@ -3942,13 +3922,6 @@ export const padPolicyAbi = [
|
|
|
3942
3922
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
3943
3923
|
stateMutability: 'view',
|
|
3944
3924
|
},
|
|
3945
|
-
{
|
|
3946
|
-
type: 'function',
|
|
3947
|
-
inputs: [{ name: '_harvestCut', internalType: 'uint256', type: 'uint256' }],
|
|
3948
|
-
name: 'setHarvestCut',
|
|
3949
|
-
outputs: [],
|
|
3950
|
-
stateMutability: 'nonpayable',
|
|
3951
|
-
},
|
|
3952
3925
|
{
|
|
3953
3926
|
type: 'function',
|
|
3954
3927
|
inputs: [
|
|
@@ -3981,14 +3954,27 @@ export const padPolicyAbi = [
|
|
|
3981
3954
|
inputs: [
|
|
3982
3955
|
{ name: '_thresholdBase', internalType: 'uint256', type: 'uint256' },
|
|
3983
3956
|
{ name: '_thresholdGrowth', internalType: 'uint256', type: 'uint256' },
|
|
3984
|
-
{ name: '_creatorShare', internalType: 'uint256', type: 'uint256' },
|
|
3985
3957
|
{ name: '_protocolShare', internalType: 'uint256', type: 'uint256' },
|
|
3986
|
-
{ name: '
|
|
3958
|
+
{ name: '_creatorShareMin', internalType: 'uint256', type: 'uint256' },
|
|
3959
|
+
{ name: '_creatorShareMax', internalType: 'uint256', type: 'uint256' },
|
|
3960
|
+
{ name: '_burnMin', internalType: 'uint256', type: 'uint256' },
|
|
3961
|
+
{ name: '_burnMax', internalType: 'uint256', type: 'uint256' },
|
|
3987
3962
|
],
|
|
3988
3963
|
name: 'setSchedule',
|
|
3989
3964
|
outputs: [],
|
|
3990
3965
|
stateMutability: 'nonpayable',
|
|
3991
3966
|
},
|
|
3967
|
+
{
|
|
3968
|
+
type: 'function',
|
|
3969
|
+
inputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
3970
|
+
name: 'splitOf',
|
|
3971
|
+
outputs: [
|
|
3972
|
+
{ name: 'creatorShare', internalType: 'uint64', type: 'uint64' },
|
|
3973
|
+
{ name: 'burnPerRung', internalType: 'uint64', type: 'uint64' },
|
|
3974
|
+
{ name: 'protocolShare', internalType: 'uint64', type: 'uint64' },
|
|
3975
|
+
],
|
|
3976
|
+
stateMutability: 'view',
|
|
3977
|
+
},
|
|
3992
3978
|
{
|
|
3993
3979
|
type: 'function',
|
|
3994
3980
|
inputs: [{ name: 'r', internalType: 'uint256', type: 'uint256' }],
|
|
@@ -4065,19 +4051,6 @@ export const padPolicyAbi = [
|
|
|
4065
4051
|
],
|
|
4066
4052
|
name: 'Graduated',
|
|
4067
4053
|
},
|
|
4068
|
-
{
|
|
4069
|
-
type: 'event',
|
|
4070
|
-
anonymous: false,
|
|
4071
|
-
inputs: [
|
|
4072
|
-
{
|
|
4073
|
-
name: 'harvestCut',
|
|
4074
|
-
internalType: 'uint256',
|
|
4075
|
-
type: 'uint256',
|
|
4076
|
-
indexed: false,
|
|
4077
|
-
},
|
|
4078
|
-
],
|
|
4079
|
-
name: 'HarvestCutSet',
|
|
4080
|
-
},
|
|
4081
4054
|
{
|
|
4082
4055
|
type: 'event',
|
|
4083
4056
|
anonymous: false,
|
|
@@ -4136,19 +4109,31 @@ export const padPolicyAbi = [
|
|
|
4136
4109
|
indexed: false,
|
|
4137
4110
|
},
|
|
4138
4111
|
{
|
|
4139
|
-
name: '
|
|
4112
|
+
name: 'protocolShare',
|
|
4140
4113
|
internalType: 'uint256',
|
|
4141
4114
|
type: 'uint256',
|
|
4142
4115
|
indexed: false,
|
|
4143
4116
|
},
|
|
4144
4117
|
{
|
|
4145
|
-
name: '
|
|
4118
|
+
name: 'creatorShareMin',
|
|
4146
4119
|
internalType: 'uint256',
|
|
4147
4120
|
type: 'uint256',
|
|
4148
4121
|
indexed: false,
|
|
4149
4122
|
},
|
|
4150
4123
|
{
|
|
4151
|
-
name: '
|
|
4124
|
+
name: 'creatorShareMax',
|
|
4125
|
+
internalType: 'uint256',
|
|
4126
|
+
type: 'uint256',
|
|
4127
|
+
indexed: false,
|
|
4128
|
+
},
|
|
4129
|
+
{
|
|
4130
|
+
name: 'burnMin',
|
|
4131
|
+
internalType: 'uint256',
|
|
4132
|
+
type: 'uint256',
|
|
4133
|
+
indexed: false,
|
|
4134
|
+
},
|
|
4135
|
+
{
|
|
4136
|
+
name: 'burnMax',
|
|
4152
4137
|
internalType: 'uint256',
|
|
4153
4138
|
type: 'uint256',
|
|
4154
4139
|
indexed: false,
|
|
@@ -4156,6 +4141,37 @@ export const padPolicyAbi = [
|
|
|
4156
4141
|
],
|
|
4157
4142
|
name: 'ScheduleSet',
|
|
4158
4143
|
},
|
|
4144
|
+
{
|
|
4145
|
+
type: 'event',
|
|
4146
|
+
anonymous: false,
|
|
4147
|
+
inputs: [
|
|
4148
|
+
{
|
|
4149
|
+
name: 'poolId',
|
|
4150
|
+
internalType: 'bytes32',
|
|
4151
|
+
type: 'bytes32',
|
|
4152
|
+
indexed: true,
|
|
4153
|
+
},
|
|
4154
|
+
{
|
|
4155
|
+
name: 'creatorShare',
|
|
4156
|
+
internalType: 'uint256',
|
|
4157
|
+
type: 'uint256',
|
|
4158
|
+
indexed: false,
|
|
4159
|
+
},
|
|
4160
|
+
{
|
|
4161
|
+
name: 'burnPerRung',
|
|
4162
|
+
internalType: 'uint256',
|
|
4163
|
+
type: 'uint256',
|
|
4164
|
+
indexed: false,
|
|
4165
|
+
},
|
|
4166
|
+
{
|
|
4167
|
+
name: 'protocolShare',
|
|
4168
|
+
internalType: 'uint256',
|
|
4169
|
+
type: 'uint256',
|
|
4170
|
+
indexed: false,
|
|
4171
|
+
},
|
|
4172
|
+
],
|
|
4173
|
+
name: 'SplitSet',
|
|
4174
|
+
},
|
|
4159
4175
|
{ type: 'error', inputs: [], name: 'BadFee' },
|
|
4160
4176
|
{ type: 'error', inputs: [], name: 'BadRate' },
|
|
4161
4177
|
{ type: 'error', inputs: [], name: 'NoCreator' },
|
|
@@ -4165,6 +4181,7 @@ export const padPolicyAbi = [
|
|
|
4165
4181
|
{ type: 'error', inputs: [], name: 'NotManager' },
|
|
4166
4182
|
{ type: 'error', inputs: [], name: 'NotRegistry' },
|
|
4167
4183
|
{ type: 'error', inputs: [], name: 'OneBase' },
|
|
4184
|
+
{ type: 'error', inputs: [], name: 'OutOfRange' },
|
|
4168
4185
|
{
|
|
4169
4186
|
type: 'error',
|
|
4170
4187
|
inputs: [{ name: 'quote', internalType: 'address', type: 'address' }],
|
|
@@ -4210,13 +4227,6 @@ export const polPolicyAbi = [
|
|
|
4210
4227
|
outputs: [{ name: '', internalType: 'address', type: 'address' }],
|
|
4211
4228
|
stateMutability: 'view',
|
|
4212
4229
|
},
|
|
4213
|
-
{
|
|
4214
|
-
type: 'function',
|
|
4215
|
-
inputs: [],
|
|
4216
|
-
name: 'harvestCut',
|
|
4217
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
4218
|
-
stateMutability: 'view',
|
|
4219
|
-
},
|
|
4220
4230
|
{
|
|
4221
4231
|
type: 'function',
|
|
4222
4232
|
inputs: [],
|
|
@@ -4289,37 +4299,6 @@ export const polPolicyAbi = [
|
|
|
4289
4299
|
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
4290
4300
|
stateMutability: 'view',
|
|
4291
4301
|
},
|
|
4292
|
-
{
|
|
4293
|
-
type: 'function',
|
|
4294
|
-
inputs: [
|
|
4295
|
-
{
|
|
4296
|
-
name: 'a',
|
|
4297
|
-
internalType: 'struct IFPolicy.Ask',
|
|
4298
|
-
type: 'tuple',
|
|
4299
|
-
components: [
|
|
4300
|
-
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
4301
|
-
{ name: 'gen', internalType: 'uint256', type: 'uint256' },
|
|
4302
|
-
{
|
|
4303
|
-
name: 'action',
|
|
4304
|
-
internalType: 'enum IFPolicy.Action',
|
|
4305
|
-
type: 'uint8',
|
|
4306
|
-
},
|
|
4307
|
-
{ name: 'who', internalType: 'address', type: 'address' },
|
|
4308
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
4309
|
-
{ name: 'income', internalType: 'uint256', type: 'uint256' },
|
|
4310
|
-
{ name: 'Q', internalType: 'uint256', type: 'uint256' },
|
|
4311
|
-
{ name: 'L', internalType: 'uint256', type: 'uint256' },
|
|
4312
|
-
{ name: 'n', internalType: 'uint256', type: 'uint256' },
|
|
4313
|
-
],
|
|
4314
|
-
},
|
|
4315
|
-
],
|
|
4316
|
-
name: 'onHarvest',
|
|
4317
|
-
outputs: [
|
|
4318
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
4319
|
-
{ name: 'cut', internalType: 'uint256', type: 'uint256' },
|
|
4320
|
-
],
|
|
4321
|
-
stateMutability: 'view',
|
|
4322
|
-
},
|
|
4323
4302
|
{
|
|
4324
4303
|
type: 'function',
|
|
4325
4304
|
inputs: [
|
|
@@ -4428,13 +4407,6 @@ export const polPolicyAbi = [
|
|
|
4428
4407
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
4429
4408
|
stateMutability: 'view',
|
|
4430
4409
|
},
|
|
4431
|
-
{
|
|
4432
|
-
type: 'function',
|
|
4433
|
-
inputs: [{ name: '_harvestCut', internalType: 'uint256', type: 'uint256' }],
|
|
4434
|
-
name: 'setHarvestCut',
|
|
4435
|
-
outputs: [],
|
|
4436
|
-
stateMutability: 'nonpayable',
|
|
4437
|
-
},
|
|
4438
4410
|
{
|
|
4439
4411
|
type: 'function',
|
|
4440
4412
|
inputs: [
|
|
@@ -4512,19 +4484,6 @@ export const polPolicyAbi = [
|
|
|
4512
4484
|
],
|
|
4513
4485
|
name: 'AuthoritySet',
|
|
4514
4486
|
},
|
|
4515
|
-
{
|
|
4516
|
-
type: 'event',
|
|
4517
|
-
anonymous: false,
|
|
4518
|
-
inputs: [
|
|
4519
|
-
{
|
|
4520
|
-
name: 'harvestCut',
|
|
4521
|
-
internalType: 'uint256',
|
|
4522
|
-
type: 'uint256',
|
|
4523
|
-
indexed: false,
|
|
4524
|
-
},
|
|
4525
|
-
],
|
|
4526
|
-
name: 'HarvestCutSet',
|
|
4527
|
-
},
|
|
4528
4487
|
{
|
|
4529
4488
|
type: 'event',
|
|
4530
4489
|
anonymous: false,
|
|
@@ -4958,13 +4917,6 @@ export const privatePolicyAbi = [
|
|
|
4958
4917
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
4959
4918
|
stateMutability: 'view',
|
|
4960
4919
|
},
|
|
4961
|
-
{
|
|
4962
|
-
type: 'function',
|
|
4963
|
-
inputs: [],
|
|
4964
|
-
name: 'harvestCut',
|
|
4965
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
4966
|
-
stateMutability: 'view',
|
|
4967
|
-
},
|
|
4968
4920
|
{
|
|
4969
4921
|
type: 'function',
|
|
4970
4922
|
inputs: [
|
|
@@ -5060,37 +5012,6 @@ export const privatePolicyAbi = [
|
|
|
5060
5012
|
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
5061
5013
|
stateMutability: 'view',
|
|
5062
5014
|
},
|
|
5063
|
-
{
|
|
5064
|
-
type: 'function',
|
|
5065
|
-
inputs: [
|
|
5066
|
-
{
|
|
5067
|
-
name: 'a',
|
|
5068
|
-
internalType: 'struct IFPolicy.Ask',
|
|
5069
|
-
type: 'tuple',
|
|
5070
|
-
components: [
|
|
5071
|
-
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
5072
|
-
{ name: 'gen', internalType: 'uint256', type: 'uint256' },
|
|
5073
|
-
{
|
|
5074
|
-
name: 'action',
|
|
5075
|
-
internalType: 'enum IFPolicy.Action',
|
|
5076
|
-
type: 'uint8',
|
|
5077
|
-
},
|
|
5078
|
-
{ name: 'who', internalType: 'address', type: 'address' },
|
|
5079
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
5080
|
-
{ name: 'income', internalType: 'uint256', type: 'uint256' },
|
|
5081
|
-
{ name: 'Q', internalType: 'uint256', type: 'uint256' },
|
|
5082
|
-
{ name: 'L', internalType: 'uint256', type: 'uint256' },
|
|
5083
|
-
{ name: 'n', internalType: 'uint256', type: 'uint256' },
|
|
5084
|
-
],
|
|
5085
|
-
},
|
|
5086
|
-
],
|
|
5087
|
-
name: 'onHarvest',
|
|
5088
|
-
outputs: [
|
|
5089
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
5090
|
-
{ name: 'cut', internalType: 'uint256', type: 'uint256' },
|
|
5091
|
-
],
|
|
5092
|
-
stateMutability: 'view',
|
|
5093
|
-
},
|
|
5094
5015
|
{
|
|
5095
5016
|
type: 'function',
|
|
5096
5017
|
inputs: [
|
|
@@ -5231,13 +5152,6 @@ export const privatePolicyAbi = [
|
|
|
5231
5152
|
outputs: [],
|
|
5232
5153
|
stateMutability: 'nonpayable',
|
|
5233
5154
|
},
|
|
5234
|
-
{
|
|
5235
|
-
type: 'function',
|
|
5236
|
-
inputs: [{ name: '_harvestCut', internalType: 'uint256', type: 'uint256' }],
|
|
5237
|
-
name: 'setHarvestCut',
|
|
5238
|
-
outputs: [],
|
|
5239
|
-
stateMutability: 'nonpayable',
|
|
5240
|
-
},
|
|
5241
5155
|
{
|
|
5242
5156
|
type: 'function',
|
|
5243
5157
|
inputs: [
|
|
@@ -5342,19 +5256,6 @@ export const privatePolicyAbi = [
|
|
|
5342
5256
|
],
|
|
5343
5257
|
name: 'GatesSet',
|
|
5344
5258
|
},
|
|
5345
|
-
{
|
|
5346
|
-
type: 'event',
|
|
5347
|
-
anonymous: false,
|
|
5348
|
-
inputs: [
|
|
5349
|
-
{
|
|
5350
|
-
name: 'harvestCut',
|
|
5351
|
-
internalType: 'uint256',
|
|
5352
|
-
type: 'uint256',
|
|
5353
|
-
indexed: false,
|
|
5354
|
-
},
|
|
5355
|
-
],
|
|
5356
|
-
name: 'HarvestCutSet',
|
|
5357
|
-
},
|
|
5358
5259
|
{
|
|
5359
5260
|
type: 'event',
|
|
5360
5261
|
anonymous: false,
|
|
@@ -5519,13 +5420,6 @@ export const publicPolicyAbi = [
|
|
|
5519
5420
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
5520
5421
|
stateMutability: 'view',
|
|
5521
5422
|
},
|
|
5522
|
-
{
|
|
5523
|
-
type: 'function',
|
|
5524
|
-
inputs: [],
|
|
5525
|
-
name: 'harvestCut',
|
|
5526
|
-
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
5527
|
-
stateMutability: 'view',
|
|
5528
|
-
},
|
|
5529
5423
|
{
|
|
5530
5424
|
type: 'function',
|
|
5531
5425
|
inputs: [],
|
|
@@ -5591,37 +5485,6 @@ export const publicPolicyAbi = [
|
|
|
5591
5485
|
outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
5592
5486
|
stateMutability: 'view',
|
|
5593
5487
|
},
|
|
5594
|
-
{
|
|
5595
|
-
type: 'function',
|
|
5596
|
-
inputs: [
|
|
5597
|
-
{
|
|
5598
|
-
name: 'a',
|
|
5599
|
-
internalType: 'struct IFPolicy.Ask',
|
|
5600
|
-
type: 'tuple',
|
|
5601
|
-
components: [
|
|
5602
|
-
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
5603
|
-
{ name: 'gen', internalType: 'uint256', type: 'uint256' },
|
|
5604
|
-
{
|
|
5605
|
-
name: 'action',
|
|
5606
|
-
internalType: 'enum IFPolicy.Action',
|
|
5607
|
-
type: 'uint8',
|
|
5608
|
-
},
|
|
5609
|
-
{ name: 'who', internalType: 'address', type: 'address' },
|
|
5610
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
5611
|
-
{ name: 'income', internalType: 'uint256', type: 'uint256' },
|
|
5612
|
-
{ name: 'Q', internalType: 'uint256', type: 'uint256' },
|
|
5613
|
-
{ name: 'L', internalType: 'uint256', type: 'uint256' },
|
|
5614
|
-
{ name: 'n', internalType: 'uint256', type: 'uint256' },
|
|
5615
|
-
],
|
|
5616
|
-
},
|
|
5617
|
-
],
|
|
5618
|
-
name: 'onHarvest',
|
|
5619
|
-
outputs: [
|
|
5620
|
-
{ name: 'amount', internalType: 'uint256', type: 'uint256' },
|
|
5621
|
-
{ name: 'cut', internalType: 'uint256', type: 'uint256' },
|
|
5622
|
-
],
|
|
5623
|
-
stateMutability: 'view',
|
|
5624
|
-
},
|
|
5625
5488
|
{
|
|
5626
5489
|
type: 'function',
|
|
5627
5490
|
inputs: [
|
|
@@ -5737,13 +5600,6 @@ export const publicPolicyAbi = [
|
|
|
5737
5600
|
outputs: [],
|
|
5738
5601
|
stateMutability: 'nonpayable',
|
|
5739
5602
|
},
|
|
5740
|
-
{
|
|
5741
|
-
type: 'function',
|
|
5742
|
-
inputs: [{ name: '_harvestCut', internalType: 'uint256', type: 'uint256' }],
|
|
5743
|
-
name: 'setHarvestCut',
|
|
5744
|
-
outputs: [],
|
|
5745
|
-
stateMutability: 'nonpayable',
|
|
5746
|
-
},
|
|
5747
5603
|
{
|
|
5748
5604
|
type: 'function',
|
|
5749
5605
|
inputs: [
|
|
@@ -5829,19 +5685,6 @@ export const publicPolicyAbi = [
|
|
|
5829
5685
|
],
|
|
5830
5686
|
name: 'CuratedSet',
|
|
5831
5687
|
},
|
|
5832
|
-
{
|
|
5833
|
-
type: 'event',
|
|
5834
|
-
anonymous: false,
|
|
5835
|
-
inputs: [
|
|
5836
|
-
{
|
|
5837
|
-
name: 'harvestCut',
|
|
5838
|
-
internalType: 'uint256',
|
|
5839
|
-
type: 'uint256',
|
|
5840
|
-
indexed: false,
|
|
5841
|
-
},
|
|
5842
|
-
],
|
|
5843
|
-
name: 'HarvestCutSet',
|
|
5844
|
-
},
|
|
5845
5688
|
{
|
|
5846
5689
|
type: 'event',
|
|
5847
5690
|
anonymous: false,
|