@0xsequence/migration
Advanced tools
Comparing version 0.0.0-20240812142652 to 0.0.0-20240814043648
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49640
941
+ Added@0xsequence/abi@0.0.0-20240814043648(transitive)
+ Added@0xsequence/core@0.0.0-20240814043648(transitive)
+ Added@0xsequence/indexer@0.0.0-20240814043648(transitive)
+ Added@0xsequence/network@0.0.0-20240814043648(transitive)
+ Added@0xsequence/relayer@0.0.0-20240814043648(transitive)
+ Added@0xsequence/signhub@0.0.0-20240814043648(transitive)
+ Added@0xsequence/utils@0.0.0-20240814043648(transitive)
+ Added@0xsequence/wallet@0.0.0-20240814043648(transitive)
+ Added@ethersproject/abi@5.7.0(transitive)
+ Added@ethersproject/abstract-provider@5.7.0(transitive)
+ Added@ethersproject/abstract-signer@5.7.0(transitive)
+ Added@ethersproject/address@5.7.0(transitive)
+ Added@ethersproject/base64@5.7.0(transitive)
+ Added@ethersproject/basex@5.7.0(transitive)
+ Added@ethersproject/bignumber@5.7.0(transitive)
+ Added@ethersproject/bytes@5.7.0(transitive)
+ Added@ethersproject/constants@5.7.0(transitive)
+ Added@ethersproject/contracts@5.7.0(transitive)
+ Added@ethersproject/hash@5.7.0(transitive)
+ Added@ethersproject/hdnode@5.7.0(transitive)
+ Added@ethersproject/json-wallets@5.7.0(transitive)
+ Added@ethersproject/keccak256@5.7.0(transitive)
+ Added@ethersproject/logger@5.7.0(transitive)
+ Added@ethersproject/networks@5.7.1(transitive)
+ Added@ethersproject/pbkdf2@5.7.0(transitive)
+ Added@ethersproject/properties@5.7.0(transitive)
+ Added@ethersproject/providers@5.7.2(transitive)
+ Added@ethersproject/random@5.7.0(transitive)
+ Added@ethersproject/rlp@5.7.0(transitive)
+ Added@ethersproject/sha2@5.7.0(transitive)
+ Added@ethersproject/signing-key@5.7.0(transitive)
+ Added@ethersproject/solidity@5.7.0(transitive)
+ Added@ethersproject/strings@5.7.0(transitive)
+ Added@ethersproject/transactions@5.7.0(transitive)
+ Added@ethersproject/units@5.7.0(transitive)
+ Added@ethersproject/wallet@5.7.0(transitive)
+ Added@ethersproject/web@5.7.1(transitive)
+ Added@ethersproject/wordlists@5.7.0(transitive)
+ Addedaes-js@3.0.0(transitive)
+ Addedbech32@1.1.4(transitive)
+ Addedbn.js@4.12.15.2.1(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedelliptic@6.5.4(transitive)
+ Addedethers@5.7.2(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjs-sha3@0.8.0(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addedscrypt-js@3.0.1(transitive)
+ Addedws@7.4.6(transitive)
- Removed@0xsequence/abi@0.0.0-20240812142652(transitive)
- Removed@0xsequence/core@0.0.0-20240812142652(transitive)
- Removed@0xsequence/indexer@0.0.0-20240812142652(transitive)
- Removed@0xsequence/network@0.0.0-20240812142652(transitive)
- Removed@0xsequence/relayer@0.0.0-20240812142652(transitive)
- Removed@0xsequence/signhub@0.0.0-20240812142652(transitive)
- Removed@0xsequence/utils@0.0.0-20240812142652(transitive)
- Removed@0xsequence/wallet@0.0.0-20240812142652(transitive)
- Removed@adraffy/ens-normalize@1.10.1(transitive)
- Removed@noble/curves@1.2.0(transitive)
- Removed@noble/hashes@1.3.2(transitive)
- Removed@types/node@22.7.5(transitive)
- Removedaes-js@4.0.0-beta.5(transitive)
- Removedethers@6.13.4(transitive)
- Removedtslib@2.7.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedws@8.17.1(transitive)
Updatedethers@^5.5.2