@factordao/governance 1.0.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/README.md +17 -0
- package/dist/cjs/abis/erc20.js +283 -0
- package/dist/cjs/abis/erc20.js.map +1 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/cjs/types/index.js +10 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/utils/general.js +51 -0
- package/dist/cjs/utils/general.js.map +1 -0
- package/dist/cjs/utils/prices.js +43 -0
- package/dist/cjs/utils/prices.js.map +1 -0
- package/dist/cjs/utils/subgraphs.js +41 -0
- package/dist/cjs/utils/subgraphs.js.map +1 -0
- package/dist/cjs/utils/viem.js +20 -0
- package/dist/cjs/utils/viem.js.map +1 -0
- package/dist/mjs/abis/erc20.js +280 -0
- package/dist/mjs/abis/erc20.js.map +1 -0
- package/dist/mjs/index.js +22 -0
- package/dist/mjs/index.js.map +1 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/tsconfig.mjs.tsbuildinfo +1 -0
- package/dist/mjs/types/index.js +7 -0
- package/dist/mjs/types/index.js.map +1 -0
- package/dist/mjs/utils/alchemy.js +44 -0
- package/dist/mjs/utils/alchemy.js.map +1 -0
- package/dist/mjs/utils/general.js +47 -0
- package/dist/mjs/utils/general.js.map +1 -0
- package/dist/mjs/utils/prices.js +37 -0
- package/dist/mjs/utils/prices.js.map +1 -0
- package/dist/mjs/utils/subgraphs.js +38 -0
- package/dist/mjs/utils/subgraphs.js.map +1 -0
- package/dist/mjs/utils/viem.js +17 -0
- package/dist/mjs/utils/viem.js.map +1 -0
- package/package.json +42 -0
- package/types/abis/erc20.d.ts +38 -0
- package/types/index.d.ts +3 -0
- package/types/types/index.d.ts +5 -0
- package/types/utils/prices.d.ts +2 -0
- package/types/utils/subgraphs.d.ts +4 -0
- package/types/utils/viem.d.ts +3 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Factor Governance
|
|
2
|
+
|
|
3
|
+
This repository contains the governance for Factor.
|
|
4
|
+
|
|
5
|
+
## Implementation plan
|
|
6
|
+
- [ ] Create the subgraph to track the `emit AddVault(_chainId, _vault);` event from `FactorScale` on Arbitrum
|
|
7
|
+
- [ ] Create the function to get all the vaults for all the available chains
|
|
8
|
+
- [ ] Create the subgraph to track the `emit Vote(user, vaults[i], weights[i], newVote);` event from `FactorScale`
|
|
9
|
+
- [ ] Create the function to get all the votes for a given user
|
|
10
|
+
- [ ] Create the function to get all the votes for all users
|
|
11
|
+
- [ ] Create the subgraph to track the `emit ReceiveVotingResults(wTime, vaults, fctrAmounts);` event from `FactorGaugeController` of both Arbitrum and Base which is emitted after the broadcast
|
|
12
|
+
- [ ] Create the function to get all the rewards for a given vault
|
|
13
|
+
- [ ] Create the function to get all the rewards for all vaults
|
|
14
|
+
- [ ] Create the subgraph to track the `emit UpdateVaultReward(vault, newSpeed, uint128(block.timestamp) + WEEK);` event from `FactorGaugeController`
|
|
15
|
+
- [ ] Create the function to get the inventives, if they're active or not and how much they're worth
|
|
16
|
+
- [ ] Create the function to get the `function earned(address account, address _rewardsToken)` for a given account and rewards token to get the rewards for the user (?)
|
|
17
|
+
- [ ] Calculate the APY for scale and the given vault (?)
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.erc20Abi = void 0;
|
|
4
|
+
exports.erc20Abi = [
|
|
5
|
+
{
|
|
6
|
+
constant: true,
|
|
7
|
+
inputs: [],
|
|
8
|
+
name: 'name',
|
|
9
|
+
outputs: [
|
|
10
|
+
{
|
|
11
|
+
name: '',
|
|
12
|
+
type: 'string',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
payable: false,
|
|
16
|
+
stateMutability: 'view',
|
|
17
|
+
type: 'function',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
constant: false,
|
|
21
|
+
inputs: [
|
|
22
|
+
{
|
|
23
|
+
name: 'guy',
|
|
24
|
+
type: 'address',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'wad',
|
|
28
|
+
type: 'uint256',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
name: 'approve',
|
|
32
|
+
outputs: [
|
|
33
|
+
{
|
|
34
|
+
name: '',
|
|
35
|
+
type: 'bool',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
payable: false,
|
|
39
|
+
stateMutability: 'nonpayable',
|
|
40
|
+
type: 'function',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
constant: true,
|
|
44
|
+
inputs: [],
|
|
45
|
+
name: 'totalSupply',
|
|
46
|
+
outputs: [
|
|
47
|
+
{
|
|
48
|
+
name: '',
|
|
49
|
+
type: 'uint256',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
payable: false,
|
|
53
|
+
stateMutability: 'view',
|
|
54
|
+
type: 'function',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
constant: false,
|
|
58
|
+
inputs: [
|
|
59
|
+
{
|
|
60
|
+
name: 'src',
|
|
61
|
+
type: 'address',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'dst',
|
|
65
|
+
type: 'address',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'wad',
|
|
69
|
+
type: 'uint256',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
name: 'transferFrom',
|
|
73
|
+
outputs: [
|
|
74
|
+
{
|
|
75
|
+
name: '',
|
|
76
|
+
type: 'bool',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
payable: false,
|
|
80
|
+
stateMutability: 'nonpayable',
|
|
81
|
+
type: 'function',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
constant: false,
|
|
85
|
+
inputs: [
|
|
86
|
+
{
|
|
87
|
+
name: 'wad',
|
|
88
|
+
type: 'uint256',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
name: 'withdraw',
|
|
92
|
+
outputs: [],
|
|
93
|
+
payable: false,
|
|
94
|
+
stateMutability: 'nonpayable',
|
|
95
|
+
type: 'function',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
constant: true,
|
|
99
|
+
inputs: [],
|
|
100
|
+
name: 'decimals',
|
|
101
|
+
outputs: [
|
|
102
|
+
{
|
|
103
|
+
name: '',
|
|
104
|
+
type: 'uint8',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
payable: false,
|
|
108
|
+
stateMutability: 'view',
|
|
109
|
+
type: 'function',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
constant: true,
|
|
113
|
+
inputs: [
|
|
114
|
+
{
|
|
115
|
+
name: '',
|
|
116
|
+
type: 'address',
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
name: 'balanceOf',
|
|
120
|
+
outputs: [
|
|
121
|
+
{
|
|
122
|
+
name: '',
|
|
123
|
+
type: 'uint256',
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
payable: false,
|
|
127
|
+
stateMutability: 'view',
|
|
128
|
+
type: 'function',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
constant: true,
|
|
132
|
+
inputs: [],
|
|
133
|
+
name: 'symbol',
|
|
134
|
+
outputs: [
|
|
135
|
+
{
|
|
136
|
+
name: '',
|
|
137
|
+
type: 'string',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
payable: false,
|
|
141
|
+
stateMutability: 'view',
|
|
142
|
+
type: 'function',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
constant: false,
|
|
146
|
+
inputs: [
|
|
147
|
+
{
|
|
148
|
+
name: 'dst',
|
|
149
|
+
type: 'address',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'wad',
|
|
153
|
+
type: 'uint256',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
name: 'transfer',
|
|
157
|
+
outputs: [
|
|
158
|
+
{
|
|
159
|
+
name: '',
|
|
160
|
+
type: 'bool',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
payable: false,
|
|
164
|
+
stateMutability: 'nonpayable',
|
|
165
|
+
type: 'function',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
constant: false,
|
|
169
|
+
inputs: [],
|
|
170
|
+
name: 'deposit',
|
|
171
|
+
outputs: [],
|
|
172
|
+
payable: true,
|
|
173
|
+
stateMutability: 'payable',
|
|
174
|
+
type: 'function',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
constant: true,
|
|
178
|
+
inputs: [
|
|
179
|
+
{
|
|
180
|
+
name: '',
|
|
181
|
+
type: 'address',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: '',
|
|
185
|
+
type: 'address',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
name: 'allowance',
|
|
189
|
+
outputs: [
|
|
190
|
+
{
|
|
191
|
+
name: '',
|
|
192
|
+
type: 'uint256',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
payable: false,
|
|
196
|
+
stateMutability: 'view',
|
|
197
|
+
type: 'function',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
payable: true,
|
|
201
|
+
stateMutability: 'payable',
|
|
202
|
+
type: 'fallback',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
anonymous: false,
|
|
206
|
+
inputs: [
|
|
207
|
+
{
|
|
208
|
+
indexed: true,
|
|
209
|
+
name: 'src',
|
|
210
|
+
type: 'address',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
indexed: true,
|
|
214
|
+
name: 'guy',
|
|
215
|
+
type: 'address',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
indexed: false,
|
|
219
|
+
name: 'wad',
|
|
220
|
+
type: 'uint256',
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
name: 'Approval',
|
|
224
|
+
type: 'event',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
anonymous: false,
|
|
228
|
+
inputs: [
|
|
229
|
+
{
|
|
230
|
+
indexed: true,
|
|
231
|
+
name: 'src',
|
|
232
|
+
type: 'address',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
indexed: true,
|
|
236
|
+
name: 'dst',
|
|
237
|
+
type: 'address',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
indexed: false,
|
|
241
|
+
name: 'wad',
|
|
242
|
+
type: 'uint256',
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
name: 'Transfer',
|
|
246
|
+
type: 'event',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
anonymous: false,
|
|
250
|
+
inputs: [
|
|
251
|
+
{
|
|
252
|
+
indexed: true,
|
|
253
|
+
name: 'dst',
|
|
254
|
+
type: 'address',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
indexed: false,
|
|
258
|
+
name: 'wad',
|
|
259
|
+
type: 'uint256',
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
name: 'Deposit',
|
|
263
|
+
type: 'event',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
anonymous: false,
|
|
267
|
+
inputs: [
|
|
268
|
+
{
|
|
269
|
+
indexed: true,
|
|
270
|
+
name: 'src',
|
|
271
|
+
type: 'address',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
indexed: false,
|
|
275
|
+
name: 'wad',
|
|
276
|
+
type: 'uint256',
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
name: 'Withdrawal',
|
|
280
|
+
type: 'event',
|
|
281
|
+
},
|
|
282
|
+
];
|
|
283
|
+
//# sourceMappingURL=erc20.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../../src/abis/erc20.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB;QACE,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,MAAM;aACb;SACF;QACD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;aAChB;SACF;QACD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,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,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,OAAO;KACd;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAvailableVaultsForVoting = getAvailableVaultsForVoting;
|
|
4
|
+
const subgraphs_1 = require("./utils/subgraphs");
|
|
5
|
+
async function getAvailableVaultsForVoting(chainId, environment) {
|
|
6
|
+
const subgraphUrl = subgraphs_1.factorScaleSubgraphUrl[chainId]?.[environment];
|
|
7
|
+
if (!subgraphUrl) {
|
|
8
|
+
throw new Error(`Subgraph URL not found for chainId ${chainId} and environment ${environment}`);
|
|
9
|
+
}
|
|
10
|
+
const query = `
|
|
11
|
+
{
|
|
12
|
+
vaults {
|
|
13
|
+
id
|
|
14
|
+
chainId
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const response = await fetch(subgraphUrl, {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
body: JSON.stringify({ query }),
|
|
21
|
+
});
|
|
22
|
+
const data = await response.json();
|
|
23
|
+
return data.data.vaults;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAKA,kEAmBC;AAxBD,iDAA6F;AAKtF,KAAK,UAAU,2BAA2B,CAAC,OAAgB,EAAE,WAA8B;IAC9F,MAAM,WAAW,GAAG,kCAAsB,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IACnE,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,OAAO,oBAAoB,WAAW,EAAE,CAAC,CAAC;IACpG,CAAC;IACD,MAAM,KAAK,GAAG;;;;;;;KAOb,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAClC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/index.ts","../../src/abis/erc20.ts","../../src/types/index.ts","../../src/utils/prices.ts","../../src/utils/subgraphs.ts","../../src/utils/viem.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FactorEnvironment = void 0;
|
|
4
|
+
var FactorEnvironment;
|
|
5
|
+
(function (FactorEnvironment) {
|
|
6
|
+
FactorEnvironment["TESTING"] = "testing";
|
|
7
|
+
FactorEnvironment["STAGING"] = "staging";
|
|
8
|
+
FactorEnvironment["PRODUCTION"] = "production";
|
|
9
|
+
})(FactorEnvironment || (exports.FactorEnvironment = FactorEnvironment = {}));
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;AAC7B,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertAprToApy = convertAprToApy;
|
|
4
|
+
exports.convertApyToApr = convertApyToApr;
|
|
5
|
+
/**
|
|
6
|
+
* Converts Annual Percentage Rate (APR) to Annual Percentage Yield (APY) using daily compounding
|
|
7
|
+
* @param apr - The Annual Percentage Rate as a percentage (e.g., 5 for 5%)
|
|
8
|
+
* @returns The Annual Percentage Yield as a percentage
|
|
9
|
+
*/
|
|
10
|
+
function convertAprToApy(apr) {
|
|
11
|
+
// Handle edge cases
|
|
12
|
+
if (!isFinite(apr) || isNaN(apr)) {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
// Cap APR at a reasonable maximum to prevent overflow
|
|
16
|
+
const maxApr = 10000; // 10,000% APR cap
|
|
17
|
+
const cappedApr = Math.min(Math.max(apr, -maxApr), maxApr);
|
|
18
|
+
// Convert percentage to decimal
|
|
19
|
+
const aprDecimal = cappedApr / 100;
|
|
20
|
+
// Using daily compounding (365 periods per year)
|
|
21
|
+
const periodsPerYear = 365;
|
|
22
|
+
// APY = (1 + APR/n)^n - 1
|
|
23
|
+
const apyDecimal = Math.pow(1 + aprDecimal / periodsPerYear, periodsPerYear) - 1;
|
|
24
|
+
// Convert back to percentage and ensure it's finite
|
|
25
|
+
const result = apyDecimal * 100;
|
|
26
|
+
return isFinite(result) ? result : 0;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Converts Annual Percentage Yield (APY) to Annual Percentage Rate (APR) using daily compounding
|
|
30
|
+
* @param apy - The Annual Percentage Yield as a percentage (e.g., 5 for 5%)
|
|
31
|
+
* @returns The Annual Percentage Rate as a percentage
|
|
32
|
+
*/
|
|
33
|
+
function convertApyToApr(apy) {
|
|
34
|
+
// Handle edge cases
|
|
35
|
+
if (!isFinite(apy) || isNaN(apy)) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
// Cap APY at a reasonable maximum to prevent overflow
|
|
39
|
+
const maxApy = 10000; // 10,000% APY cap
|
|
40
|
+
const cappedApy = Math.min(Math.max(apy, -maxApy), maxApy);
|
|
41
|
+
// Convert percentage to decimal
|
|
42
|
+
const apyDecimal = cappedApy / 100;
|
|
43
|
+
// Using daily compounding (365 periods per year)
|
|
44
|
+
const periodsPerYear = 365;
|
|
45
|
+
// APR = n * ((1 + APY)^(1/n) - 1)
|
|
46
|
+
const aprDecimal = periodsPerYear * (Math.pow(1 + apyDecimal, 1 / periodsPerYear) - 1);
|
|
47
|
+
// Convert back to percentage and ensure it's finite
|
|
48
|
+
const result = aprDecimal * 100;
|
|
49
|
+
return isFinite(result) ? result : 0;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=general.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../src/utils/general.ts"],"names":[],"mappings":";;AAKA,0CAuBC;AAOD,0CAuBC;AA1DD;;;;GAIG;AACH,SAAg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AAG,CAAC;IAE3B,kCAAkC;IAClC,MAAM,UAAU,GACd,cAAc,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAEtE,oDAAoD;IACpD,MAAM,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC;IAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getPrices = getPrices;
|
|
7
|
+
const tokenlist_1 = require("@factordao/tokenlist");
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const priceUrlApi = 'https://coins.llama.fi/prices/current';
|
|
10
|
+
function chainIdToChainName(chainId) {
|
|
11
|
+
switch (chainId) {
|
|
12
|
+
case tokenlist_1.ChainId.ARBITRUM_ONE:
|
|
13
|
+
return 'arbitrum';
|
|
14
|
+
case tokenlist_1.ChainId.BASE:
|
|
15
|
+
return 'base';
|
|
16
|
+
case tokenlist_1.ChainId.OPTIMISM:
|
|
17
|
+
return 'optimism';
|
|
18
|
+
case tokenlist_1.ChainId.SONIC:
|
|
19
|
+
return 'sonic';
|
|
20
|
+
default:
|
|
21
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function getPrices(chainId, tokenAddresses) {
|
|
25
|
+
const prices = {};
|
|
26
|
+
try {
|
|
27
|
+
const response = await axios_1.default.get(`${priceUrlApi}/${tokenAddresses
|
|
28
|
+
.map((addr) => `${chainIdToChainName(chainId)}:${addr.toLowerCase()}`)
|
|
29
|
+
.join(',')}`);
|
|
30
|
+
for (const token of tokenAddresses) {
|
|
31
|
+
const price = response.data.coins[`${chainIdToChainName(chainId)}:${token.toLowerCase()}`];
|
|
32
|
+
if (!price)
|
|
33
|
+
prices[token] = 0;
|
|
34
|
+
else
|
|
35
|
+
prices[token] = price.price ?? 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error('Error getting prices for', chainIdToChainName(chainId), error);
|
|
40
|
+
}
|
|
41
|
+
return prices;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=prices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prices.js","sourceRoot":"","sources":["../../../src/utils/prices.ts"],"names":[],"mappings":";;;;;AAoBA,8BA2BC;AA/CD,oDAA+C;AAC/C,kDAA0B;AAE1B,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAE5D,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,mBAAO,CAAC,YAAY;YACvB,OAAO,UAAU,CAAC;QACpB,KAAK,mBAAO,CAAC,IAAI;YACf,OAAO,MAAM,CAAC;QAChB,KAAK,mBAAO,CAAC,QAAQ;YACnB,OAAO,UAAU,CAAC;QACpB,KAAK,mBAAO,CAAC,KAAK;YAChB,OAAO,OAAO,CAAC;QACjB;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,SAAS,CAC7B,OAAgB,EAChB,cAAwB;IAExB,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,WAAW,IAAI,cAAc;aAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;aACrE,IAAI,CAAC,GAAG,CAAC,EAAE,CACf,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;YACnC,MAAM,KAAK,GACT,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CACxD,CAAC;YACJ,IAAI,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;gBACzB,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,0BAA0B,EAC1B,kBAAkB,CAAC,OAAO,CAAC,EAC3B,KAAK,CACN,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.factorGaugeControllerSubgraphUrl = exports.factorScaleSubgraphUrl = void 0;
|
|
4
|
+
const tokenlist_1 = require("@factordao/tokenlist");
|
|
5
|
+
exports.factorScaleSubgraphUrl = {
|
|
6
|
+
[tokenlist_1.ChainId.ARBITRUM_ONE]: {
|
|
7
|
+
testing: 'https://api.goldsky.com/api/public/project_cmgzitcts001c5np28moc9lyy/subgraphs/scale-arbitrum_testing/v0.0.3/gn',
|
|
8
|
+
production: 'https://api.goldsky.com/api/public/project_cmgzitcts001c5np28moc9lyy/subgraphs/scale-arbitrum_production/v0.0.3/gn',
|
|
9
|
+
},
|
|
10
|
+
[tokenlist_1.ChainId.BASE]: {
|
|
11
|
+
testing: '',
|
|
12
|
+
production: '',
|
|
13
|
+
},
|
|
14
|
+
[tokenlist_1.ChainId.OPTIMISM]: {
|
|
15
|
+
testing: '',
|
|
16
|
+
production: '',
|
|
17
|
+
},
|
|
18
|
+
[tokenlist_1.ChainId.SONIC]: {
|
|
19
|
+
testing: '',
|
|
20
|
+
production: '',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.factorGaugeControllerSubgraphUrl = {
|
|
24
|
+
[tokenlist_1.ChainId.ARBITRUM_ONE]: {
|
|
25
|
+
testing: '',
|
|
26
|
+
production: '',
|
|
27
|
+
},
|
|
28
|
+
[tokenlist_1.ChainId.BASE]: {
|
|
29
|
+
testing: '',
|
|
30
|
+
production: '',
|
|
31
|
+
},
|
|
32
|
+
[tokenlist_1.ChainId.OPTIMISM]: {
|
|
33
|
+
testing: '',
|
|
34
|
+
production: '',
|
|
35
|
+
},
|
|
36
|
+
[tokenlist_1.ChainId.SONIC]: {
|
|
37
|
+
testing: '',
|
|
38
|
+
production: '',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=subgraphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraphs.js","sourceRoot":"","sources":["../../../src/utils/subgraphs.ts"],"names":[],"mappings":";;;AAAA,oDAA+C;AAGlC,QAAA,sBAAsB,GAAG;IAClC,CAAC,mBAAO,CAAC,YAAY,CAAC,EAAE;QACpB,OAAO,EAAE,iHAAiH;QAC1H,UAAU,EAAE,oHAAoH;KACnI;IACD,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,mBAAO,CAAC,KAAK,CAAC,EAAE;QACb,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CAC2D,CAAC;AAEpD,QAAA,gCAAgC,GAAG;IAC5C,CAAC,mBAAO,CAAC,YAAY,CAAC,EAAE;QACpB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,mBAAO,CAAC,IAAI,CAAC,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,mBAAO,CAAC,KAAK,CAAC,EAAE;QACb,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CAC2D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChainIdToViemChain = ChainIdToViemChain;
|
|
4
|
+
const tokenlist_1 = require("@factordao/tokenlist");
|
|
5
|
+
const chains_1 = require("viem/chains");
|
|
6
|
+
function ChainIdToViemChain(chainId) {
|
|
7
|
+
switch (chainId) {
|
|
8
|
+
case tokenlist_1.ChainId.ARBITRUM_ONE:
|
|
9
|
+
return chains_1.arbitrum;
|
|
10
|
+
case tokenlist_1.ChainId.BASE:
|
|
11
|
+
return chains_1.base;
|
|
12
|
+
case tokenlist_1.ChainId.OPTIMISM:
|
|
13
|
+
return chains_1.optimism;
|
|
14
|
+
case tokenlist_1.ChainId.SONIC:
|
|
15
|
+
return chains_1.sonic;
|
|
16
|
+
default:
|
|
17
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=viem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viem.js","sourceRoot":"","sources":["../../../src/utils/viem.ts"],"names":[],"mappings":";;AAIA,gDAaC;AAjBD,oDAA+C;AAE/C,wCAA8D;AAE9D,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,mBAAO,CAAC,YAAY;YACvB,OAAO,iBAAQ,CAAC;QAClB,KAAK,mBAAO,CAAC,IAAI;YACf,OAAO,aAAI,CAAC;QACd,KAAK,mBAAO,CAAC,QAAQ;YACnB,OAAO,iBAAQ,CAAC;QAClB,KAAK,mBAAO,CAAC,KAAK;YAChB,OAAO,cAAK,CAAC;QACf;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
export const erc20Abi = [
|
|
2
|
+
{
|
|
3
|
+
constant: true,
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: 'name',
|
|
6
|
+
outputs: [
|
|
7
|
+
{
|
|
8
|
+
name: '',
|
|
9
|
+
type: 'string',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
payable: false,
|
|
13
|
+
stateMutability: 'view',
|
|
14
|
+
type: 'function',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
constant: false,
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
name: 'guy',
|
|
21
|
+
type: 'address',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'wad',
|
|
25
|
+
type: 'uint256',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
name: 'approve',
|
|
29
|
+
outputs: [
|
|
30
|
+
{
|
|
31
|
+
name: '',
|
|
32
|
+
type: 'bool',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
payable: false,
|
|
36
|
+
stateMutability: 'nonpayable',
|
|
37
|
+
type: 'function',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
constant: true,
|
|
41
|
+
inputs: [],
|
|
42
|
+
name: 'totalSupply',
|
|
43
|
+
outputs: [
|
|
44
|
+
{
|
|
45
|
+
name: '',
|
|
46
|
+
type: 'uint256',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
payable: false,
|
|
50
|
+
stateMutability: 'view',
|
|
51
|
+
type: 'function',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
constant: false,
|
|
55
|
+
inputs: [
|
|
56
|
+
{
|
|
57
|
+
name: 'src',
|
|
58
|
+
type: 'address',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'dst',
|
|
62
|
+
type: 'address',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'wad',
|
|
66
|
+
type: 'uint256',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
name: 'transferFrom',
|
|
70
|
+
outputs: [
|
|
71
|
+
{
|
|
72
|
+
name: '',
|
|
73
|
+
type: 'bool',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
payable: false,
|
|
77
|
+
stateMutability: 'nonpayable',
|
|
78
|
+
type: 'function',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
constant: false,
|
|
82
|
+
inputs: [
|
|
83
|
+
{
|
|
84
|
+
name: 'wad',
|
|
85
|
+
type: 'uint256',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
name: 'withdraw',
|
|
89
|
+
outputs: [],
|
|
90
|
+
payable: false,
|
|
91
|
+
stateMutability: 'nonpayable',
|
|
92
|
+
type: 'function',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
constant: true,
|
|
96
|
+
inputs: [],
|
|
97
|
+
name: 'decimals',
|
|
98
|
+
outputs: [
|
|
99
|
+
{
|
|
100
|
+
name: '',
|
|
101
|
+
type: 'uint8',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
payable: false,
|
|
105
|
+
stateMutability: 'view',
|
|
106
|
+
type: 'function',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
constant: true,
|
|
110
|
+
inputs: [
|
|
111
|
+
{
|
|
112
|
+
name: '',
|
|
113
|
+
type: 'address',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
name: 'balanceOf',
|
|
117
|
+
outputs: [
|
|
118
|
+
{
|
|
119
|
+
name: '',
|
|
120
|
+
type: 'uint256',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
payable: false,
|
|
124
|
+
stateMutability: 'view',
|
|
125
|
+
type: 'function',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
constant: true,
|
|
129
|
+
inputs: [],
|
|
130
|
+
name: 'symbol',
|
|
131
|
+
outputs: [
|
|
132
|
+
{
|
|
133
|
+
name: '',
|
|
134
|
+
type: 'string',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
payable: false,
|
|
138
|
+
stateMutability: 'view',
|
|
139
|
+
type: 'function',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
constant: false,
|
|
143
|
+
inputs: [
|
|
144
|
+
{
|
|
145
|
+
name: 'dst',
|
|
146
|
+
type: 'address',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'wad',
|
|
150
|
+
type: 'uint256',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
name: 'transfer',
|
|
154
|
+
outputs: [
|
|
155
|
+
{
|
|
156
|
+
name: '',
|
|
157
|
+
type: 'bool',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
payable: false,
|
|
161
|
+
stateMutability: 'nonpayable',
|
|
162
|
+
type: 'function',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
constant: false,
|
|
166
|
+
inputs: [],
|
|
167
|
+
name: 'deposit',
|
|
168
|
+
outputs: [],
|
|
169
|
+
payable: true,
|
|
170
|
+
stateMutability: 'payable',
|
|
171
|
+
type: 'function',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
constant: true,
|
|
175
|
+
inputs: [
|
|
176
|
+
{
|
|
177
|
+
name: '',
|
|
178
|
+
type: 'address',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: '',
|
|
182
|
+
type: 'address',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
name: 'allowance',
|
|
186
|
+
outputs: [
|
|
187
|
+
{
|
|
188
|
+
name: '',
|
|
189
|
+
type: 'uint256',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
payable: false,
|
|
193
|
+
stateMutability: 'view',
|
|
194
|
+
type: 'function',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
payable: true,
|
|
198
|
+
stateMutability: 'payable',
|
|
199
|
+
type: 'fallback',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
anonymous: false,
|
|
203
|
+
inputs: [
|
|
204
|
+
{
|
|
205
|
+
indexed: true,
|
|
206
|
+
name: 'src',
|
|
207
|
+
type: 'address',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
indexed: true,
|
|
211
|
+
name: 'guy',
|
|
212
|
+
type: 'address',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
indexed: false,
|
|
216
|
+
name: 'wad',
|
|
217
|
+
type: 'uint256',
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
name: 'Approval',
|
|
221
|
+
type: 'event',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
anonymous: false,
|
|
225
|
+
inputs: [
|
|
226
|
+
{
|
|
227
|
+
indexed: true,
|
|
228
|
+
name: 'src',
|
|
229
|
+
type: 'address',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
indexed: true,
|
|
233
|
+
name: 'dst',
|
|
234
|
+
type: 'address',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
indexed: false,
|
|
238
|
+
name: 'wad',
|
|
239
|
+
type: 'uint256',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
name: 'Transfer',
|
|
243
|
+
type: 'event',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
anonymous: false,
|
|
247
|
+
inputs: [
|
|
248
|
+
{
|
|
249
|
+
indexed: true,
|
|
250
|
+
name: 'dst',
|
|
251
|
+
type: 'address',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
indexed: false,
|
|
255
|
+
name: 'wad',
|
|
256
|
+
type: 'uint256',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
name: 'Deposit',
|
|
260
|
+
type: 'event',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
anonymous: false,
|
|
264
|
+
inputs: [
|
|
265
|
+
{
|
|
266
|
+
indexed: true,
|
|
267
|
+
name: 'src',
|
|
268
|
+
type: 'address',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
indexed: false,
|
|
272
|
+
name: 'wad',
|
|
273
|
+
type: 'uint256',
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
name: 'Withdrawal',
|
|
277
|
+
type: 'event',
|
|
278
|
+
},
|
|
279
|
+
];
|
|
280
|
+
//# sourceMappingURL=erc20.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erc20.js","sourceRoot":"","sources":["../../../src/abis/erc20.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;QACE,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,MAAM;aACb;SACF;QACD,OAAO,EAAE,K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EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,OAAO;KACd;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { factorScaleSubgraphUrl } from './utils/subgraphs';
|
|
2
|
+
export async function getAvailableVaultsForVoting(chainId, environment) {
|
|
3
|
+
const subgraphUrl = factorScaleSubgraphUrl[chainId]?.[environment];
|
|
4
|
+
if (!subgraphUrl) {
|
|
5
|
+
throw new Error(`Subgraph URL not found for chainId ${chainId} and environment ${environment}`);
|
|
6
|
+
}
|
|
7
|
+
const query = `
|
|
8
|
+
{
|
|
9
|
+
vaults {
|
|
10
|
+
id
|
|
11
|
+
chainId
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const response = await fetch(subgraphUrl, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: JSON.stringify({ query }),
|
|
18
|
+
});
|
|
19
|
+
const data = await response.json();
|
|
20
|
+
return data.data.vaults;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAoC,MAAM,mBAAmB,CAAC;AAK7F,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAAgB,EAAE,WAA8B;IAC9F,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IACnE,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,OAAO,oBAAoB,WAAW,EAAE,CAAC,CAAC;IACpG,CAAC;IACD,MAAM,KAAK,GAAG;;;;;;;KAOb,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;KAClC,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../../src/index.ts","../../src/abis/erc20.ts","../../src/types/index.ts","../../src/utils/prices.ts","../../src/utils/subgraphs.ts","../../src/utils/viem.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var FactorEnvironment;
|
|
2
|
+
(function (FactorEnvironment) {
|
|
3
|
+
FactorEnvironment["TESTING"] = "testing";
|
|
4
|
+
FactorEnvironment["STAGING"] = "staging";
|
|
5
|
+
FactorEnvironment["PRODUCTION"] = "production";
|
|
6
|
+
})(FactorEnvironment || (FactorEnvironment = {}));
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;AAC7B,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChainId } from '@factordao/tokenlist';
|
|
2
|
+
import { Alchemy, Network } from 'alchemy-sdk';
|
|
3
|
+
export function getAlchemy(chainId, alchemyApiKey) {
|
|
4
|
+
if (!alchemyApiKey) {
|
|
5
|
+
throw new Error('Alchemy API key is required');
|
|
6
|
+
}
|
|
7
|
+
let alchemyNetwork;
|
|
8
|
+
let chainName;
|
|
9
|
+
switch (parseInt(chainId.toString())) {
|
|
10
|
+
case ChainId.ARBITRUM_ONE:
|
|
11
|
+
chainName = 'arbitrum';
|
|
12
|
+
alchemyNetwork = Network.ARB_MAINNET;
|
|
13
|
+
break;
|
|
14
|
+
case ChainId.BASE:
|
|
15
|
+
chainName = 'base';
|
|
16
|
+
alchemyNetwork = Network.BASE_MAINNET;
|
|
17
|
+
break;
|
|
18
|
+
case ChainId.OPTIMISM:
|
|
19
|
+
chainName = 'optimism';
|
|
20
|
+
alchemyNetwork = Network.OPT_MAINNET;
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
24
|
+
}
|
|
25
|
+
return new Alchemy({
|
|
26
|
+
apiKey: alchemyApiKey,
|
|
27
|
+
network: alchemyNetwork,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export function getAlchemyNetwork(chainId) {
|
|
31
|
+
switch (parseInt(chainId.toString())) {
|
|
32
|
+
case ChainId.ARBITRUM_ONE:
|
|
33
|
+
return Network.ARB_MAINNET;
|
|
34
|
+
case ChainId.BASE:
|
|
35
|
+
return Network.BASE_MAINNET;
|
|
36
|
+
case ChainId.OPTIMISM:
|
|
37
|
+
return Network.OPT_MAINNET;
|
|
38
|
+
case ChainId.SONIC:
|
|
39
|
+
return Network.SONIC_MAINNET;
|
|
40
|
+
default:
|
|
41
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=alchemy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alchemy.js","sourceRoot":"","sources":["../../../src/utils/alchemy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,UAAU,UAAU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,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts Annual Percentage Rate (APR) to Annual Percentage Yield (APY) using daily compounding
|
|
3
|
+
* @param apr - The Annual Percentage Rate as a percentage (e.g., 5 for 5%)
|
|
4
|
+
* @returns The Annual Percentage Yield as a percentage
|
|
5
|
+
*/
|
|
6
|
+
export function convertAprToApy(apr) {
|
|
7
|
+
// Handle edge cases
|
|
8
|
+
if (!isFinite(apr) || isNaN(apr)) {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
// Cap APR at a reasonable maximum to prevent overflow
|
|
12
|
+
const maxApr = 10000; // 10,000% APR cap
|
|
13
|
+
const cappedApr = Math.min(Math.max(apr, -maxApr), maxApr);
|
|
14
|
+
// Convert percentage to decimal
|
|
15
|
+
const aprDecimal = cappedApr / 100;
|
|
16
|
+
// Using daily compounding (365 periods per year)
|
|
17
|
+
const periodsPerYear = 365;
|
|
18
|
+
// APY = (1 + APR/n)^n - 1
|
|
19
|
+
const apyDecimal = Math.pow(1 + aprDecimal / periodsPerYear, periodsPerYear) - 1;
|
|
20
|
+
// Convert back to percentage and ensure it's finite
|
|
21
|
+
const result = apyDecimal * 100;
|
|
22
|
+
return isFinite(result) ? result : 0;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Converts Annual Percentage Yield (APY) to Annual Percentage Rate (APR) using daily compounding
|
|
26
|
+
* @param apy - The Annual Percentage Yield as a percentage (e.g., 5 for 5%)
|
|
27
|
+
* @returns The Annual Percentage Rate as a percentage
|
|
28
|
+
*/
|
|
29
|
+
export function convertApyToApr(apy) {
|
|
30
|
+
// Handle edge cases
|
|
31
|
+
if (!isFinite(apy) || isNaN(apy)) {
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
// Cap APY at a reasonable maximum to prevent overflow
|
|
35
|
+
const maxApy = 10000; // 10,000% APY cap
|
|
36
|
+
const cappedApy = Math.min(Math.max(apy, -maxApy), maxApy);
|
|
37
|
+
// Convert percentage to decimal
|
|
38
|
+
const apyDecimal = cappedApy / 100;
|
|
39
|
+
// Using daily compounding (365 periods per year)
|
|
40
|
+
const periodsPerYear = 365;
|
|
41
|
+
// APR = n * ((1 + APY)^(1/n) - 1)
|
|
42
|
+
const aprDecimal = periodsPerYear * (Math.pow(1 + apyDecimal, 1 / periodsPerYear) - 1);
|
|
43
|
+
// Convert back to percentage and ensure it's finite
|
|
44
|
+
const result = aprDecimal * 100;
|
|
45
|
+
return isFinite(result) ? result : 0;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=general.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"general.js","sourceRoot":"","sources":["../../../src/utils/general.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,oBAAoB;IACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,sDAAsD;IACtD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,kBAAkB;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAE3D,gCAAgC;IAChC,MAAM,UAAU,GAAG,SAAS,GAAG,GAAG,CAAC;IAEnC,iDAAiD;IACjD,MAAM,cAAc,GAAG,GAAG,CAAC;IAE3B,0BAA0B;IAC1B,MAAM,UAAU,GACd,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,GAAG,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAEhE,oDAAoD;IACpD,MAAM,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC;IAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,oBAAoB;IACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,sDAAsD;IACtD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,kBAAkB;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAE3D,gCAAgC;IAChC,MAAM,UAAU,GAAG,SAAS,GAAG,GAAG,CAAC;IAEnC,iDAAiD;IACjD,MAAM,cAAc,GAAG,GAAG,CAAC;IAE3B,kCAAkC;IAClC,MAAM,UAAU,GACd,cAAc,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAEtE,oDAAoD;IACpD,MAAM,MAAM,GAAG,UAAU,GAAG,GAAG,CAAC;IAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChainId } from '@factordao/tokenlist';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
const priceUrlApi = 'https://coins.llama.fi/prices/current';
|
|
4
|
+
function chainIdToChainName(chainId) {
|
|
5
|
+
switch (chainId) {
|
|
6
|
+
case ChainId.ARBITRUM_ONE:
|
|
7
|
+
return 'arbitrum';
|
|
8
|
+
case ChainId.BASE:
|
|
9
|
+
return 'base';
|
|
10
|
+
case ChainId.OPTIMISM:
|
|
11
|
+
return 'optimism';
|
|
12
|
+
case ChainId.SONIC:
|
|
13
|
+
return 'sonic';
|
|
14
|
+
default:
|
|
15
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export async function getPrices(chainId, tokenAddresses) {
|
|
19
|
+
const prices = {};
|
|
20
|
+
try {
|
|
21
|
+
const response = await axios.get(`${priceUrlApi}/${tokenAddresses
|
|
22
|
+
.map((addr) => `${chainIdToChainName(chainId)}:${addr.toLowerCase()}`)
|
|
23
|
+
.join(',')}`);
|
|
24
|
+
for (const token of tokenAddresses) {
|
|
25
|
+
const price = response.data.coins[`${chainIdToChainName(chainId)}:${token.toLowerCase()}`];
|
|
26
|
+
if (!price)
|
|
27
|
+
prices[token] = 0;
|
|
28
|
+
else
|
|
29
|
+
prices[token] = price.price ?? 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error('Error getting prices for', chainIdToChainName(chainId), error);
|
|
34
|
+
}
|
|
35
|
+
return prices;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=prices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prices.js","sourceRoot":"","sources":["../../../src/utils/prices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAE5D,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,YAAY;YACvB,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC,IAAI;YACf,OAAO,MAAM,CAAC;QAChB,KAAK,OAAO,CAAC,QAAQ;YACnB,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO,CAAC,KAAK;YAChB,OAAO,OAAO,CAAC;QACjB;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,OAAgB,EAChB,cAAwB;IAExB,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,WAAW,IAAI,cAAc;aAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;aACrE,IAAI,CAAC,GAAG,CAAC,EAAE,CACf,CAAC;QACF,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;YACnC,MAAM,KAAK,GACT,QAAQ,CAAC,IAAI,CAAC,KAAK,CACjB,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CACxD,CAAC;YACJ,IAAI,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;gBACzB,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,0BAA0B,EAC1B,kBAAkB,CAAC,OAAO,CAAC,EAC3B,KAAK,CACN,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChainId } from "@factordao/tokenlist";
|
|
2
|
+
export const factorScaleSubgraphUrl = {
|
|
3
|
+
[ChainId.ARBITRUM_ONE]: {
|
|
4
|
+
testing: 'https://api.goldsky.com/api/public/project_cmgzitcts001c5np28moc9lyy/subgraphs/scale-arbitrum_testing/v0.0.3/gn',
|
|
5
|
+
production: 'https://api.goldsky.com/api/public/project_cmgzitcts001c5np28moc9lyy/subgraphs/scale-arbitrum_production/v0.0.3/gn',
|
|
6
|
+
},
|
|
7
|
+
[ChainId.BASE]: {
|
|
8
|
+
testing: '',
|
|
9
|
+
production: '',
|
|
10
|
+
},
|
|
11
|
+
[ChainId.OPTIMISM]: {
|
|
12
|
+
testing: '',
|
|
13
|
+
production: '',
|
|
14
|
+
},
|
|
15
|
+
[ChainId.SONIC]: {
|
|
16
|
+
testing: '',
|
|
17
|
+
production: '',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const factorGaugeControllerSubgraphUrl = {
|
|
21
|
+
[ChainId.ARBITRUM_ONE]: {
|
|
22
|
+
testing: '',
|
|
23
|
+
production: '',
|
|
24
|
+
},
|
|
25
|
+
[ChainId.BASE]: {
|
|
26
|
+
testing: '',
|
|
27
|
+
production: '',
|
|
28
|
+
},
|
|
29
|
+
[ChainId.OPTIMISM]: {
|
|
30
|
+
testing: '',
|
|
31
|
+
production: '',
|
|
32
|
+
},
|
|
33
|
+
[ChainId.SONIC]: {
|
|
34
|
+
testing: '',
|
|
35
|
+
production: '',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=subgraphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraphs.js","sourceRoot":"","sources":["../../../src/utils/subgraphs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACpB,OAAO,EAAE,iHAAiH;QAC1H,UAAU,EAAE,oHAAoH;KACnI;IACD,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACb,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CAC2D,CAAC;AAEjE,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC5C,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACpB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;IACD,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACb,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;KACjB;CAC2D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChainId } from '@factordao/tokenlist';
|
|
2
|
+
import { arbitrum, base, optimism, sonic } from 'viem/chains';
|
|
3
|
+
export function ChainIdToViemChain(chainId) {
|
|
4
|
+
switch (chainId) {
|
|
5
|
+
case ChainId.ARBITRUM_ONE:
|
|
6
|
+
return arbitrum;
|
|
7
|
+
case ChainId.BASE:
|
|
8
|
+
return base;
|
|
9
|
+
case ChainId.OPTIMISM:
|
|
10
|
+
return optimism;
|
|
11
|
+
case ChainId.SONIC:
|
|
12
|
+
return sonic;
|
|
13
|
+
default:
|
|
14
|
+
throw new Error(`Unsupported chainId: ${chainId}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=viem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viem.js","sourceRoot":"","sources":["../../../src/utils/viem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC,YAAY;YACvB,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO,CAAC,IAAI;YACf,OAAO,IAAI,CAAC;QACd,KAAK,OAAO,CAAC,QAAQ;YACnB,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO,CAAC,KAAK;YAChB,OAAO,KAAK,CAAC;QACf;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@factordao/governance",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"types"
|
|
8
|
+
],
|
|
9
|
+
"main": "dist/cjs/index.js",
|
|
10
|
+
"module": "dist/mjs/index.js",
|
|
11
|
+
"types": "types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/mjs/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js",
|
|
16
|
+
"types": "./types/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "ts-node",
|
|
21
|
+
"build": "tsc --build tsconfig.mjs.json && tsc --build tsconfig.cjs.json && ./publish.sh",
|
|
22
|
+
"prepare": "yarn build",
|
|
23
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
24
|
+
"format": "prettier --write \"{src,examples,test,scripts}/**/*.ts\""
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@factordao/tokenlist": "^1.3.36",
|
|
28
|
+
"viem": "^2.44.4"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^18.11.18",
|
|
32
|
+
"dotenv": "^16.5.0",
|
|
33
|
+
"eslint": "^8.42.0",
|
|
34
|
+
"eslint-config-prettier": "^9.0.0",
|
|
35
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
36
|
+
"nano": "^10.1.3",
|
|
37
|
+
"nanospinner": "^1.1.0",
|
|
38
|
+
"prettier": "^3.0.0",
|
|
39
|
+
"ts-node": "^10.9.1",
|
|
40
|
+
"typescript": "^5.2.2"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const erc20Abi: ({
|
|
2
|
+
constant: boolean;
|
|
3
|
+
inputs: {
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
name: string;
|
|
8
|
+
outputs: {
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
}[];
|
|
12
|
+
payable: boolean;
|
|
13
|
+
stateMutability: string;
|
|
14
|
+
type: string;
|
|
15
|
+
anonymous?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
payable: boolean;
|
|
18
|
+
stateMutability: string;
|
|
19
|
+
type: string;
|
|
20
|
+
constant?: undefined;
|
|
21
|
+
inputs?: undefined;
|
|
22
|
+
name?: undefined;
|
|
23
|
+
outputs?: undefined;
|
|
24
|
+
anonymous?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
anonymous: boolean;
|
|
27
|
+
inputs: {
|
|
28
|
+
indexed: boolean;
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
}[];
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
constant?: undefined;
|
|
35
|
+
outputs?: undefined;
|
|
36
|
+
payable?: undefined;
|
|
37
|
+
stateMutability?: undefined;
|
|
38
|
+
})[];
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChainId } from "@factordao/tokenlist";
|
|
2
|
+
import { FactorEnvironment } from "../types";
|
|
3
|
+
export declare const factorScaleSubgraphUrl: Record<ChainId, Partial<Record<FactorEnvironment, string>>>;
|
|
4
|
+
export declare const factorGaugeControllerSubgraphUrl: Record<ChainId, Partial<Record<FactorEnvironment, string>>>;
|