Socket
Socket
Sign inDemoInstall

@eth-optimism/core-utils

Package Overview
Dependencies
Maintainers
5
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eth-optimism/core-utils - npm Package Compare versions

Comparing version 0.0.1-alpha.29 to 0.0.1-alpha.30

12

build/src/app/contract-deployment.js

@@ -5,4 +5,4 @@ "use strict";

const dotenv_1 = require("dotenv");
const ethers_1 = require("ethers");
const utils_1 = require("ethers/utils");
const ethers_v4_1 = require("ethers-v4");
const utils_1 = require("ethers-v4/utils");
const app_1 = require("../app");

@@ -21,3 +21,3 @@ const misc_1 = require("./misc");

exports.deployContract = async (contractJson, wallet, ...args) => {
const factory = new ethers_1.ContractFactory(contractJson.abi, contractJson.bytecode, wallet);
const factory = new ethers_v4_1.ContractFactory(contractJson.abi, contractJson.bytecode, wallet);
const contract = await factory.deploy(...args);

@@ -40,8 +40,8 @@ console.log(`Address: [${contract.address}], Tx: [${contract.deployTransaction.hash}]`);

if (!network || network === 'local') {
provider = new ethers_1.ethers.providers.JsonRpcProvider(process.env.DEPLOY_LOCAL_URL || 'http://127.0.0.1:8545');
provider = new ethers_v4_1.ethers.providers.JsonRpcProvider(process.env.DEPLOY_LOCAL_URL || 'http://127.0.0.1:8545');
}
else {
provider = ethers_1.ethers.getDefaultProvider(network);
provider = ethers_v4_1.ethers.getDefaultProvider(network);
}
const wallet = ethers_1.Wallet.fromMnemonic(deployMnemonic).connect(provider);
const wallet = ethers_v4_1.Wallet.fromMnemonic(deployMnemonic).connect(provider);
if (rootContract) {

@@ -48,0 +48,0 @@ console.log(`\nDeploying to network [${network || 'local'}] in 5 seconds!\n`);

@@ -5,4 +5,4 @@ "use strict";

const ts_md5_1 = require("ts-md5");
const ethers_1 = require("ethers");
const utils_1 = require("ethers/utils");
const ethers_v4_1 = require("ethers-v4");
const utils_1 = require("ethers-v4/utils");
const types_1 = require("../types");

@@ -15,3 +15,3 @@ const misc_1 = require("./misc");

const preimage = misc_1.add0x(value);
const hash = ethers_1.ethers.utils.keccak256(preimage);
const hash = ethers_v4_1.ethers.utils.keccak256(preimage);
return returnPrefixed ? hash : misc_1.remove0x(hash);

@@ -33,5 +33,5 @@ };

exports.getTxSigner = async (tx, r, s, v) => {
const txHash = ethers_1.ethers.utils.keccak256(utils_1.serializeTransaction(await utils_1.resolveProperties(tx)));
const txHash = ethers_v4_1.ethers.utils.keccak256(utils_1.serializeTransaction(await utils_1.resolveProperties(tx)));
try {
return ethers_1.ethers.utils.recoverAddress(ethers_1.ethers.utils.arrayify(txHash), utils_1.joinSignature({
return ethers_v4_1.ethers.utils.recoverAddress(ethers_v4_1.ethers.utils.arrayify(txHash), utils_1.joinSignature({
s: misc_1.add0x(s),

@@ -38,0 +38,0 @@ r: misc_1.add0x(r),

@@ -14,4 +14,4 @@ "use strict";

exports.abi = void 0;
const ethers_1 = require("ethers");
exports.abi = new ethers_1.ethers.utils.AbiCoder();
const ethers_v4_1 = require("ethers-v4");
exports.abi = new ethers_v4_1.ethers.utils.AbiCoder();
__exportStar(require("./serialization"), exports);

@@ -18,0 +18,0 @@ __exportStar(require("./transport"), exports);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChecksumAgnosticIdentityVerifier = exports.IdentityVerifier = exports.IdentitySigner = exports.DefaultSignatureProvider = exports.DefaultSignatureVerifier = void 0;
const ethers_1 = require("ethers");
const ethers_v4_1 = require("ethers-v4");
const misc_1 = require("./misc");

@@ -15,4 +15,4 @@ class DefaultSignatureVerifier {

const messageAsBuf = misc_1.hexStrToBuf(message);
const messageHash = ethers_1.ethers.utils.keccak256(messageAsBuf);
return ethers_1.ethers.utils.verifyMessage(misc_1.hexStrToBuf(messageHash), signature);
const messageHash = ethers_v4_1.ethers.utils.keccak256(messageAsBuf);
return ethers_v4_1.ethers.utils.verifyMessage(misc_1.hexStrToBuf(messageHash), signature);
}

@@ -22,3 +22,3 @@ }

class DefaultSignatureProvider {
constructor(wallet = ethers_1.ethers.Wallet.createRandom()) {
constructor(wallet = ethers_v4_1.ethers.Wallet.createRandom()) {
this.wallet = wallet;

@@ -28,3 +28,3 @@ }

const messageAsBuf = misc_1.hexStrToBuf(message);
const messageHash = ethers_1.ethers.utils.keccak256(messageAsBuf);
const messageHash = ethers_v4_1.ethers.utils.keccak256(messageAsBuf);
return this.wallet.signMessage(misc_1.hexStrToBuf(messageHash));

@@ -69,3 +69,3 @@ }

verifyMessage(message, signature) {
return ethers_1.ethers.utils.getAddress(signature);
return ethers_v4_1.ethers.utils.getAddress(signature);
}

@@ -72,0 +72,0 @@ }

@@ -5,3 +5,3 @@ "use strict";

const app_1 = require("../app");
const ethers_1 = require("ethers");
const ethers_v4_1 = require("ethers-v4");
exports.isJsonRpcErrorResponse = (response) => {

@@ -24,3 +24,3 @@ return typeof response.error !== 'undefined';

try {
ethers_1.ethers.utils.getAddress(app_1.add0x(address));
ethers_v4_1.ethers.utils.getAddress(app_1.add0x(address));
return true;

@@ -27,0 +27,0 @@ }

@@ -5,3 +5,3 @@ "use strict";

const ethereum_waffle_1 = require("ethereum-waffle");
const ethers_1 = require("ethers");
const ethers_v4_1 = require("ethers-v4");
const app_1 = require("../../src/app");

@@ -11,3 +11,3 @@ const dummyContractFactory = (wallet) => {

const emptyContractBytecode = '6080604052348015600f57600080fd5b50606c80601d6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806326121ff014602d575b600080fd5b60336035565b005b56fea265627a7a723158205942af3e61207ff648ab4e4c2c1239bc0adf44f657e8436f08e6ea2ff336d38a64736f6c63430005100032';
return new ethers_1.ContractFactory(emptyContractAbi, emptyContractBytecode, wallet);
return new ethers_v4_1.ContractFactory(emptyContractAbi, emptyContractBytecode, wallet);
};

@@ -14,0 +14,0 @@ describe('Contract deployment', () => {

{
"name": "@eth-optimism/core-utils",
"version": "0.0.1-alpha.29",
"version": "0.0.1-alpha.30",
"description": "Optimism Core Utils",

@@ -42,3 +42,3 @@ "main": "build/index.js",

"ethereumjs-util": "^6.2.0",
"ethers": "^4.0.37",
"ethers-v4": "npm:ethers@4",
"express": "^4.17.1",

@@ -45,0 +45,0 @@ "memdown": "^4.0.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