@pufferfinance/puffer-sdk 1.28.2 → 1.28.4
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/contracts/abis/mainnet/CarrotVesting.cjs +1 -1
- package/dist/contracts/abis/mainnet/CarrotVesting.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/CarrotVesting.d.ts +84 -92
- package/dist/contracts/abis/mainnet/CarrotVesting.js +56 -62
- package/dist/contracts/abis/mainnet/CarrotVesting.js.map +1 -1
- package/dist/contracts/addresses.cjs +1 -1
- package/dist/contracts/addresses.cjs.map +1 -1
- package/dist/contracts/addresses.js +3 -3
- package/dist/contracts/addresses.js.map +1 -1
- package/dist/contracts/handlers/carrot-vesting-handler.cjs +1 -1
- package/dist/contracts/handlers/carrot-vesting-handler.cjs.map +1 -1
- package/dist/contracts/handlers/carrot-vesting-handler.d.ts +6 -6
- package/dist/contracts/handlers/carrot-vesting-handler.js +22 -33
- package/dist/contracts/handlers/carrot-vesting-handler.js.map +1 -1
- package/dist/utils/version.cjs +1 -1
- package/dist/utils/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=[{type:"function",name:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=[{type:"function",name:"calculateClaimableAmount",stateMutability:"view",inputs:[{type:"address",name:"user",simpleType:"address"}],outputs:[{type:"uint256",name:"",simpleType:"uint"}]},{type:"function",name:"PUFFER",stateMutability:"view",outputs:[{type:"address",name:"",simpleType:"address"}],inputs:[]},{type:"function",name:"claim",stateMutability:"nonpayable",outputs:[{type:"uint128",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"owner",stateMutability:"view",outputs:[{type:"address",name:"",simpleType:"address"}],inputs:[]},{type:"function",name:"getTotalDepositedAmount",stateMutability:"view",outputs:[{type:"uint128",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"getVestings",stateMutability:"view",inputs:[{type:"address",name:"user",simpleType:"address"}],outputs:[{type:"tuple[]",name:"",simpleType:"slice",nestedType:{type:"tuple"},components:[{type:"uint128",name:"depositedAmount",simpleType:"uint"},{type:"uint128",name:"claimedAmount",simpleType:"uint"},{type:"uint48",name:"lastClaimedTimestamp",simpleType:"uint"},{type:"uint48",name:"depositedTimestamp",simpleType:"uint"}]}]},{type:"function",name:"TOTAL_PUFFER_REWARDS",stateMutability:"view",outputs:[{type:"uint256",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"getDuration",stateMutability:"view",outputs:[{type:"uint32",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"startVesting",stateMutability:"nonpayable",inputs:[{type:"uint256",name:"amount",simpleType:"uint"}],outputs:[]},{type:"function",name:"getSteps",stateMutability:"view",outputs:[{type:"uint32",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"EXCHANGE_RATE",stateMutability:"view",outputs:[{type:"uint256",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"startVestingWithPermit",stateMutability:"nonpayable",inputs:[{type:"tuple",name:"permitData",simpleType:"tuple",components:[{type:"uint256",name:"deadline",simpleType:"uint"},{type:"uint256",name:"amount",simpleType:"uint"},{type:"uint8",name:"v",simpleType:"uint"},{type:"bytes32",name:"r",simpleType:"bytes"},{type:"bytes32",name:"s",simpleType:"bytes"}]}],outputs:[]},{type:"function",name:"CARROT",stateMutability:"view",outputs:[{type:"address",name:"",simpleType:"address"}],inputs:[]},{type:"function",name:"getStartTimestamp",stateMutability:"view",outputs:[{type:"uint48",name:"",simpleType:"uint"}],inputs:[]},{type:"function",name:"MAX_CARROT_AMOUNT",stateMutability:"view",outputs:[{type:"uint256",name:"",simpleType:"uint"}],inputs:[]}];exports.CarrotVesting=t;
|
|
2
2
|
//# sourceMappingURL=CarrotVesting.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarrotVesting.cjs","sources":["../../../../lib/contracts/abis/mainnet/CarrotVesting.ts"],"sourcesContent":["export const CarrotVesting = <const>[\n {\n type: 'function',\n name: '
|
|
1
|
+
{"version":3,"file":"CarrotVesting.cjs","sources":["../../../../lib/contracts/abis/mainnet/CarrotVesting.ts"],"sourcesContent":["export const CarrotVesting = <const>[\n {\n type: 'function',\n name: 'calculateClaimableAmount',\n stateMutability: 'view',\n inputs: [{ type: 'address', name: 'user', simpleType: 'address' }],\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n },\n {\n type: 'function',\n name: 'PUFFER',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'claim',\n stateMutability: 'nonpayable',\n outputs: [{ type: 'uint128', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'owner',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getTotalDepositedAmount',\n stateMutability: 'view',\n outputs: [{ type: 'uint128', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getVestings',\n stateMutability: 'view',\n inputs: [{ type: 'address', name: 'user', simpleType: 'address' }],\n outputs: [\n {\n type: 'tuple[]',\n name: '',\n simpleType: 'slice',\n nestedType: { type: 'tuple' },\n components: [\n { type: 'uint128', name: 'depositedAmount', simpleType: 'uint' },\n { type: 'uint128', name: 'claimedAmount', simpleType: 'uint' },\n { type: 'uint48', name: 'lastClaimedTimestamp', simpleType: 'uint' },\n { type: 'uint48', name: 'depositedTimestamp', simpleType: 'uint' },\n ],\n },\n ],\n },\n {\n type: 'function',\n name: 'TOTAL_PUFFER_REWARDS',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getDuration',\n stateMutability: 'view',\n outputs: [{ type: 'uint32', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'startVesting',\n stateMutability: 'nonpayable',\n inputs: [{ type: 'uint256', name: 'amount', simpleType: 'uint' }],\n outputs: [],\n },\n {\n type: 'function',\n name: 'getSteps',\n stateMutability: 'view',\n outputs: [{ type: 'uint32', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'EXCHANGE_RATE',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'startVestingWithPermit',\n stateMutability: 'nonpayable',\n inputs: [\n {\n type: 'tuple',\n name: 'permitData',\n simpleType: 'tuple',\n components: [\n { type: 'uint256', name: 'deadline', simpleType: 'uint' },\n { type: 'uint256', name: 'amount', simpleType: 'uint' },\n { type: 'uint8', name: 'v', simpleType: 'uint' },\n { type: 'bytes32', name: 'r', simpleType: 'bytes' },\n { type: 'bytes32', name: 's', simpleType: 'bytes' },\n ],\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'CARROT',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getStartTimestamp',\n stateMutability: 'view',\n outputs: [{ type: 'uint48', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'MAX_CARROT_AMOUNT',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n];\n"],"names":["CarrotVesting"],"mappings":"gFAAO,MAAMA,EAAuB,CAClC,CACE,KAAM,WACN,KAAM,2BACN,gBAAiB,OACjB,OAAQ,CAAC,CAAE,KAAM,UAAW,KAAM,OAAQ,WAAY,UAAW,EACjE,QAAS,CAAC,CAAE,KAAM,UAAW,KAAM,GAAI,WAAY,MAAA,CAAQ,CAAA,EAE7D,CACE,KAAM,WACN,KAAM,SACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,UA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,CAAA,CAAC,EAEZ,CACE,KAAM,WACN,KAAM,WACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,SAAU,KAAM,GAAI,WAAY,OAAQ,EAC1D,OAAQ,CAAA,CAAC,EAEX,CACE,KAAM,WACN,KAAM,gBACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,UAAW,KAAM,GAAI,WAAY,OAAQ,EAC3D,OAAQ,CAAA,CAAC,EAEX,CACE,KAAM,WACN,KAAM,yBACN,gBAAiB,aACjB,OAAQ,CACN,CACE,KAAM,QACN,KAAM,aACN,WAAY,QACZ,WAAY,CACV,CAAE,KAAM,UAAW,KAAM,WAAY,WAAY,MAAA,EACjD,CAAE,KAAM,UAAW,KAAM,SAAU,WAAY,MAAA,EAC/C,CAAE,KAAM,QAAS,KAAM,IAAK,WAAY,MAAA,EACxC,CAAE,KAAM,UAAW,KAAM,IAAK,WAAY,OAAA,EAC1C,CAAE,KAAM,UAAW,KAAM,IAAK,WAAY,OAAA,CAAQ,CACpD,CACF,EAEF,QAAS,CAAA,CAAC,EAEZ,CACE,KAAM,WACN,KAAM,SACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,UAAW,KAAM,GAAI,WAAY,UAAW,EAC9D,OAAQ,CAAA,CAAC,EAEX,CACE,KAAM,WACN,KAAM,oBACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,SAAU,KAAM,GAAI,WAAY,OAAQ,EAC1D,OAAQ,CAAA,CAAC,EAEX,CACE,KAAM,WACN,KAAM,oBACN,gBAAiB,OACjB,QAAS,CAAC,CAAE,KAAM,UAAW,KAAM,GAAI,WAAY,OAAQ,EAC3D,OAAQ,CAAA,CAAC,CAEb"}
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
export declare const CarrotVesting: readonly [{
|
|
2
2
|
readonly type: "function";
|
|
3
|
-
readonly name: "
|
|
4
|
-
readonly stateMutability: "view";
|
|
5
|
-
readonly outputs: readonly [{
|
|
6
|
-
readonly type: "uint32";
|
|
7
|
-
readonly name: "";
|
|
8
|
-
readonly simpleType: "uint";
|
|
9
|
-
}];
|
|
10
|
-
readonly inputs: readonly [];
|
|
11
|
-
}, {
|
|
12
|
-
readonly type: "function";
|
|
13
|
-
readonly name: "EXCHANGE_RATE";
|
|
3
|
+
readonly name: "calculateClaimableAmount";
|
|
14
4
|
readonly stateMutability: "view";
|
|
15
|
-
readonly
|
|
16
|
-
readonly type: "
|
|
17
|
-
readonly name: "";
|
|
18
|
-
readonly simpleType: "
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly type: "address";
|
|
7
|
+
readonly name: "user";
|
|
8
|
+
readonly simpleType: "address";
|
|
19
9
|
}];
|
|
20
|
-
readonly inputs: readonly [];
|
|
21
|
-
}, {
|
|
22
|
-
readonly type: "function";
|
|
23
|
-
readonly name: "PUFFER_RECOVERY_GRACE_PERIOD";
|
|
24
|
-
readonly stateMutability: "view";
|
|
25
10
|
readonly outputs: readonly [{
|
|
26
11
|
readonly type: "uint256";
|
|
27
12
|
readonly name: "";
|
|
28
13
|
readonly simpleType: "uint";
|
|
29
14
|
}];
|
|
30
|
-
readonly inputs: readonly [];
|
|
31
15
|
}, {
|
|
32
16
|
readonly type: "function";
|
|
33
17
|
readonly name: "PUFFER";
|
|
@@ -40,33 +24,27 @@ export declare const CarrotVesting: readonly [{
|
|
|
40
24
|
readonly inputs: readonly [];
|
|
41
25
|
}, {
|
|
42
26
|
readonly type: "function";
|
|
43
|
-
readonly name: "
|
|
27
|
+
readonly name: "claim";
|
|
44
28
|
readonly stateMutability: "nonpayable";
|
|
45
|
-
readonly inputs: readonly [];
|
|
46
|
-
readonly outputs: readonly [];
|
|
47
|
-
}, {
|
|
48
|
-
readonly type: "function";
|
|
49
|
-
readonly name: "TOTAL_PUFFER_REWARDS";
|
|
50
|
-
readonly stateMutability: "view";
|
|
51
29
|
readonly outputs: readonly [{
|
|
52
|
-
readonly type: "
|
|
30
|
+
readonly type: "uint128";
|
|
53
31
|
readonly name: "";
|
|
54
32
|
readonly simpleType: "uint";
|
|
55
33
|
}];
|
|
56
34
|
readonly inputs: readonly [];
|
|
57
35
|
}, {
|
|
58
36
|
readonly type: "function";
|
|
59
|
-
readonly name: "
|
|
60
|
-
readonly stateMutability: "
|
|
37
|
+
readonly name: "owner";
|
|
38
|
+
readonly stateMutability: "view";
|
|
61
39
|
readonly outputs: readonly [{
|
|
62
|
-
readonly type: "
|
|
40
|
+
readonly type: "address";
|
|
63
41
|
readonly name: "";
|
|
64
|
-
readonly simpleType: "
|
|
42
|
+
readonly simpleType: "address";
|
|
65
43
|
}];
|
|
66
44
|
readonly inputs: readonly [];
|
|
67
45
|
}, {
|
|
68
46
|
readonly type: "function";
|
|
69
|
-
readonly name: "
|
|
47
|
+
readonly name: "getTotalDepositedAmount";
|
|
70
48
|
readonly stateMutability: "view";
|
|
71
49
|
readonly outputs: readonly [{
|
|
72
50
|
readonly type: "uint128";
|
|
@@ -76,83 +54,117 @@ export declare const CarrotVesting: readonly [{
|
|
|
76
54
|
readonly inputs: readonly [];
|
|
77
55
|
}, {
|
|
78
56
|
readonly type: "function";
|
|
79
|
-
readonly name: "
|
|
80
|
-
readonly stateMutability: "
|
|
57
|
+
readonly name: "getVestings";
|
|
58
|
+
readonly stateMutability: "view";
|
|
81
59
|
readonly inputs: readonly [{
|
|
82
|
-
readonly type: "
|
|
83
|
-
readonly name: "
|
|
84
|
-
readonly simpleType: "
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
readonly name: "user";
|
|
62
|
+
readonly simpleType: "address";
|
|
63
|
+
}];
|
|
64
|
+
readonly outputs: readonly [{
|
|
65
|
+
readonly type: "tuple[]";
|
|
66
|
+
readonly name: "";
|
|
67
|
+
readonly simpleType: "slice";
|
|
68
|
+
readonly nestedType: {
|
|
69
|
+
readonly type: "tuple";
|
|
70
|
+
};
|
|
85
71
|
readonly components: readonly [{
|
|
86
|
-
readonly type: "
|
|
87
|
-
readonly name: "
|
|
72
|
+
readonly type: "uint128";
|
|
73
|
+
readonly name: "depositedAmount";
|
|
88
74
|
readonly simpleType: "uint";
|
|
89
75
|
}, {
|
|
90
|
-
readonly type: "
|
|
91
|
-
readonly name: "
|
|
76
|
+
readonly type: "uint128";
|
|
77
|
+
readonly name: "claimedAmount";
|
|
92
78
|
readonly simpleType: "uint";
|
|
93
79
|
}, {
|
|
94
|
-
readonly type: "
|
|
95
|
-
readonly name: "
|
|
80
|
+
readonly type: "uint48";
|
|
81
|
+
readonly name: "lastClaimedTimestamp";
|
|
96
82
|
readonly simpleType: "uint";
|
|
97
83
|
}, {
|
|
98
|
-
readonly type: "
|
|
99
|
-
readonly name: "
|
|
100
|
-
readonly simpleType: "
|
|
101
|
-
}, {
|
|
102
|
-
readonly type: "bytes32";
|
|
103
|
-
readonly name: "s";
|
|
104
|
-
readonly simpleType: "bytes";
|
|
84
|
+
readonly type: "uint48";
|
|
85
|
+
readonly name: "depositedTimestamp";
|
|
86
|
+
readonly simpleType: "uint";
|
|
105
87
|
}];
|
|
106
88
|
}];
|
|
107
|
-
readonly outputs: readonly [];
|
|
108
89
|
}, {
|
|
109
90
|
readonly type: "function";
|
|
110
|
-
readonly name: "
|
|
91
|
+
readonly name: "TOTAL_PUFFER_REWARDS";
|
|
111
92
|
readonly stateMutability: "view";
|
|
112
93
|
readonly outputs: readonly [{
|
|
113
|
-
readonly type: "
|
|
94
|
+
readonly type: "uint256";
|
|
114
95
|
readonly name: "";
|
|
115
96
|
readonly simpleType: "uint";
|
|
116
97
|
}];
|
|
117
98
|
readonly inputs: readonly [];
|
|
118
99
|
}, {
|
|
119
100
|
readonly type: "function";
|
|
120
|
-
readonly name: "
|
|
101
|
+
readonly name: "getDuration";
|
|
121
102
|
readonly stateMutability: "view";
|
|
122
103
|
readonly outputs: readonly [{
|
|
123
|
-
readonly type: "
|
|
104
|
+
readonly type: "uint32";
|
|
124
105
|
readonly name: "";
|
|
125
106
|
readonly simpleType: "uint";
|
|
126
107
|
}];
|
|
127
108
|
readonly inputs: readonly [];
|
|
128
109
|
}, {
|
|
129
110
|
readonly type: "function";
|
|
130
|
-
readonly name: "
|
|
111
|
+
readonly name: "startVesting";
|
|
112
|
+
readonly stateMutability: "nonpayable";
|
|
113
|
+
readonly inputs: readonly [{
|
|
114
|
+
readonly type: "uint256";
|
|
115
|
+
readonly name: "amount";
|
|
116
|
+
readonly simpleType: "uint";
|
|
117
|
+
}];
|
|
118
|
+
readonly outputs: readonly [];
|
|
119
|
+
}, {
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
readonly name: "getSteps";
|
|
131
122
|
readonly stateMutability: "view";
|
|
132
123
|
readonly outputs: readonly [{
|
|
133
|
-
readonly type: "
|
|
124
|
+
readonly type: "uint32";
|
|
134
125
|
readonly name: "";
|
|
135
|
-
readonly simpleType: "
|
|
126
|
+
readonly simpleType: "uint";
|
|
136
127
|
}];
|
|
137
128
|
readonly inputs: readonly [];
|
|
138
129
|
}, {
|
|
139
130
|
readonly type: "function";
|
|
140
|
-
readonly name: "
|
|
131
|
+
readonly name: "EXCHANGE_RATE";
|
|
141
132
|
readonly stateMutability: "view";
|
|
142
133
|
readonly outputs: readonly [{
|
|
143
|
-
readonly type: "
|
|
134
|
+
readonly type: "uint256";
|
|
144
135
|
readonly name: "";
|
|
145
136
|
readonly simpleType: "uint";
|
|
146
137
|
}];
|
|
147
138
|
readonly inputs: readonly [];
|
|
148
139
|
}, {
|
|
149
140
|
readonly type: "function";
|
|
150
|
-
readonly name: "
|
|
141
|
+
readonly name: "startVestingWithPermit";
|
|
151
142
|
readonly stateMutability: "nonpayable";
|
|
152
143
|
readonly inputs: readonly [{
|
|
153
|
-
readonly type: "
|
|
154
|
-
readonly name: "
|
|
155
|
-
readonly simpleType: "
|
|
144
|
+
readonly type: "tuple";
|
|
145
|
+
readonly name: "permitData";
|
|
146
|
+
readonly simpleType: "tuple";
|
|
147
|
+
readonly components: readonly [{
|
|
148
|
+
readonly type: "uint256";
|
|
149
|
+
readonly name: "deadline";
|
|
150
|
+
readonly simpleType: "uint";
|
|
151
|
+
}, {
|
|
152
|
+
readonly type: "uint256";
|
|
153
|
+
readonly name: "amount";
|
|
154
|
+
readonly simpleType: "uint";
|
|
155
|
+
}, {
|
|
156
|
+
readonly type: "uint8";
|
|
157
|
+
readonly name: "v";
|
|
158
|
+
readonly simpleType: "uint";
|
|
159
|
+
}, {
|
|
160
|
+
readonly type: "bytes32";
|
|
161
|
+
readonly name: "r";
|
|
162
|
+
readonly simpleType: "bytes";
|
|
163
|
+
}, {
|
|
164
|
+
readonly type: "bytes32";
|
|
165
|
+
readonly name: "s";
|
|
166
|
+
readonly simpleType: "bytes";
|
|
167
|
+
}];
|
|
156
168
|
}];
|
|
157
169
|
readonly outputs: readonly [];
|
|
158
170
|
}, {
|
|
@@ -167,42 +179,22 @@ export declare const CarrotVesting: readonly [{
|
|
|
167
179
|
readonly inputs: readonly [];
|
|
168
180
|
}, {
|
|
169
181
|
readonly type: "function";
|
|
170
|
-
readonly name: "
|
|
182
|
+
readonly name: "getStartTimestamp";
|
|
171
183
|
readonly stateMutability: "view";
|
|
172
|
-
readonly inputs: readonly [{
|
|
173
|
-
readonly type: "address";
|
|
174
|
-
readonly name: "user";
|
|
175
|
-
readonly simpleType: "address";
|
|
176
|
-
}];
|
|
177
184
|
readonly outputs: readonly [{
|
|
178
|
-
readonly type: "uint128";
|
|
179
|
-
readonly name: "depositedAmount";
|
|
180
|
-
readonly simpleType: "uint";
|
|
181
|
-
}, {
|
|
182
|
-
readonly type: "uint128";
|
|
183
|
-
readonly name: "claimedAmount";
|
|
184
|
-
readonly simpleType: "uint";
|
|
185
|
-
}, {
|
|
186
185
|
readonly type: "uint48";
|
|
187
|
-
readonly name: "
|
|
188
|
-
readonly simpleType: "uint";
|
|
189
|
-
}, {
|
|
190
|
-
readonly type: "uint48";
|
|
191
|
-
readonly name: "depositedTimestamp";
|
|
186
|
+
readonly name: "";
|
|
192
187
|
readonly simpleType: "uint";
|
|
193
188
|
}];
|
|
189
|
+
readonly inputs: readonly [];
|
|
194
190
|
}, {
|
|
195
191
|
readonly type: "function";
|
|
196
|
-
readonly name: "
|
|
192
|
+
readonly name: "MAX_CARROT_AMOUNT";
|
|
197
193
|
readonly stateMutability: "view";
|
|
198
|
-
readonly inputs: readonly [{
|
|
199
|
-
readonly type: "address";
|
|
200
|
-
readonly name: "user";
|
|
201
|
-
readonly simpleType: "address";
|
|
202
|
-
}];
|
|
203
194
|
readonly outputs: readonly [{
|
|
204
|
-
readonly type: "
|
|
195
|
+
readonly type: "uint256";
|
|
205
196
|
readonly name: "";
|
|
206
197
|
readonly simpleType: "uint";
|
|
207
198
|
}];
|
|
199
|
+
readonly inputs: readonly [];
|
|
208
200
|
}];
|
|
@@ -1,38 +1,58 @@
|
|
|
1
1
|
const t = [
|
|
2
2
|
{
|
|
3
3
|
type: "function",
|
|
4
|
-
name: "
|
|
4
|
+
name: "calculateClaimableAmount",
|
|
5
5
|
stateMutability: "view",
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
inputs: [{ type: "address", name: "user", simpleType: "address" }],
|
|
7
|
+
outputs: [{ type: "uint256", name: "", simpleType: "uint" }]
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
type: "function",
|
|
11
|
-
name: "
|
|
11
|
+
name: "PUFFER",
|
|
12
12
|
stateMutability: "view",
|
|
13
|
-
outputs: [{ type: "
|
|
13
|
+
outputs: [{ type: "address", name: "", simpleType: "address" }],
|
|
14
14
|
inputs: []
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
type: "function",
|
|
18
|
-
name: "
|
|
19
|
-
stateMutability: "
|
|
20
|
-
outputs: [{ type: "
|
|
18
|
+
name: "claim",
|
|
19
|
+
stateMutability: "nonpayable",
|
|
20
|
+
outputs: [{ type: "uint128", name: "", simpleType: "uint" }],
|
|
21
21
|
inputs: []
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
type: "function",
|
|
25
|
-
name: "
|
|
25
|
+
name: "owner",
|
|
26
26
|
stateMutability: "view",
|
|
27
27
|
outputs: [{ type: "address", name: "", simpleType: "address" }],
|
|
28
28
|
inputs: []
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
type: "function",
|
|
32
|
-
name: "
|
|
33
|
-
stateMutability: "
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
name: "getTotalDepositedAmount",
|
|
33
|
+
stateMutability: "view",
|
|
34
|
+
outputs: [{ type: "uint128", name: "", simpleType: "uint" }],
|
|
35
|
+
inputs: []
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "function",
|
|
39
|
+
name: "getVestings",
|
|
40
|
+
stateMutability: "view",
|
|
41
|
+
inputs: [{ type: "address", name: "user", simpleType: "address" }],
|
|
42
|
+
outputs: [
|
|
43
|
+
{
|
|
44
|
+
type: "tuple[]",
|
|
45
|
+
name: "",
|
|
46
|
+
simpleType: "slice",
|
|
47
|
+
nestedType: { type: "tuple" },
|
|
48
|
+
components: [
|
|
49
|
+
{ type: "uint128", name: "depositedAmount", simpleType: "uint" },
|
|
50
|
+
{ type: "uint128", name: "claimedAmount", simpleType: "uint" },
|
|
51
|
+
{ type: "uint48", name: "lastClaimedTimestamp", simpleType: "uint" },
|
|
52
|
+
{ type: "uint48", name: "depositedTimestamp", simpleType: "uint" }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
36
56
|
},
|
|
37
57
|
{
|
|
38
58
|
type: "function",
|
|
@@ -43,16 +63,30 @@ const t = [
|
|
|
43
63
|
},
|
|
44
64
|
{
|
|
45
65
|
type: "function",
|
|
46
|
-
name: "
|
|
66
|
+
name: "getDuration",
|
|
67
|
+
stateMutability: "view",
|
|
68
|
+
outputs: [{ type: "uint32", name: "", simpleType: "uint" }],
|
|
69
|
+
inputs: []
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: "function",
|
|
73
|
+
name: "startVesting",
|
|
47
74
|
stateMutability: "nonpayable",
|
|
48
|
-
|
|
75
|
+
inputs: [{ type: "uint256", name: "amount", simpleType: "uint" }],
|
|
76
|
+
outputs: []
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "function",
|
|
80
|
+
name: "getSteps",
|
|
81
|
+
stateMutability: "view",
|
|
82
|
+
outputs: [{ type: "uint32", name: "", simpleType: "uint" }],
|
|
49
83
|
inputs: []
|
|
50
84
|
},
|
|
51
85
|
{
|
|
52
86
|
type: "function",
|
|
53
|
-
name: "
|
|
87
|
+
name: "EXCHANGE_RATE",
|
|
54
88
|
stateMutability: "view",
|
|
55
|
-
outputs: [{ type: "
|
|
89
|
+
outputs: [{ type: "uint256", name: "", simpleType: "uint" }],
|
|
56
90
|
inputs: []
|
|
57
91
|
},
|
|
58
92
|
{
|
|
@@ -77,64 +111,24 @@ const t = [
|
|
|
77
111
|
},
|
|
78
112
|
{
|
|
79
113
|
type: "function",
|
|
80
|
-
name: "
|
|
81
|
-
stateMutability: "view",
|
|
82
|
-
outputs: [{ type: "uint48", name: "", simpleType: "uint" }],
|
|
83
|
-
inputs: []
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: "function",
|
|
87
|
-
name: "MAX_CARROT_AMOUNT",
|
|
88
|
-
stateMutability: "view",
|
|
89
|
-
outputs: [{ type: "uint256", name: "", simpleType: "uint" }],
|
|
90
|
-
inputs: []
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
type: "function",
|
|
94
|
-
name: "owner",
|
|
114
|
+
name: "CARROT",
|
|
95
115
|
stateMutability: "view",
|
|
96
116
|
outputs: [{ type: "address", name: "", simpleType: "address" }],
|
|
97
117
|
inputs: []
|
|
98
118
|
},
|
|
99
119
|
{
|
|
100
120
|
type: "function",
|
|
101
|
-
name: "
|
|
121
|
+
name: "getStartTimestamp",
|
|
102
122
|
stateMutability: "view",
|
|
103
|
-
outputs: [{ type: "
|
|
123
|
+
outputs: [{ type: "uint48", name: "", simpleType: "uint" }],
|
|
104
124
|
inputs: []
|
|
105
125
|
},
|
|
106
126
|
{
|
|
107
127
|
type: "function",
|
|
108
|
-
name: "
|
|
109
|
-
stateMutability: "nonpayable",
|
|
110
|
-
inputs: [{ type: "uint256", name: "amount", simpleType: "uint" }],
|
|
111
|
-
outputs: []
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
type: "function",
|
|
115
|
-
name: "CARROT",
|
|
128
|
+
name: "MAX_CARROT_AMOUNT",
|
|
116
129
|
stateMutability: "view",
|
|
117
|
-
outputs: [{ type: "
|
|
130
|
+
outputs: [{ type: "uint256", name: "", simpleType: "uint" }],
|
|
118
131
|
inputs: []
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
type: "function",
|
|
122
|
-
name: "vestings",
|
|
123
|
-
stateMutability: "view",
|
|
124
|
-
inputs: [{ type: "address", name: "user", simpleType: "address" }],
|
|
125
|
-
outputs: [
|
|
126
|
-
{ type: "uint128", name: "depositedAmount", simpleType: "uint" },
|
|
127
|
-
{ type: "uint128", name: "claimedAmount", simpleType: "uint" },
|
|
128
|
-
{ type: "uint48", name: "lastClaimedTimestamp", simpleType: "uint" },
|
|
129
|
-
{ type: "uint48", name: "depositedTimestamp", simpleType: "uint" }
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: "function",
|
|
134
|
-
name: "calculateClaimableAmount",
|
|
135
|
-
stateMutability: "view",
|
|
136
|
-
inputs: [{ type: "address", name: "user", simpleType: "address" }],
|
|
137
|
-
outputs: [{ type: "uint128", name: "", simpleType: "uint" }]
|
|
138
132
|
}
|
|
139
133
|
];
|
|
140
134
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarrotVesting.js","sources":["../../../../lib/contracts/abis/mainnet/CarrotVesting.ts"],"sourcesContent":["export const CarrotVesting = <const>[\n {\n type: 'function',\n name: '
|
|
1
|
+
{"version":3,"file":"CarrotVesting.js","sources":["../../../../lib/contracts/abis/mainnet/CarrotVesting.ts"],"sourcesContent":["export const CarrotVesting = <const>[\n {\n type: 'function',\n name: 'calculateClaimableAmount',\n stateMutability: 'view',\n inputs: [{ type: 'address', name: 'user', simpleType: 'address' }],\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n },\n {\n type: 'function',\n name: 'PUFFER',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'claim',\n stateMutability: 'nonpayable',\n outputs: [{ type: 'uint128', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'owner',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getTotalDepositedAmount',\n stateMutability: 'view',\n outputs: [{ type: 'uint128', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getVestings',\n stateMutability: 'view',\n inputs: [{ type: 'address', name: 'user', simpleType: 'address' }],\n outputs: [\n {\n type: 'tuple[]',\n name: '',\n simpleType: 'slice',\n nestedType: { type: 'tuple' },\n components: [\n { type: 'uint128', name: 'depositedAmount', simpleType: 'uint' },\n { type: 'uint128', name: 'claimedAmount', simpleType: 'uint' },\n { type: 'uint48', name: 'lastClaimedTimestamp', simpleType: 'uint' },\n { type: 'uint48', name: 'depositedTimestamp', simpleType: 'uint' },\n ],\n },\n ],\n },\n {\n type: 'function',\n name: 'TOTAL_PUFFER_REWARDS',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getDuration',\n stateMutability: 'view',\n outputs: [{ type: 'uint32', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'startVesting',\n stateMutability: 'nonpayable',\n inputs: [{ type: 'uint256', name: 'amount', simpleType: 'uint' }],\n outputs: [],\n },\n {\n type: 'function',\n name: 'getSteps',\n stateMutability: 'view',\n outputs: [{ type: 'uint32', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'EXCHANGE_RATE',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'startVestingWithPermit',\n stateMutability: 'nonpayable',\n inputs: [\n {\n type: 'tuple',\n name: 'permitData',\n simpleType: 'tuple',\n components: [\n { type: 'uint256', name: 'deadline', simpleType: 'uint' },\n { type: 'uint256', name: 'amount', simpleType: 'uint' },\n { type: 'uint8', name: 'v', simpleType: 'uint' },\n { type: 'bytes32', name: 'r', simpleType: 'bytes' },\n { type: 'bytes32', name: 's', simpleType: 'bytes' },\n ],\n },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'CARROT',\n stateMutability: 'view',\n outputs: [{ type: 'address', name: '', simpleType: 'address' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'getStartTimestamp',\n stateMutability: 'view',\n outputs: [{ type: 'uint48', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n {\n type: 'function',\n name: 'MAX_CARROT_AMOUNT',\n stateMutability: 'view',\n outputs: [{ type: 'uint256', name: '', simpleType: 'uint' }],\n inputs: [],\n },\n];\n"],"names":["CarrotVesting"],"mappings":"AAAO,MAAMA,IAAuB;AAAA,EAClC;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ,CAAC,EAAE,MAAM,WAAW,MAAM,QAAQ,YAAY,WAAW;AAAA,IACjE,SAAS,CAAC,EAAE,MAAM,WAAW,MAAM,IAAI,YAAY,OAAA,CAAQ;AAAA,EAAA;AAAA,EAE7D;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,SAAS,CAAC,EAAE,MAAM,WAAW,MAAM,IAAI,YAAY,WAAW;AAAA,IAC9D,QAAQ,CAAA;AAAA,EAAC;AAAA,EAEX;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBA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M,IAAI,YAAY,WAAW;AAAA,IAC9D,QAAQ,CAAA;AAAA,EAAC;AAAA,EAEX;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,SAAS,CAAC,EAAE,MAAM,UAAU,MAAM,IAAI,YAAY,QAAQ;AAAA,IAC1D,QAAQ,CAAA;AAAA,EAAC;AAAA,EAEX;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,SAAS,CAAC,EAAE,MAAM,WAAW,MAAM,IAAI,YAAY,QAAQ;AAAA,IAC3D,QAAQ,CAAA;AAAA,EAAC;AAEb;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants-6kuRTsbU.cjs"),a={[e.Chain.Mainnet]:{PufferVault:"0xD9A442856C234a39a81a089C06451EBAa4306a72",PufferDepositor:"0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff",PufferL2Depositor:"0x3436E0B85cd929929F5802e792CFE282166E0259",PufLocker:"0x48e8dE138C246c14248C94d2D616a2F9eb4590D2",L1RewardManager:"0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b",L2RewardManager:"0x0000000000000000000000000000000000000000",PufferWithdrawalManager:"0xDdA0483184E75a5579ef9635ED14BacCf9d50283",NucleusAtomicQueue:"0x228c44bb4885c6633f4b6c83f14622f37d5112e5",CarrotStaker:"0x99c599227c65132822f0290d9e5b4b0430d6c0d6",Distributor:"0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae",ValidatorTicket:"0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A",PufferOracleV2:"0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f",PufferProtocol:"0xf7b6B32492c2e13799D921E84202450131bd238B",GuardianModule:"0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2",GaugeRegistry:"0x0000000000000000000000000000000000000000",CarrotVesting:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants-6kuRTsbU.cjs"),a={[e.Chain.Mainnet]:{PufferVault:"0xD9A442856C234a39a81a089C06451EBAa4306a72",PufferDepositor:"0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff",PufferL2Depositor:"0x3436E0B85cd929929F5802e792CFE282166E0259",PufLocker:"0x48e8dE138C246c14248C94d2D616a2F9eb4590D2",L1RewardManager:"0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b",L2RewardManager:"0x0000000000000000000000000000000000000000",PufferWithdrawalManager:"0xDdA0483184E75a5579ef9635ED14BacCf9d50283",NucleusAtomicQueue:"0x228c44bb4885c6633f4b6c83f14622f37d5112e5",CarrotStaker:"0x99c599227c65132822f0290d9e5b4b0430d6c0d6",Distributor:"0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae",ValidatorTicket:"0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A",PufferOracleV2:"0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f",PufferProtocol:"0xf7b6B32492c2e13799D921E84202450131bd238B",GuardianModule:"0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2",GaugeRegistry:"0x0000000000000000000000000000000000000000",CarrotVesting:"0xff00c2dd07d811bea632cb9f9e4919dd6fcbc82b"},[e.Chain.Holesky]:{PufferVault:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9",PufferDepositor:"0x824AC05aeb86A0aD770b8acDe0906d2d4a6c4A8c",PufferL2Depositor:"0x0af6998e4828ad8ef8f79a9288d0a861890f791d",PufLocker:"0xa58983ad0899a452b7420bc57228e329d7ba92b6",L1RewardManager:"0x10f970bcb84B82B82a65eBCbF45F26dD26D69F12",L2RewardManager:"0x58C046794f69A8830b0BE737022a45b4acd01dE5",PufferWithdrawalManager:"0x5A3E1069B66800c0ecbc91bd81b1AE4D1804DBc4",ValidatorTicket:"0xB028194785178a94Fe608994A4d5AD84c285A640",PufferOracleV2:"0x8e043ed3f06720615685d4978770cd5c8fe90fe3",PufferProtocol:"0xE00c79408B9De5BaD2FDEbB1688997a68eC988CD",GuardianModule:"0x0910310130d1c062def8b807528bdac80203bc66",GaugeRegistry:"0x0000000000000000000000000000000000000000",CarrotVesting:"0x0000000000000000000000000000000000000000"},[e.Chain.Sepolia]:{GaugeRegistry:"0x14b25b3a3C1e6032e7Fbf0309d1ef6881e9A8D7A"},[e.Chain.Base]:{L2RewardManager:"0xF9Dd335bF363b2E4ecFe3c94A86EBD7Dd3Dcf0e7"}};exports.CONTRACT_ADDRESSES=a;
|
|
2
2
|
//# sourceMappingURL=addresses.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.cjs","sources":["../../lib/contracts/addresses.ts"],"sourcesContent":["import { Chain } from '../chains/constants';\n\n// Source of truth:\n// https://github.com/PufferFinance/Deployments-and-ACL/tree/main/docs/deployments\nexport const CONTRACT_ADDRESSES = {\n // Casting to number so the consumer can use chain ids. Also not using\n // a generic type for the variable so the consumer knows which\n // contracts can be accessed.\n [Chain.Mainnet as number]: {\n PufferVault: '0xD9A442856C234a39a81a089C06451EBAa4306a72',\n PufferDepositor: '0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff',\n PufferL2Depositor: '0x3436E0B85cd929929F5802e792CFE282166E0259',\n PufLocker: '0x48e8dE138C246c14248C94d2D616a2F9eb4590D2',\n L1RewardManager: '0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b',\n // L2RewardManager is not deployed to mainnet but base.\n L2RewardManager: '0x0000000000000000000000000000000000000000',\n PufferWithdrawalManager: '0xDdA0483184E75a5579ef9635ED14BacCf9d50283',\n NucleusAtomicQueue: '0x228c44bb4885c6633f4b6c83f14622f37d5112e5',\n CarrotStaker: '0x99c599227c65132822f0290d9e5b4b0430d6c0d6',\n Distributor: '0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae',\n ValidatorTicket: '0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A',\n PufferOracleV2: '0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f',\n PufferProtocol: '0xf7b6B32492c2e13799D921E84202450131bd238B',\n GuardianModule: '0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '
|
|
1
|
+
{"version":3,"file":"addresses.cjs","sources":["../../lib/contracts/addresses.ts"],"sourcesContent":["import { Chain } from '../chains/constants';\n\n// Source of truth:\n// https://github.com/PufferFinance/Deployments-and-ACL/tree/main/docs/deployments\nexport const CONTRACT_ADDRESSES = {\n // Casting to number so the consumer can use chain ids. Also not using\n // a generic type for the variable so the consumer knows which\n // contracts can be accessed.\n [Chain.Mainnet as number]: {\n PufferVault: '0xD9A442856C234a39a81a089C06451EBAa4306a72',\n PufferDepositor: '0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff',\n PufferL2Depositor: '0x3436E0B85cd929929F5802e792CFE282166E0259',\n PufLocker: '0x48e8dE138C246c14248C94d2D616a2F9eb4590D2',\n L1RewardManager: '0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b',\n // L2RewardManager is not deployed to mainnet but base.\n L2RewardManager: '0x0000000000000000000000000000000000000000',\n PufferWithdrawalManager: '0xDdA0483184E75a5579ef9635ED14BacCf9d50283',\n NucleusAtomicQueue: '0x228c44bb4885c6633f4b6c83f14622f37d5112e5',\n CarrotStaker: '0x99c599227c65132822f0290d9e5b4b0430d6c0d6',\n Distributor: '0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae',\n ValidatorTicket: '0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A',\n PufferOracleV2: '0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f',\n PufferProtocol: '0xf7b6B32492c2e13799D921E84202450131bd238B',\n GuardianModule: '0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '0xff00c2dd07d811bea632cb9f9e4919dd6fcbc82b',\n },\n [Chain.Holesky as number]: {\n PufferVault: '0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9',\n PufferDepositor: '0x824AC05aeb86A0aD770b8acDe0906d2d4a6c4A8c',\n PufferL2Depositor: '0x0af6998e4828ad8ef8f79a9288d0a861890f791d',\n PufLocker: '0xa58983ad0899a452b7420bc57228e329d7ba92b6',\n L1RewardManager: '0x10f970bcb84B82B82a65eBCbF45F26dD26D69F12',\n L2RewardManager: '0x58C046794f69A8830b0BE737022a45b4acd01dE5',\n PufferWithdrawalManager: '0x5A3E1069B66800c0ecbc91bd81b1AE4D1804DBc4',\n ValidatorTicket: '0xB028194785178a94Fe608994A4d5AD84c285A640',\n PufferOracleV2: '0x8e043ed3f06720615685d4978770cd5c8fe90fe3',\n PufferProtocol: '0xE00c79408B9De5BaD2FDEbB1688997a68eC988CD',\n GuardianModule: '0x0910310130d1c062def8b807528bdac80203bc66',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '0x0000000000000000000000000000000000000000',\n },\n [Chain.Sepolia as number]: {\n GaugeRegistry: '0x14b25b3a3C1e6032e7Fbf0309d1ef6881e9A8D7A',\n },\n [Chain.Base as number]: {\n L2RewardManager: '0xF9Dd335bF363b2E4ecFe3c94A86EBD7Dd3Dcf0e7',\n },\n};\n"],"names":["CONTRACT_ADDRESSES","Chain"],"mappings":"6HAIaA,EAAqB,CAIhC,CAACC,EAAAA,MAAM,OAAiB,EAAG,CACzB,YAAa,6CACb,gBAAiB,6CACjB,kBAAmB,6CACnB,UAAW,6CACX,gBAAiB,6CAEjB,gBAAiB,6CACjB,wBAAyB,6CACzB,mBAAoB,6CACpB,aAAc,6CACd,YAAa,6CACb,gBAAiB,6CACjB,eAAgB,6CAChB,eAAgB,6CAChB,eAAgB,6CAChB,cAAe,6CACf,cAAe,4CAAA,EAEjB,CAACA,EAAAA,MAAM,OAAiB,EAAG,CACzB,YAAa,6CACb,gBAAiB,6CACjB,kBAAmB,6CACnB,UAAW,6CACX,gBAAiB,6CACjB,gBAAiB,6CACjB,wBAAyB,6CACzB,gBAAiB,6CACjB,eAAgB,6CAChB,eAAgB,6CAChB,eAAgB,6CAChB,cAAe,6CACf,cAAe,4CAAA,EAEjB,CAACA,EAAAA,MAAM,OAAiB,EAAG,CACzB,cAAe,4CAAA,EAEjB,CAACA,EAAAA,MAAM,IAAc,EAAG,CACtB,gBAAiB,4CAAA,CAErB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as e } from "../constants-CuIEh_ZS.js";
|
|
2
|
-
const
|
|
2
|
+
const f = {
|
|
3
3
|
// Casting to number so the consumer can use chain ids. Also not using
|
|
4
4
|
// a generic type for the variable so the consumer knows which
|
|
5
5
|
// contracts can be accessed.
|
|
@@ -20,7 +20,7 @@ const c = {
|
|
|
20
20
|
PufferProtocol: "0xf7b6B32492c2e13799D921E84202450131bd238B",
|
|
21
21
|
GuardianModule: "0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2",
|
|
22
22
|
GaugeRegistry: "0x0000000000000000000000000000000000000000",
|
|
23
|
-
CarrotVesting: "
|
|
23
|
+
CarrotVesting: "0xff00c2dd07d811bea632cb9f9e4919dd6fcbc82b"
|
|
24
24
|
},
|
|
25
25
|
[e.Holesky]: {
|
|
26
26
|
PufferVault: "0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9",
|
|
@@ -45,6 +45,6 @@ const c = {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
f as CONTRACT_ADDRESSES
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=addresses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.js","sources":["../../lib/contracts/addresses.ts"],"sourcesContent":["import { Chain } from '../chains/constants';\n\n// Source of truth:\n// https://github.com/PufferFinance/Deployments-and-ACL/tree/main/docs/deployments\nexport const CONTRACT_ADDRESSES = {\n // Casting to number so the consumer can use chain ids. Also not using\n // a generic type for the variable so the consumer knows which\n // contracts can be accessed.\n [Chain.Mainnet as number]: {\n PufferVault: '0xD9A442856C234a39a81a089C06451EBAa4306a72',\n PufferDepositor: '0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff',\n PufferL2Depositor: '0x3436E0B85cd929929F5802e792CFE282166E0259',\n PufLocker: '0x48e8dE138C246c14248C94d2D616a2F9eb4590D2',\n L1RewardManager: '0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b',\n // L2RewardManager is not deployed to mainnet but base.\n L2RewardManager: '0x0000000000000000000000000000000000000000',\n PufferWithdrawalManager: '0xDdA0483184E75a5579ef9635ED14BacCf9d50283',\n NucleusAtomicQueue: '0x228c44bb4885c6633f4b6c83f14622f37d5112e5',\n CarrotStaker: '0x99c599227c65132822f0290d9e5b4b0430d6c0d6',\n Distributor: '0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae',\n ValidatorTicket: '0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A',\n PufferOracleV2: '0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f',\n PufferProtocol: '0xf7b6B32492c2e13799D921E84202450131bd238B',\n GuardianModule: '0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '
|
|
1
|
+
{"version":3,"file":"addresses.js","sources":["../../lib/contracts/addresses.ts"],"sourcesContent":["import { Chain } from '../chains/constants';\n\n// Source of truth:\n// https://github.com/PufferFinance/Deployments-and-ACL/tree/main/docs/deployments\nexport const CONTRACT_ADDRESSES = {\n // Casting to number so the consumer can use chain ids. Also not using\n // a generic type for the variable so the consumer knows which\n // contracts can be accessed.\n [Chain.Mainnet as number]: {\n PufferVault: '0xD9A442856C234a39a81a089C06451EBAa4306a72',\n PufferDepositor: '0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff',\n PufferL2Depositor: '0x3436E0B85cd929929F5802e792CFE282166E0259',\n PufLocker: '0x48e8dE138C246c14248C94d2D616a2F9eb4590D2',\n L1RewardManager: '0x157788cc028Ac6405bD406f2D1e0A8A22b3cf17b',\n // L2RewardManager is not deployed to mainnet but base.\n L2RewardManager: '0x0000000000000000000000000000000000000000',\n PufferWithdrawalManager: '0xDdA0483184E75a5579ef9635ED14BacCf9d50283',\n NucleusAtomicQueue: '0x228c44bb4885c6633f4b6c83f14622f37d5112e5',\n CarrotStaker: '0x99c599227c65132822f0290d9e5b4b0430d6c0d6',\n Distributor: '0x3Ef3D8bA38EBe18DB133cEc108f4D14CE00Dd9Ae',\n ValidatorTicket: '0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A',\n PufferOracleV2: '0x0BE2aE0edbeBb517541DF217EF0074FC9a9e994f',\n PufferProtocol: '0xf7b6B32492c2e13799D921E84202450131bd238B',\n GuardianModule: '0x628b183F248a142A598AA2dcCCD6f7E480a7CcF2',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '0xff00c2dd07d811bea632cb9f9e4919dd6fcbc82b',\n },\n [Chain.Holesky as number]: {\n PufferVault: '0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9',\n PufferDepositor: '0x824AC05aeb86A0aD770b8acDe0906d2d4a6c4A8c',\n PufferL2Depositor: '0x0af6998e4828ad8ef8f79a9288d0a861890f791d',\n PufLocker: '0xa58983ad0899a452b7420bc57228e329d7ba92b6',\n L1RewardManager: '0x10f970bcb84B82B82a65eBCbF45F26dD26D69F12',\n L2RewardManager: '0x58C046794f69A8830b0BE737022a45b4acd01dE5',\n PufferWithdrawalManager: '0x5A3E1069B66800c0ecbc91bd81b1AE4D1804DBc4',\n ValidatorTicket: '0xB028194785178a94Fe608994A4d5AD84c285A640',\n PufferOracleV2: '0x8e043ed3f06720615685d4978770cd5c8fe90fe3',\n PufferProtocol: '0xE00c79408B9De5BaD2FDEbB1688997a68eC988CD',\n GuardianModule: '0x0910310130d1c062def8b807528bdac80203bc66',\n GaugeRegistry: '0x0000000000000000000000000000000000000000',\n CarrotVesting: '0x0000000000000000000000000000000000000000',\n },\n [Chain.Sepolia as number]: {\n GaugeRegistry: '0x14b25b3a3C1e6032e7Fbf0309d1ef6881e9A8D7A',\n },\n [Chain.Base as number]: {\n L2RewardManager: '0xF9Dd335bF363b2E4ecFe3c94A86EBD7Dd3Dcf0e7',\n },\n};\n"],"names":["CONTRACT_ADDRESSES","Chain"],"mappings":";AAIO,MAAMA,IAAqB;AAAA;AAAA;AAAA;AAAA,EAIhC,CAACC,EAAM,OAAiB,GAAG;AAAA,IACzB,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,iBAAiB;AAAA;AAAA,IAEjB,iBAAiB;AAAA,IACjB,yBAAyB;AAAA,IACzB,oBAAoB;AAAA,IACpB,cAAc;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,eAAe;AAAA,EAAA;AAAA,EAEjB,CAACA,EAAM,OAAiB,GAAG;AAAA,IACzB,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,yBAAyB;AAAA,IACzB,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,eAAe;AAAA,EAAA;AAAA,EAEjB,CAACA,EAAM,OAAiB,GAAG;AAAA,IACzB,eAAe;AAAA,EAAA;AAAA,EAEjB,CAACA,EAAM,IAAc,GAAG;AAAA,IACtB,iBAAiB;AAAA,EAAA;AAErB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../constants-6kuRTsbU.cjs"),i=require("../abis/mainnet/CarrotVesting.cjs"),s=require("../addresses.cjs"),c=require("../tokens.cjs"),o=require("./erc20-permit-handler.cjs"),g=require("../../getContract-D4_SEfqa.cjs");class h{constructor(t,e,r){this.chain=t,this.walletClient=e,this.publicClient=r,this.viemChain=n.VIEM_CHAINS[t],this.erc20PermitHandler=new o.ERC20PermitHandler(t,e,r)}viemChain;erc20PermitHandler;getContract(){const t=s.CONTRACT_ADDRESSES[this.chain].CarrotVesting,e=i.CarrotVesting,r={public:this.publicClient,wallet:this.walletClient};return g.getContract({address:t,abi:e,client:r})}owner(){return this.getContract().read.owner()}calculateClaimableAmount(t){return this.getContract().read.calculateClaimableAmount([t])}exchangeRate(){return this.getContract().read.EXCHANGE_RATE()}claim(){return this.getContract().write.claim({account:this.walletClient.account,chain:this.viemChain})}getCarrotAddress(){return this.getContract().read.CARROT()}getPufferAddress(){return this.getContract().read.PUFFER()}totalPufferRewards(){return this.getContract().read.TOTAL_PUFFER_REWARDS()}getSteps(){return this.getContract().read.getSteps()}maxCarrotAmount(){return this.getContract().read.MAX_CARROT_AMOUNT()}async getVestings(t){return await this.getContract().read.getVestings([t])}getStartTimestamp(){return this.getContract().read.getStartTimestamp()}startVestingPreapproved(t){return this.getContract().write.startVesting([t],{account:this.walletClient.account,chain:this.viemChain})}startVestingWithPermit(t){return this.getContract().write.startVestingWithPermit([t],{account:this.walletClient.account,chain:this.viemChain})}async startVesting(t,e){if(e)return this.startVestingPreapproved(t);const r=this.walletClient.account,a=await this.erc20PermitHandler.withToken(c.Token.CARROT).getPermitData(r.address,this.getContract().address,t);return this.startVestingWithPermit(a)}getTotalDepositedAmount(){return this.getContract().read.getTotalDepositedAmount()}getDuration(){return this.getContract().read.getDuration()}}exports.CarrotVestingHandler=h;
|
|
2
2
|
//# sourceMappingURL=carrot-vesting-handler.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrot-vesting-handler.cjs","sources":["../../../lib/contracts/handlers/carrot-vesting-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { CarrotVesting } from '../abis/mainnet/CarrotVesting';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PermitData } from '../common/lib/types';\nimport { Token } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\n/**\n * Handler for the `CarrotVesting` contract exposing methods to interact\n * with the contract.\n */\nexport class CarrotVestingHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `CarrotVesting` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].CarrotVesting as Address;\n const abi = CarrotVesting;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof CarrotVesting,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Calculate the claimable amount for a user.\n *\n * @param user The user address.\n * @returns The claimable amount.\n */\n public calculateClaimableAmount(user: Address) {\n return this.getContract().read.calculateClaimableAmount([user]);\n }\n\n /**\n * Get the exchange rate.\n *\n * @returns The exchange rate.\n */\n public exchangeRate() {\n return this.getContract().read.EXCHANGE_RATE();\n }\n\n /**\n * Claim vested tokens.\n *\n * @returns The transaction.\n */\n public claim() {\n return this.getContract().write.claim({\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the CARROT token address.\n *\n * @returns The CARROT token address.\n */\n public getCarrotAddress() {\n return this.getContract().read.CARROT();\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public getPufferAddress() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the total puffer rewards.\n *\n * @returns The total puffer rewards.\n */\n public totalPufferRewards() {\n return this.getContract().read.TOTAL_PUFFER_REWARDS();\n }\n\n /**\n * Get the number of vesting steps.\n *\n * @returns The number of vesting steps.\n */\n public
|
|
1
|
+
{"version":3,"file":"carrot-vesting-handler.cjs","sources":["../../../lib/contracts/handlers/carrot-vesting-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { CarrotVesting } from '../abis/mainnet/CarrotVesting';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PermitData } from '../common/lib/types';\nimport { Token } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\n/**\n * Handler for the `CarrotVesting` contract exposing methods to interact\n * with the contract.\n */\nexport class CarrotVestingHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `CarrotVesting` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].CarrotVesting as Address;\n const abi = CarrotVesting;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof CarrotVesting,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Calculate the claimable amount for a user.\n *\n * @param user The user address.\n * @returns The claimable amount.\n */\n public calculateClaimableAmount(user: Address) {\n return this.getContract().read.calculateClaimableAmount([user]);\n }\n\n /**\n * Get the exchange rate.\n *\n * @returns The exchange rate.\n */\n public exchangeRate() {\n return this.getContract().read.EXCHANGE_RATE();\n }\n\n /**\n * Claim vested tokens.\n *\n * @returns The transaction.\n */\n public claim() {\n return this.getContract().write.claim({\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the CARROT token address.\n *\n * @returns The CARROT token address.\n */\n public getCarrotAddress() {\n return this.getContract().read.CARROT();\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public getPufferAddress() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the total puffer rewards.\n *\n * @returns The total puffer rewards.\n */\n public totalPufferRewards() {\n return this.getContract().read.TOTAL_PUFFER_REWARDS();\n }\n\n /**\n * Get the number of vesting steps.\n *\n * @returns The number of vesting steps.\n */\n public getSteps() {\n return this.getContract().read.getSteps();\n }\n\n /**\n * Get the maximum carrot amount.\n *\n * @returns The maximum carrot amount.\n */\n public maxCarrotAmount() {\n return this.getContract().read.MAX_CARROT_AMOUNT();\n }\n\n /**\n * Get vesting information for a user.\n *\n * @param user The user address.\n * @returns The vesting information including deposited amount,\n * claimed amount, last claimed timestamp, and deposited timestamp.\n */\n public async getVestings(user: Address) {\n return await this.getContract().read.getVestings([user]);\n }\n\n /**\n * Get the start timestamp.\n *\n * @returns The start timestamp.\n */\n public getStartTimestamp() {\n return this.getContract().read.getStartTimestamp();\n }\n\n /**\n * Start vesting for a user.\n *\n * @param amount The amount to vest.\n * @returns The transaction.\n */\n public startVestingPreapproved(amount: bigint) {\n return this.getContract().write.startVesting([amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Start vesting with permit.\n *\n * @param permitData The permit data including deadline, amount, v, r, and s values.\n * @returns The transaction.\n */\n public startVestingWithPermit(permitData: PermitData) {\n return this.getContract().write.startVestingWithPermit([permitData], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Start vesting.\n *\n * @param amount The amount to vest.\n * @param isPreapproved Whether the CARROT token is preapproved or\n * should use permit.\n * @returns The transaction.\n */\n public async startVesting(amount: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.startVestingPreapproved(amount);\n }\n\n const account = this.walletClient.account as Account;\n const permitData = await this.erc20PermitHandler\n .withToken(Token.CARROT)\n .getPermitData(account.address, this.getContract().address, amount);\n\n return this.startVestingWithPermit(permitData);\n }\n\n /**\n * Get the total deposited amount.\n *\n * @returns The total deposited amount.\n */\n public getTotalDepositedAmount() {\n return this.getContract().read.getTotalDepositedAmount();\n }\n\n /**\n * Get the duration of the vesting period.\n *\n * @returns The duration of the vesting period.\n */\n public getDuration() {\n return this.getContract().read.getDuration();\n }\n}\n"],"names":["CarrotVestingHandler","chain","walletClient","publicClient","VIEM_CHAINS","ERC20PermitHandler","address","CONTRACT_ADDRESSES","abi","CarrotVesting","client","getContract","user","amount","permitData","isPreapproved","account","Token"],"mappings":"4TAoBO,MAAMA,CAAqB,CAchC,YACUC,EACAC,EACAC,EACR,CAHQ,KAAA,MAAAF,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAER,KAAK,UAAYC,EAAAA,YAAYH,CAAK,EAClC,KAAK,mBAAqB,IAAII,EAAAA,m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CAACA,CAAU,EAAG,CACnE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CACH,CAUA,MAAa,aAAaD,EAAgBE,EAAwB,CAChE,GAAIA,EACF,OAAO,KAAK,wBAAwBF,CAAM,EAG5C,MAAMG,EAAU,KAAK,aAAa,QAC5BF,EAAa,MAAM,KAAK,mBAC3B,UAAUG,EAAAA,MAAM,MAAM,EACtB,cAAcD,EAAQ,QAAS,KAAK,YAAA,EAAc,QAASH,CAAM,EAEpE,OAAO,KAAK,uBAAuBC,CAAU,CAC/C,CAOO,yBAA0B,CAC/B,OAAO,KAAK,cAAc,KAAK,wBAAA,CACjC,CAOO,aAAc,CACnB,OAAO,KAAK,cAAc,KAAK,YAAA,CACjC,CACF"}
|
|
@@ -8126,7 +8126,7 @@ export declare class CarrotVestingHandler {
|
|
|
8126
8126
|
*
|
|
8127
8127
|
* @returns The number of vesting steps.
|
|
8128
8128
|
*/
|
|
8129
|
-
|
|
8129
|
+
getSteps(): Promise<number>;
|
|
8130
8130
|
/**
|
|
8131
8131
|
* Get the maximum carrot amount.
|
|
8132
8132
|
*
|
|
@@ -8140,18 +8140,18 @@ export declare class CarrotVestingHandler {
|
|
|
8140
8140
|
* @returns The vesting information including deposited amount,
|
|
8141
8141
|
* claimed amount, last claimed timestamp, and deposited timestamp.
|
|
8142
8142
|
*/
|
|
8143
|
-
|
|
8143
|
+
getVestings(user: Address): Promise<readonly {
|
|
8144
8144
|
depositedAmount: bigint;
|
|
8145
8145
|
claimedAmount: bigint;
|
|
8146
8146
|
lastClaimedTimestamp: number;
|
|
8147
8147
|
depositedTimestamp: number;
|
|
8148
|
-
}>;
|
|
8148
|
+
}[]>;
|
|
8149
8149
|
/**
|
|
8150
8150
|
* Get the start timestamp.
|
|
8151
8151
|
*
|
|
8152
8152
|
* @returns The start timestamp.
|
|
8153
8153
|
*/
|
|
8154
|
-
|
|
8154
|
+
getStartTimestamp(): Promise<number>;
|
|
8155
8155
|
/**
|
|
8156
8156
|
* Start vesting for a user.
|
|
8157
8157
|
*
|
|
@@ -8180,11 +8180,11 @@ export declare class CarrotVestingHandler {
|
|
|
8180
8180
|
*
|
|
8181
8181
|
* @returns The total deposited amount.
|
|
8182
8182
|
*/
|
|
8183
|
-
|
|
8183
|
+
getTotalDepositedAmount(): Promise<bigint>;
|
|
8184
8184
|
/**
|
|
8185
8185
|
* Get the duration of the vesting period.
|
|
8186
8186
|
*
|
|
8187
8187
|
* @returns The duration of the vesting period.
|
|
8188
8188
|
*/
|
|
8189
|
-
|
|
8189
|
+
getDuration(): Promise<number>;
|
|
8190
8190
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { V as
|
|
2
|
-
import { CarrotVesting as
|
|
3
|
-
import { CONTRACT_ADDRESSES as
|
|
4
|
-
import { Token as
|
|
5
|
-
import { ERC20PermitHandler as
|
|
6
|
-
import { g as
|
|
7
|
-
class
|
|
1
|
+
import { V as i } from "../../constants-CuIEh_ZS.js";
|
|
2
|
+
import { CarrotVesting as n } from "../abis/mainnet/CarrotVesting.js";
|
|
3
|
+
import { CONTRACT_ADDRESSES as s } from "../addresses.js";
|
|
4
|
+
import { Token as o } from "../tokens.js";
|
|
5
|
+
import { ERC20PermitHandler as c } from "./erc20-permit-handler.js";
|
|
6
|
+
import { g as h } from "../../getContract-DQN7VDBo.js";
|
|
7
|
+
class A {
|
|
8
8
|
/**
|
|
9
9
|
* Create the handler for the `CarrotVesting` contract exposing methods to
|
|
10
10
|
* interact with the contract.
|
|
@@ -16,7 +16,7 @@ class w {
|
|
|
16
16
|
* interactions.
|
|
17
17
|
*/
|
|
18
18
|
constructor(t, e, r) {
|
|
19
|
-
this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain =
|
|
19
|
+
this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain = i[t], this.erc20PermitHandler = new c(
|
|
20
20
|
t,
|
|
21
21
|
e,
|
|
22
22
|
r
|
|
@@ -30,8 +30,8 @@ class w {
|
|
|
30
30
|
* @returns The viem contract.
|
|
31
31
|
*/
|
|
32
32
|
getContract() {
|
|
33
|
-
const t =
|
|
34
|
-
return
|
|
33
|
+
const t = s[this.chain].CarrotVesting, e = n, r = { public: this.publicClient, wallet: this.walletClient };
|
|
34
|
+
return h({ address: t, abi: e, client: r });
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Get the owner of the contract.
|
|
@@ -98,8 +98,8 @@ class w {
|
|
|
98
98
|
*
|
|
99
99
|
* @returns The number of vesting steps.
|
|
100
100
|
*/
|
|
101
|
-
|
|
102
|
-
return this.getContract().read.
|
|
101
|
+
getSteps() {
|
|
102
|
+
return this.getContract().read.getSteps();
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Get the maximum carrot amount.
|
|
@@ -116,27 +116,16 @@ class w {
|
|
|
116
116
|
* @returns The vesting information including deposited amount,
|
|
117
117
|
* claimed amount, last claimed timestamp, and deposited timestamp.
|
|
118
118
|
*/
|
|
119
|
-
async
|
|
120
|
-
|
|
121
|
-
e,
|
|
122
|
-
r,
|
|
123
|
-
a,
|
|
124
|
-
i
|
|
125
|
-
] = await this.getContract().read.vestings([t]);
|
|
126
|
-
return {
|
|
127
|
-
depositedAmount: e,
|
|
128
|
-
claimedAmount: r,
|
|
129
|
-
lastClaimedTimestamp: a,
|
|
130
|
-
depositedTimestamp: i
|
|
131
|
-
};
|
|
119
|
+
async getVestings(t) {
|
|
120
|
+
return await this.getContract().read.getVestings([t]);
|
|
132
121
|
}
|
|
133
122
|
/**
|
|
134
123
|
* Get the start timestamp.
|
|
135
124
|
*
|
|
136
125
|
* @returns The start timestamp.
|
|
137
126
|
*/
|
|
138
|
-
|
|
139
|
-
return this.getContract().read.
|
|
127
|
+
getStartTimestamp() {
|
|
128
|
+
return this.getContract().read.getStartTimestamp();
|
|
140
129
|
}
|
|
141
130
|
/**
|
|
142
131
|
* Start vesting for a user.
|
|
@@ -173,7 +162,7 @@ class w {
|
|
|
173
162
|
async startVesting(t, e) {
|
|
174
163
|
if (e)
|
|
175
164
|
return this.startVestingPreapproved(t);
|
|
176
|
-
const r = this.walletClient.account, a = await this.erc20PermitHandler.withToken(
|
|
165
|
+
const r = this.walletClient.account, a = await this.erc20PermitHandler.withToken(o.CARROT).getPermitData(r.address, this.getContract().address, t);
|
|
177
166
|
return this.startVestingWithPermit(a);
|
|
178
167
|
}
|
|
179
168
|
/**
|
|
@@ -181,19 +170,19 @@ class w {
|
|
|
181
170
|
*
|
|
182
171
|
* @returns The total deposited amount.
|
|
183
172
|
*/
|
|
184
|
-
|
|
185
|
-
return this.getContract().read.
|
|
173
|
+
getTotalDepositedAmount() {
|
|
174
|
+
return this.getContract().read.getTotalDepositedAmount();
|
|
186
175
|
}
|
|
187
176
|
/**
|
|
188
177
|
* Get the duration of the vesting period.
|
|
189
178
|
*
|
|
190
179
|
* @returns The duration of the vesting period.
|
|
191
180
|
*/
|
|
192
|
-
|
|
193
|
-
return this.getContract().read.
|
|
181
|
+
getDuration() {
|
|
182
|
+
return this.getContract().read.getDuration();
|
|
194
183
|
}
|
|
195
184
|
}
|
|
196
185
|
export {
|
|
197
|
-
|
|
186
|
+
A as CarrotVestingHandler
|
|
198
187
|
};
|
|
199
188
|
//# sourceMappingURL=carrot-vesting-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrot-vesting-handler.js","sources":["../../../lib/contracts/handlers/carrot-vesting-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { CarrotVesting } from '../abis/mainnet/CarrotVesting';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PermitData } from '../common/lib/types';\nimport { Token } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\n/**\n * Handler for the `CarrotVesting` contract exposing methods to interact\n * with the contract.\n */\nexport class CarrotVestingHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `CarrotVesting` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].CarrotVesting as Address;\n const abi = CarrotVesting;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof CarrotVesting,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Calculate the claimable amount for a user.\n *\n * @param user The user address.\n * @returns The claimable amount.\n */\n public calculateClaimableAmount(user: Address) {\n return this.getContract().read.calculateClaimableAmount([user]);\n }\n\n /**\n * Get the exchange rate.\n *\n * @returns The exchange rate.\n */\n public exchangeRate() {\n return this.getContract().read.EXCHANGE_RATE();\n }\n\n /**\n * Claim vested tokens.\n *\n * @returns The transaction.\n */\n public claim() {\n return this.getContract().write.claim({\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the CARROT token address.\n *\n * @returns The CARROT token address.\n */\n public getCarrotAddress() {\n return this.getContract().read.CARROT();\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public getPufferAddress() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the total puffer rewards.\n *\n * @returns The total puffer rewards.\n */\n public totalPufferRewards() {\n return this.getContract().read.TOTAL_PUFFER_REWARDS();\n }\n\n /**\n * Get the number of vesting steps.\n *\n * @returns The number of vesting steps.\n */\n public
|
|
1
|
+
{"version":3,"file":"carrot-vesting-handler.js","sources":["../../../lib/contracts/handlers/carrot-vesting-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { CarrotVesting } from '../abis/mainnet/CarrotVesting';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PermitData } from '../common/lib/types';\nimport { Token } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\n/**\n * Handler for the `CarrotVesting` contract exposing methods to interact\n * with the contract.\n */\nexport class CarrotVestingHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `CarrotVesting` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].CarrotVesting as Address;\n const abi = CarrotVesting;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof CarrotVesting,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Calculate the claimable amount for a user.\n *\n * @param user The user address.\n * @returns The claimable amount.\n */\n public calculateClaimableAmount(user: Address) {\n return this.getContract().read.calculateClaimableAmount([user]);\n }\n\n /**\n * Get the exchange rate.\n *\n * @returns The exchange rate.\n */\n public exchangeRate() {\n return this.getContract().read.EXCHANGE_RATE();\n }\n\n /**\n * Claim vested tokens.\n *\n * @returns The transaction.\n */\n public claim() {\n return this.getContract().write.claim({\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the CARROT token address.\n *\n * @returns The CARROT token address.\n */\n public getCarrotAddress() {\n return this.getContract().read.CARROT();\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public getPufferAddress() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the total puffer rewards.\n *\n * @returns The total puffer rewards.\n */\n public totalPufferRewards() {\n return this.getContract().read.TOTAL_PUFFER_REWARDS();\n }\n\n /**\n * Get the number of vesting steps.\n *\n * @returns The number of vesting steps.\n */\n public getSteps() {\n return this.getContract().read.getSteps();\n }\n\n /**\n * Get the maximum carrot amount.\n *\n * @returns The maximum carrot amount.\n */\n public maxCarrotAmount() {\n return this.getContract().read.MAX_CARROT_AMOUNT();\n }\n\n /**\n * Get vesting information for a user.\n *\n * @param user The user address.\n * @returns The vesting information including deposited amount,\n * claimed amount, last claimed timestamp, and deposited timestamp.\n */\n public async getVestings(user: Address) {\n return await this.getContract().read.getVestings([user]);\n }\n\n /**\n * Get the start timestamp.\n *\n * @returns The start timestamp.\n */\n public getStartTimestamp() {\n return this.getContract().read.getStartTimestamp();\n }\n\n /**\n * Start vesting for a user.\n *\n * @param amount The amount to vest.\n * @returns The transaction.\n */\n public startVestingPreapproved(amount: bigint) {\n return this.getContract().write.startVesting([amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Start vesting with permit.\n *\n * @param permitData The permit data including deadline, amount, v, r, and s values.\n * @returns The transaction.\n */\n public startVestingWithPermit(permitData: PermitData) {\n return this.getContract().write.startVestingWithPermit([permitData], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Start vesting.\n *\n * @param amount The amount to vest.\n * @param isPreapproved Whether the CARROT token is preapproved or\n * should use permit.\n * @returns The transaction.\n */\n public async startVesting(amount: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.startVestingPreapproved(amount);\n }\n\n const account = this.walletClient.account as Account;\n const permitData = await this.erc20PermitHandler\n .withToken(Token.CARROT)\n .getPermitData(account.address, this.getContract().address, amount);\n\n return this.startVestingWithPermit(permitData);\n }\n\n /**\n * Get the total deposited amount.\n *\n * @returns The total deposited amount.\n */\n public getTotalDepositedAmount() {\n return this.getContract().read.getTotalDepositedAmount();\n }\n\n /**\n * Get the duration of the vesting period.\n *\n * @returns The duration of the vesting period.\n */\n public getDuration() {\n return this.getContract().read.getDuration();\n }\n}\n"],"names":["CarrotVestingHandler","chain","walletClient","publicClient","VIEM_CHAINS","ERC20PermitHandler","address","CONTRACT_ADDRESSES","abi","CarrotVesting","client","getContract","user","amount","permitData","isPreapproved","account","Token"],"mappings":";;;;;;AAoBO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAchC,YACUC,GACAC,GACAC,GACR;AAHQ,SAAA,QAAAF,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAER,KAAK,YAAYC,EAAYH,CAAK,GAClC,KAAK,qBAAqB,IAAII;AAAA,MAC5BJ;AAAA,MACAC;AAAA,MACAC;AAAA,IAAA;AAAA,EAEJ;AAAA,EAxBQ;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8BD,cAAc;AACnB,UAAMG,IAAUC,EAAmB,KAAK,KAAK,EAAE,eACzCC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAA;AAEzD,WAAOC,EAAY,EAAE,SAAAL,GAAS,KAAAE,GAAK,QAAAE,GAAQ;AAAA,EAK7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,QAAQ;AACb,WAAO,KAAK,cAAc,KAAK,MAAA;AAAA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,KAAK,YAAA,EAAc,MAAM,aAAa,CAACA,CAAM,GAAG;AAAA,MACrD,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,uBAAuBC,GAAwB;AACpD,WAAO,KAAK,YAAA,EAAc,MAAM,uBAAuB,CAACA,CAAU,GAAG;AAAA,MACnE,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAa,aAAaD,GAAgBE,GAAwB;AAChE,QAAIA;AACF,aAAO,KAAK,wBAAwBF,CAAM;AAG5C,UAAMG,IAAU,KAAK,aAAa,SAC5BF,IAAa,MAAM,KAAK,mBAC3B,UAAUG,EAAM,MAAM,EACtB,cAAcD,EAAQ,SAAS,KAAK,YAAA,EAAc,SAASH,CAAM;AAEpE,WAAO,KAAK,uBAAuBC,CAAU;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,0BAA0B;AAC/B,WAAO,KAAK,cAAc,KAAK,wBAAA;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,cAAc;AACnB,WAAO,KAAK,cAAc,KAAK,YAAA;AAAA,EACjC;AACF;"}
|
package/dist/utils/version.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.28.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.28.3",o=e;exports.version=o;
|
|
2
2
|
//# sourceMappingURL=version.cjs.map
|
package/dist/utils/version.js
CHANGED
package/package.json
CHANGED