@obolnetwork/obol-sdk 2.11.2 → 2.11.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/cjs/package.json +1 -1
- package/dist/cjs/src/abi/{OVMFactory.js → OVM.js} +319 -312
- package/dist/cjs/src/bytecodes.js +4 -3
- package/dist/cjs/src/constants.js +6 -2
- package/dist/cjs/src/splits/splitHelpers.js +5 -5
- package/dist/cjs/src/verification/v1.8.0.js +5 -12
- package/dist/cjs/test/eoa/eoa.spec.js +3 -3
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/abi/{OVMFactory.js → OVM.js} +319 -312
- package/dist/esm/src/bytecodes.js +3 -2
- package/dist/esm/src/constants.js +7 -3
- package/dist/esm/src/splits/splitHelpers.js +1 -1
- package/dist/esm/src/verification/v1.8.0.js +5 -12
- package/dist/esm/test/eoa/eoa.spec.js +3 -3
- package/dist/types/src/abi/OVM.d.ts +103 -0
- package/dist/types/src/bytecodes.d.ts +3 -2
- package/package.json +1 -1
- package/src/abi/{OVMFactory.ts → OVM.ts} +320 -313
- package/src/bytecodes.ts +4 -3
- package/src/constants.ts +7 -2
- package/src/splits/splitHelpers.ts +1 -1
- package/src/verification/v1.8.0.ts +7 -14
- package/dist/types/src/abi/OVMFactory.d.ts +0 -662
|
@@ -160,7 +160,7 @@ exports.CHAIN_CONFIGURATION = {
|
|
|
160
160
|
},
|
|
161
161
|
// OVM and SplitV2 Contract Addresses
|
|
162
162
|
OVM_FACTORY_CONTRACT: {
|
|
163
|
-
address: '
|
|
163
|
+
address: '0xA755669f314022ED2158e93867af5183E88370fe',
|
|
164
164
|
bytecode: bytecodes_1.MAINNET_OVM_FACTORY_BYTECODE,
|
|
165
165
|
},
|
|
166
166
|
WAREHOUSE_CONTRACT: {
|
|
@@ -198,6 +198,10 @@ exports.CHAIN_CONFIGURATION = {
|
|
|
198
198
|
EOA_WITHDRAWAL_CONTRACT: {
|
|
199
199
|
address: '0x00000961Ef480Eb55e80D19ad83579A64c007002',
|
|
200
200
|
},
|
|
201
|
+
OVM_FACTORY_CONTRACT: {
|
|
202
|
+
address: '0x4B157b79277E44D12C234680ACE17Db028075EA5',
|
|
203
|
+
bytecode: bytecodes_1.HOLESKY_OVM_FACTORY_BYTECODE,
|
|
204
|
+
},
|
|
201
205
|
},
|
|
202
206
|
[types_1.FORK_MAPPING['0x10000910']]: {
|
|
203
207
|
SPLITMAIN_CONTRACT: {
|
|
@@ -218,7 +222,7 @@ exports.CHAIN_CONFIGURATION = {
|
|
|
218
222
|
},
|
|
219
223
|
// OVM and SplitV2 Contract Addresses
|
|
220
224
|
OVM_FACTORY_CONTRACT: {
|
|
221
|
-
address: '
|
|
225
|
+
address: '0x885E7D97E3987BA57EF0d693C508d675e4Bf82FC',
|
|
222
226
|
bytecode: bytecodes_1.HOODI_OVM_FACTORY_BYTECODE,
|
|
223
227
|
},
|
|
224
228
|
WAREHOUSE_CONTRACT: {
|
|
@@ -12,14 +12,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.depositWithMulticall3 = exports.requestWithdrawalFromOVM = exports.deployOVMAndSplitV2 = exports.deployOVMContract = exports.isSplitV2Deployed = exports.predictSplitV2Address = exports.formatRecipientsForSplitV2 = exports.multicall3 = exports.getOWRTranches = exports.deploySplitterAndOWRContracts = exports.deploySplitterContract = exports.handleDeployOWRAndSplitter = exports.predictSplitterAddress = exports.formatSplitRecipients = void 0;
|
|
13
13
|
const ethers_1 = require("ethers");
|
|
14
14
|
const OWR_1 = require("../abi/OWR");
|
|
15
|
-
const
|
|
15
|
+
const OVM_1 = require("../abi/OVM");
|
|
16
16
|
const SplitMain_1 = require("../abi/SplitMain");
|
|
17
17
|
const constants_1 = require("../constants");
|
|
18
18
|
const splitV2FactoryAbi_1 = require("../abi/splitV2FactoryAbi");
|
|
19
19
|
const Multicall3_1 = require("../abi/Multicall3");
|
|
20
20
|
const splitMainContractInterface = new ethers_1.Interface(SplitMain_1.splitMainEthereumAbi);
|
|
21
21
|
const owrFactoryContractInterface = new ethers_1.Interface(OWR_1.OWRFactoryContract.abi);
|
|
22
|
-
const ovmFactoryContractInterface = new ethers_1.Interface(
|
|
22
|
+
const ovmFactoryContractInterface = new ethers_1.Interface(OVM_1.OVMFactoryContract.abi);
|
|
23
23
|
const splitV2FactoryInterface = new ethers_1.Interface(splitV2FactoryAbi_1.splitV2FactoryAbi);
|
|
24
24
|
// Helper function to extract common recipient formatting logic
|
|
25
25
|
const formatRecipientsCommon = (recipients) => {
|
|
@@ -409,7 +409,7 @@ const deployOVMContract = ({ OVMOwnerAddress, principalRecipient, rewardRecipien
|
|
|
409
409
|
if (!((_2 = chainConfig === null || chainConfig === void 0 ? void 0 : chainConfig.OVM_FACTORY_CONTRACT) === null || _2 === void 0 ? void 0 : _2.address)) {
|
|
410
410
|
throw new Error(`OVM Factory not configured for chain ${chainId}`);
|
|
411
411
|
}
|
|
412
|
-
const ovmFactoryContract = new ethers_1.Contract(chainConfig.OVM_FACTORY_CONTRACT.address,
|
|
412
|
+
const ovmFactoryContract = new ethers_1.Contract(chainConfig.OVM_FACTORY_CONTRACT.address, OVM_1.OVMFactoryContract.abi, signer);
|
|
413
413
|
const tx = yield ovmFactoryContract.createObolValidatorManager(OVMOwnerAddress, principalRecipient, rewardRecipient, principalThreshold * constants_1.ETHER_TO_GWEI);
|
|
414
414
|
const receipt = yield tx.wait();
|
|
415
415
|
// Extract OVM address from logs
|
|
@@ -511,7 +511,7 @@ const requestWithdrawalFromOVM = ({ ovmAddress, pubKeys, amounts, withdrawalFees
|
|
|
511
511
|
try {
|
|
512
512
|
// Convert string amounts to bigint
|
|
513
513
|
const bigintAmounts = amounts.map(amount => BigInt(amount));
|
|
514
|
-
const ovmContract = new ethers_1.Contract(ovmAddress,
|
|
514
|
+
const ovmContract = new ethers_1.Contract(ovmAddress, OVM_1.OVMContract.abi, signer);
|
|
515
515
|
const tx = yield ovmContract.requestWithdrawal(pubKeys, bigintAmounts, {
|
|
516
516
|
value: BigInt(withdrawalFees),
|
|
517
517
|
});
|
|
@@ -533,7 +533,7 @@ exports.requestWithdrawalFromOVM = requestWithdrawalFromOVM;
|
|
|
533
533
|
*/
|
|
534
534
|
const depositWithMulticall3 = ({ ovmAddress, deposits, signer, chainId, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
535
535
|
try {
|
|
536
|
-
const ovmContract = new ethers_1.Contract(ovmAddress,
|
|
536
|
+
const ovmContract = new ethers_1.Contract(ovmAddress, OVM_1.OVMContract.abi, signer);
|
|
537
537
|
const chainConfig = getChainConfig(chainId);
|
|
538
538
|
const multicall3Address = chainConfig.MULTICALL3_CONTRACT.address;
|
|
539
539
|
const multiCall3ContractInstance = new ethers_1.Contract(multicall3Address, Multicall3_1.MultiCall3Contract.abi, signer);
|
|
@@ -149,19 +149,12 @@ const verifyDVV1X8 = (clusterLock) => {
|
|
|
149
149
|
}
|
|
150
150
|
// Check deposit amounts match exactly if they are defined
|
|
151
151
|
const depositAmounts = clusterLock.cluster_definition.deposit_amounts;
|
|
152
|
-
if (depositAmounts !== null) {
|
|
152
|
+
if (!!depositAmounts && depositAmounts !== null) {
|
|
153
153
|
const partialDepositAmounts = validator.partial_deposit_data.map(d => d.amount);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const sortedDepositAmounts = [...depositAmounts]
|
|
159
|
-
.map(Number)
|
|
160
|
-
.sort((a, b) => a - b);
|
|
161
|
-
const sortedPartialAmounts = [...partialDepositAmounts]
|
|
162
|
-
.map(Number)
|
|
163
|
-
.sort((a, b) => a - b);
|
|
164
|
-
if (!sortedDepositAmounts.every((amount, index) => amount === sortedPartialAmounts[index])) {
|
|
154
|
+
// Check that partialDepositAmounts includes all unique elements of depositAmounts
|
|
155
|
+
const uniqueDepositAmounts = [...new Set(depositAmounts.map(Number))];
|
|
156
|
+
const partialAmountsSet = new Set(partialDepositAmounts.map(Number));
|
|
157
|
+
if (!uniqueDepositAmounts.every(amount => partialAmountsSet.has(amount))) {
|
|
165
158
|
return false;
|
|
166
159
|
}
|
|
167
160
|
}
|
|
@@ -101,7 +101,7 @@ describe('EOA', () => {
|
|
|
101
101
|
{
|
|
102
102
|
pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
|
|
103
103
|
withdrawal_credentials: '0x1234567890123456789012345678901234567890123456789012345678901234',
|
|
104
|
-
deposit_data_root:
|
|
104
|
+
deposit_data_root: '0x7f7f280756b8d5fe06ae922e5a20afb708c0f00d8954caede4c262795d956c01',
|
|
105
105
|
signature: '0x121234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012000000000000000000',
|
|
106
106
|
amount: '32000000000000000000', // 32 ETH in wei
|
|
107
107
|
},
|
|
@@ -143,14 +143,14 @@ describe('EOA', () => {
|
|
|
143
143
|
{
|
|
144
144
|
pubkey: '0x123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456',
|
|
145
145
|
withdrawal_credentials: '0x1234567890123456789012345678901234567890123456789012345678901234',
|
|
146
|
-
deposit_data_root:
|
|
146
|
+
deposit_data_root: '0x7f7f280756b8d5fe06ae922e5a20afb708c0f00d8954caede4c262795d956c01',
|
|
147
147
|
signature: '0x121234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012000000000000000000',
|
|
148
148
|
amount: '32000000000000000000',
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
pubkey: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdcd',
|
|
152
152
|
withdrawal_credentials: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd',
|
|
153
|
-
deposit_data_root:
|
|
153
|
+
deposit_data_root: '0x7f7f280756b8d5fe06ae922e5a20afb708c0f00d8954caede4c262795d956c01',
|
|
154
154
|
signature: '0x121234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012000000000000000000',
|
|
155
155
|
amount: '16000000000000000000',
|
|
156
156
|
},
|
package/dist/esm/package.json
CHANGED