Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@safe-global/safe-core-sdk

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@safe-global/safe-core-sdk - npm Package Compare versions

Comparing version 3.3.4 to 3.3.5

27

dist/src/safeFactory/index.js

@@ -20,2 +20,3 @@ "use strict";

const satisfies_1 = __importDefault(require("semver/functions/satisfies"));
const zksync_web3_1 = require("zksync-web3");
const config_1 = require("../contracts/config");

@@ -26,2 +27,17 @@ const safeDeploymentContracts_1 = require("../contracts/safeDeploymentContracts");

const utils_1 = require("./utils");
const ZKSYNC_MAINNET = 324;
const ZKSYNC_TESTNET = 280;
// For bundle size efficiency we store SafeProxy.sol/GnosisSafeProxy.sol zksync bytecode hash in hex.
// To get the values below we need to:
// 1. Compile Safe smart contracts for zksync
// 2. Get `deployedBytecode` from SafeProxy.json/GnosisSafeProxy.json
// 3. Use zksync-web3 SDK to get the bytecode hash
// const bytecodeHash = zkSyncUtils.hashBytecode(${deployedBytecode})
// 4. Use ethers to convert the array into hex
// const deployedBytecodeHash = ethers.utils.hexlify(bytecodeHash)
const ZKSYNC_SAFE_PROXY_DEPLOYED_BYTECODE = {
'1.3.0': {
deployedBytecodeHash: '0x0100004124426fb9ebb25e27d670c068e52f9ba631bd383279a188be47e3f86d'
}
};
class SafeFactory {

@@ -122,3 +138,12 @@ constructor() {

const proxyCreationCode = await __classPrivateFieldGet(this, _SafeFactory_safeProxyFactoryContract, "f").proxyCreationCode();
const constructorData = (0, ethereumjs_util_1.toBuffer)(__classPrivateFieldGet(this, _SafeFactory_ethAdapter, "f").encodeParameters(['address'], [__classPrivateFieldGet(this, _SafeFactory_gnosisSafeContract, "f").getAddress()])).toString('hex');
const input = __classPrivateFieldGet(this, _SafeFactory_ethAdapter, "f").encodeParameters(['address'], [__classPrivateFieldGet(this, _SafeFactory_gnosisSafeContract, "f").getAddress()]);
const chainId = await __classPrivateFieldGet(this, _SafeFactory_ethAdapter, "f").getChainId();
// zkSync Era counterfactual deployment is calculated differently
// https://era.zksync.io/docs/reference/architecture/differences-with-ethereum.html#create-create2
if ([ZKSYNC_MAINNET, ZKSYNC_TESTNET].includes(chainId)) {
const safeVersion = await __classPrivateFieldGet(this, _SafeFactory_gnosisSafeContract, "f").getVersion();
const bytecodeHash = ZKSYNC_SAFE_PROXY_DEPLOYED_BYTECODE[safeVersion].deployedBytecodeHash;
return zksync_web3_1.utils.create2Address(from, bytecodeHash, salt, input);
}
const constructorData = (0, ethereumjs_util_1.toBuffer)(input).toString('hex');
const initCode = proxyCreationCode + constructorData;

@@ -125,0 +150,0 @@ const proxyAddress = '0x' + (0, ethereumjs_util_1.generateAddress2)((0, ethereumjs_util_1.toBuffer)(from), (0, ethereumjs_util_1.toBuffer)(salt), (0, ethereumjs_util_1.toBuffer)(initCode)).toString('hex');

@@ -0,0 +0,0 @@ MIT License

9

package.json
{
"name": "@safe-global/safe-core-sdk",
"version": "3.3.4",
"version": "3.3.5",
"description": "Safe Core SDK",

@@ -54,4 +54,4 @@ "main": "dist/src/index.js",

"@nomiclabs/hardhat-web3": "^2.0.0",
"@safe-global/safe-ethers-lib": "^1.9.3",
"@safe-global/safe-web3-lib": "^1.9.3",
"@safe-global/safe-ethers-lib": "^1.9.4",
"@safe-global/safe-web3-lib": "^1.9.4",
"@types/chai": "^4.3.4",

@@ -93,3 +93,4 @@ "@types/chai-as-promised": "^7.1.5",

"semver": "^7.3.8",
"web3-utils": "^1.8.1"
"web3-utils": "^1.8.1",
"zksync-web3": "^0.14.3"
},

@@ -96,0 +97,0 @@ "lint-staged": {

@@ -0,0 +0,0 @@ # Safe Core SDK

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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