Socket
Socket
Sign inDemoInstall

@0xsequence/migration

Package Overview
Dependencies
Maintainers
0
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xsequence/migration - npm Package Compare versions

Comparing version 0.0.0-20240812142652 to 0.0.0-20240814043648

12

dist/0xsequence-migration.cjs.dev.js

@@ -43,3 +43,3 @@ 'use strict';

const context = contexts[2];
const contract = new ethers.ethers.Interface(abi.walletContracts.mainModule.abi);
const contract = new ethers.ethers.utils.Interface(abi.walletContracts.mainModule.abi);

@@ -74,12 +74,12 @@ // WARNING: v1 wallets CAN NOT use v2 configurations so we ALWAYS need to update

}
if (!tx.nonce || core.commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0) !== BigInt(tx.nonce)) {
if (!tx.nonce || !core.commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0).eq(tx.nonce)) {
throw new Error('Invalid transaction bundle nonce');
}
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && BigInt(tx.transactions[0].value) !== 0n || tx.transactions[1].value && BigInt(tx.transactions[1].value) !== 0n || tx.transactions[0].gasLimit && BigInt(tx.transactions[0].gasLimit) !== 0n || tx.transactions[1].gasLimit && BigInt(tx.transactions[1].gasLimit) !== 0n) {
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && !ethers.ethers.constants.Zero.eq(tx.transactions[0].value) || tx.transactions[1].value && !ethers.ethers.constants.Zero.eq(tx.transactions[1].value) || tx.transactions[0].gasLimit && !ethers.ethers.constants.Zero.eq(tx.transactions[0].gasLimit) || tx.transactions[1].gasLimit && !ethers.ethers.constants.Zero.eq(tx.transactions[1].gasLimit)) {
throw new Error('Invalid transaction bundle format');
}
const context = contexts[2];
const contract = new ethers.ethers.Interface(abi.walletContracts.mainModule.abi);
const data1 = ethers.ethers.hexlify(tx.transactions[0].data || new Uint8Array());
const expectData1 = ethers.ethers.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
const contract = new ethers.ethers.utils.Interface(abi.walletContracts.mainModule.abi);
const data1 = ethers.ethers.utils.hexlify(tx.transactions[0].data || []);
const expectData1 = ethers.ethers.utils.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
if (data1 !== expectData1) {

@@ -86,0 +86,0 @@ throw new Error('Invalid new implementation on transaction');

@@ -43,3 +43,3 @@ 'use strict';

const context = contexts[2];
const contract = new ethers.ethers.Interface(abi.walletContracts.mainModule.abi);
const contract = new ethers.ethers.utils.Interface(abi.walletContracts.mainModule.abi);

@@ -74,12 +74,12 @@ // WARNING: v1 wallets CAN NOT use v2 configurations so we ALWAYS need to update

}
if (!tx.nonce || core.commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0) !== BigInt(tx.nonce)) {
if (!tx.nonce || !core.commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0).eq(tx.nonce)) {
throw new Error('Invalid transaction bundle nonce');
}
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && BigInt(tx.transactions[0].value) !== 0n || tx.transactions[1].value && BigInt(tx.transactions[1].value) !== 0n || tx.transactions[0].gasLimit && BigInt(tx.transactions[0].gasLimit) !== 0n || tx.transactions[1].gasLimit && BigInt(tx.transactions[1].gasLimit) !== 0n) {
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && !ethers.ethers.constants.Zero.eq(tx.transactions[0].value) || tx.transactions[1].value && !ethers.ethers.constants.Zero.eq(tx.transactions[1].value) || tx.transactions[0].gasLimit && !ethers.ethers.constants.Zero.eq(tx.transactions[0].gasLimit) || tx.transactions[1].gasLimit && !ethers.ethers.constants.Zero.eq(tx.transactions[1].gasLimit)) {
throw new Error('Invalid transaction bundle format');
}
const context = contexts[2];
const contract = new ethers.ethers.Interface(abi.walletContracts.mainModule.abi);
const data1 = ethers.ethers.hexlify(tx.transactions[0].data || new Uint8Array());
const expectData1 = ethers.ethers.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
const contract = new ethers.ethers.utils.Interface(abi.walletContracts.mainModule.abi);
const data1 = ethers.ethers.utils.hexlify(tx.transactions[0].data || []);
const expectData1 = ethers.ethers.utils.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
if (data1 !== expectData1) {

@@ -86,0 +86,0 @@ throw new Error('Invalid new implementation on transaction');

@@ -39,3 +39,3 @@ import { commons, v2 } from '@0xsequence/core';

const context = contexts[2];
const contract = new ethers.Interface(walletContracts.mainModule.abi);
const contract = new ethers.utils.Interface(walletContracts.mainModule.abi);

@@ -70,12 +70,12 @@ // WARNING: v1 wallets CAN NOT use v2 configurations so we ALWAYS need to update

}
if (!tx.nonce || commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0) !== BigInt(tx.nonce)) {
if (!tx.nonce || !commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0).eq(tx.nonce)) {
throw new Error('Invalid transaction bundle nonce');
}
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && BigInt(tx.transactions[0].value) !== 0n || tx.transactions[1].value && BigInt(tx.transactions[1].value) !== 0n || tx.transactions[0].gasLimit && BigInt(tx.transactions[0].gasLimit) !== 0n || tx.transactions[1].gasLimit && BigInt(tx.transactions[1].gasLimit) !== 0n) {
if (tx.transactions[0].to !== address || tx.transactions[1].to !== address || tx.transactions[0].delegateCall || tx.transactions[1].delegateCall || !tx.transactions[0].revertOnError || !tx.transactions[1].revertOnError || tx.transactions[0].value && !ethers.constants.Zero.eq(tx.transactions[0].value) || tx.transactions[1].value && !ethers.constants.Zero.eq(tx.transactions[1].value) || tx.transactions[0].gasLimit && !ethers.constants.Zero.eq(tx.transactions[0].gasLimit) || tx.transactions[1].gasLimit && !ethers.constants.Zero.eq(tx.transactions[1].gasLimit)) {
throw new Error('Invalid transaction bundle format');
}
const context = contexts[2];
const contract = new ethers.Interface(walletContracts.mainModule.abi);
const data1 = ethers.hexlify(tx.transactions[0].data || new Uint8Array());
const expectData1 = ethers.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
const contract = new ethers.utils.Interface(walletContracts.mainModule.abi);
const data1 = ethers.utils.hexlify(tx.transactions[0].data || []);
const expectData1 = ethers.utils.hexlify(contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable]));
if (data1 !== expectData1) {

@@ -82,0 +82,0 @@ throw new Error('Invalid new implementation on transaction');

import { commons } from '@0xsequence/core';
import { Wallet } from '@0xsequence/wallet';
import { ethers } from 'ethers';
import { Migration } from "./migrations/index.js";
import { ethers } from 'ethers';
export type UnsignedMigration = {

@@ -6,0 +6,0 @@ tx: commons.transaction.TransactionBundle;

{
"name": "@0xsequence/migration",
"version": "0.0.0-20240812142652",
"version": "0.0.0-20240814043648",
"description": "tools for migrating sequence wallets to new versions",

@@ -12,6 +12,6 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/migration",

"dependencies": {
"ethers": "^6.13.0",
"@0xsequence/abi": "0.0.0-20240812142652",
"@0xsequence/core": "0.0.0-20240812142652",
"@0xsequence/wallet": "0.0.0-20240812142652"
"ethers": "^5.5.2",
"@0xsequence/abi": "0.0.0-20240814043648",
"@0xsequence/core": "0.0.0-20240814043648",
"@0xsequence/wallet": "0.0.0-20240814043648"
},

@@ -18,0 +18,0 @@ "devDependencies": {

@@ -31,3 +31,3 @@ import { commons, v1, v2 } from '@0xsequence/core'

const context = contexts[2]
const contract = new ethers.Interface(walletContracts.mainModule.abi)
const contract = new ethers.utils.Interface(walletContracts.mainModule.abi)

@@ -49,3 +49,3 @@ // WARNING: v1 wallets CAN NOT use v2 configurations so we ALWAYS need to update

delegateCall: false,
data: contract.encodeFunctionData(contract.getFunction('updateImplementation')!, [context.mainModuleUpgradable])
data: contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable])
},

@@ -77,3 +77,3 @@ ...updateBundle.transactions

if (!tx.nonce || commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0) !== BigInt(tx.nonce)) {
if (!tx.nonce || !commons.transaction.encodeNonce(MIGRATION_NONCE_SPACE, 0).eq(tx.nonce)) {
throw new Error('Invalid transaction bundle nonce')

@@ -89,6 +89,6 @@ }

!tx.transactions[1].revertOnError ||
(tx.transactions[0].value && BigInt(tx.transactions[0].value) !== 0n) ||
(tx.transactions[1].value && BigInt(tx.transactions[1].value) !== 0n) ||
(tx.transactions[0].gasLimit && BigInt(tx.transactions[0].gasLimit) !== 0n) ||
(tx.transactions[1].gasLimit && BigInt(tx.transactions[1].gasLimit) !== 0n)
(tx.transactions[0].value && !ethers.constants.Zero.eq(tx.transactions[0].value)) ||
(tx.transactions[1].value && !ethers.constants.Zero.eq(tx.transactions[1].value)) ||
(tx.transactions[0].gasLimit && !ethers.constants.Zero.eq(tx.transactions[0].gasLimit)) ||
(tx.transactions[1].gasLimit && !ethers.constants.Zero.eq(tx.transactions[1].gasLimit))
) {

@@ -99,7 +99,7 @@ throw new Error('Invalid transaction bundle format')

const context = contexts[2]
const contract = new ethers.Interface(walletContracts.mainModule.abi)
const contract = new ethers.utils.Interface(walletContracts.mainModule.abi)
const data1 = ethers.hexlify(tx.transactions[0].data || new Uint8Array())
const expectData1 = ethers.hexlify(
contract.encodeFunctionData(contract.getFunction('updateImplementation')!, [context.mainModuleUpgradable])
const data1 = ethers.utils.hexlify(tx.transactions[0].data || [])
const expectData1 = ethers.utils.hexlify(
contract.encodeFunctionData(contract.getFunction('updateImplementation'), [context.mainModuleUpgradable])
)

@@ -106,0 +106,0 @@

import { commons } from '@0xsequence/core'
import { Wallet } from '@0xsequence/wallet'
import { ethers } from 'ethers'
import { Migration } from './migrations'
import { ethers } from 'ethers'

@@ -7,0 +7,0 @@ export type UnsignedMigration = {

@@ -0,1 +1,2 @@

import { ethers } from 'ethers'
import { commons } from '@0xsequence/core'

@@ -2,0 +3,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc