2
0
mirror of synced 2025-02-24 03:58:06 +00:00

Updated dist files.

This commit is contained in:
Richard Moore 2020-01-29 21:43:56 -05:00
parent 7428776f75
commit bee5944567
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
45 changed files with 446 additions and 205 deletions

View File

@ -3,11 +3,17 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated. This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.0-beta.171 (2020-01-29 21:41)
-----------------------------------------
- Better solc support in CLI; it will search the local pacakge for an existing solc version. ([7428776](https://github.com/ethers-io/ethers.js/commit/7428776f75222d5c07282bc29c3dd8ed99f5d2cc))
- Update ENS registry address and lower default quorum for testnets. ([edb49da](https://github.com/ethers-io/ethers.js/commit/edb49da15518f25b3d60813ebb84f54171e308f3))
- Exposed isBytes and isBytesLike in ethers.utils. ([99329b0](https://github.com/ethers-io/ethers.js/commit/99329b013ce7f3af301d40c41f7eb35bff288910))
ethers/v5.0.0-beta.170 (2020-01-21 20:37) ethers/v5.0.0-beta.170 (2020-01-21 20:37)
----------------------------------------- -----------------------------------------
- Better, easier and more provider testing. ([e0d1d38](https://github.com/ethers-io/ethers.js/commit/e0d1d3866d2559f39627254873a0a1d4c0fcaf3d)) - Better, easier and more provider testing. ([e0d1d38](https://github.com/ethers-io/ethers.js/commit/e0d1d3866d2559f39627254873a0a1d4c0fcaf3d))
- Updated dist files. ([f92d156](https://github.com/ethers-io/ethers.js/commit/f92d156f1784bbb299d99fe6a0ddb53c0e2d0d09))
- Fixed out-of-bounds difficulty in getBlock, which can affect PoA networks. ([#711](https://github.com/ethers-io/ethers.js/issues/711); [251882c](https://github.com/ethers-io/ethers.js/commit/251882ced4379931ec82ba28a4db10bc7dbf3580)) - Fixed out-of-bounds difficulty in getBlock, which can affect PoA networks. ([#711](https://github.com/ethers-io/ethers.js/issues/711); [251882c](https://github.com/ethers-io/ethers.js/commit/251882ced4379931ec82ba28a4db10bc7dbf3580))
ethers/v5.0.0-beta.169 (2020-01-20 19:42) ethers/v5.0.0-beta.169 (2020-01-20 19:42)

View File

@ -1 +1 @@
export declare const version = "cli/5.0.0-beta.148"; export declare const version = "cli/5.0.0-beta.149";

View File

@ -1 +1 @@
export const version = "cli/5.0.0-beta.148"; export const version = "cli/5.0.0-beta.149";

View File

@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
import fs from "fs"; import fs from "fs";
import _module from "module";
import { dirname, resolve } from "path"; import { dirname, resolve } from "path";
import REPL from "repl"; import REPL from "repl";
import util from "util"; import util from "util";
@ -18,7 +17,7 @@ import vm from "vm";
import { ethers } from "ethers"; import { ethers } from "ethers";
import { CLI, dump, Plugin } from "../cli"; import { CLI, dump, Plugin } from "../cli";
import { getPassword, getProgressBar } from "../prompt"; import { getPassword, getProgressBar } from "../prompt";
import { compile } from "../solc"; import { compile, customRequire } from "../solc";
function setupContext(path, context, plugin) { function setupContext(path, context, plugin) {
context.provider = plugin.provider; context.provider = plugin.provider;
context.accounts = plugin.accounts; context.accounts = plugin.accounts;
@ -32,7 +31,8 @@ function setupContext(path, context, plugin) {
context.console = console; context.console = console;
} }
if (!context.require) { if (!context.require) {
context.require = _module.createRequireFromPath(path); //context.require = _module.createRequireFromPath(path);
context.require = customRequire(path);
} }
if (!context.process) { if (!context.process) {
context.process = process; context.process = process;
@ -225,10 +225,15 @@ class FundPlugin extends Plugin {
if (this.network.name !== "ropsten") { if (this.network.name !== "ropsten") {
this.throwError("Funding requires --network ropsten"); this.throwError("Funding requires --network ropsten");
} }
if (args.length !== 1) { if (args.length === 1) {
this.toAddress = yield this.getAddress(args[0], "Cannot fund ZERO address", false);
}
else if (args.length === 0 && this.accounts.length === 1) {
this.toAddress = yield this.accounts[0].getAddress();
}
else {
this.throwUsageError("fund requires ADDRESS"); this.throwUsageError("fund requires ADDRESS");
} }
this.toAddress = yield this.getAddress(args[0], "Cannot fund ZERO address", false);
}); });
} }
run() { run() {
@ -757,22 +762,37 @@ class CompilePlugin extends Plugin {
if (args.length !== 1) { if (args.length !== 1) {
this.throwError("compile requires exactly FILENAME"); this.throwError("compile requires exactly FILENAME");
} }
this.filename = args[0]; this.filename = resolve(args[0]);
}); });
} }
run() { run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let source = fs.readFileSync(this.filename).toString(); const source = fs.readFileSync(this.filename).toString();
let result = compile(source, { let result = null;
try {
result = compile(source, {
filename: this.filename, filename: this.filename,
optimize: (!this.noOptimize) optimize: (!this.noOptimize)
}); });
}
catch (error) {
if (error.errors) {
error.errors.forEach((error) => {
console.log(error);
});
}
else {
throw error;
}
throw new Error("Failed to compile contract.");
}
let output = {}; let output = {};
result.forEach((contract, index) => { result.forEach((contract, index) => {
output[contract.name] = { output[contract.name] = {
bytecode: contract.bytecode, bytecode: contract.bytecode,
runtime: contract.runtime, runtime: contract.runtime,
interface: contract.interface.fragments.map((f) => f.format(ethers.utils.FormatTypes.full)) interface: contract.interface.fragments.map((f) => f.format(ethers.utils.FormatTypes.full)),
compiler: contract.compiler
}; };
}); });
console.log(JSON.stringify(output, null, 4)); console.log(JSON.stringify(output, null, 4));
@ -821,30 +841,49 @@ class DeployPlugin extends Plugin {
if (args.length !== 1) { if (args.length !== 1) {
this.throwError("deploy requires exactly FILENAME"); this.throwError("deploy requires exactly FILENAME");
} }
this.filename = args[0]; this.filename = resolve(args[0]);
}); });
} }
run() { run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let source = fs.readFileSync(this.filename).toString(); let source = fs.readFileSync(this.filename).toString();
let result = compile(source, { let result = null;
try {
result = compile(source, {
filename: this.filename, filename: this.filename,
optimize: (!this.noOptimize) optimize: (!this.noOptimize)
}); });
let codes = result.filter((c) => (c.bytecode !== "0x" && (this.contractName == null || this.contractName == c.name))); }
catch (error) {
if (error.errors) {
error.errors.forEach((error) => {
console.log(error);
});
}
else {
throw error;
}
throw new Error("Failed to compile contract.");
}
const codes = result.filter((c) => (this.contractName == null || this.contractName == c.name));
if (codes.length > 1) { if (codes.length > 1) {
this.throwError("Please specify a contract with --contract NAME"); this.throwError("Multiple contracts found; please specify a contract with --contract NAME");
} }
if (codes.length === 0) { if (codes.length === 0) {
this.throwError("No contract found"); this.throwError("No contract found");
} }
let factory = new ethers.ContractFactory(codes[0].interface, codes[0].bytecode, this.accounts[0]); const factory = new ethers.ContractFactory(codes[0].interface, codes[0].bytecode, this.accounts[0]);
let contract = yield factory.deploy(); dump("Deploying:", {
Contract: codes[0].name,
Bytecode: codes[0].bytecode,
Interface: codes[0].interface.fragments.map((f) => f.format(ethers.utils.FormatTypes.full)),
Compiler: codes[0].compiler,
Optimizer: (this.noOptimize ? "No" : "Yes")
});
const contract = yield factory.deploy();
dump("Deployed:", { dump("Deployed:", {
Contract: codes[0].name, Contract: codes[0].name,
Address: contract.address, Address: contract.address,
Bytecode: codes[0].bytecode,
Interface: codes[0].interface.fragments.map((f) => f.format(ethers.utils.FormatTypes.full))
}); });
}); });
} }

View File

@ -2,8 +2,9 @@ import { ethers } from "ethers";
export interface ContractCode { export interface ContractCode {
interface: ethers.utils.Interface; interface: ethers.utils.Interface;
name: string; name: string;
bytecode?: string; compiler: string;
runtime?: string; bytecode: string;
runtime: string;
} }
export declare type CompilerOptions = { export declare type CompilerOptions = {
filename?: string; filename?: string;
@ -11,4 +12,6 @@ export declare type CompilerOptions = {
optimize?: boolean; optimize?: boolean;
throwWarnings?: boolean; throwWarnings?: boolean;
}; };
export declare function compile(source: string, options?: CompilerOptions): Array<ContractCode>; export declare function customRequire(path: string): (name: string) => any;
export declare function wrapSolc(_solc: any): (source: string, options?: CompilerOptions) => Array<ContractCode>;
export declare const compile: (source: string, options?: CompilerOptions) => ContractCode[];

View File

@ -1,16 +1,10 @@
'use strict'; 'use strict';
import fs from "fs"; import fs from "fs";
import _module from "module";
import { dirname, resolve } from "path"; import { dirname, resolve } from "path";
import { ethers } from "ethers"; import { ethers } from "ethers";
let _solc = null;
function getSolc() {
if (!_solc) {
_solc = require("solc");
}
return _solc;
}
; ;
export function compile(source, options) { function populateOptions(options) {
options = ethers.utils.shallowCopy(options || {}); options = ethers.utils.shallowCopy(options || {});
if (options.filename && !options.basedir) { if (options.filename && !options.basedir) {
options.basedir = dirname(options.filename); options.basedir = dirname(options.filename);
@ -21,9 +15,12 @@ export function compile(source, options) {
if (!options.basedir) { if (!options.basedir) {
options.basedir = "."; options.basedir = ".";
} }
let sources = {}; return options;
}
function getInput(source, options) {
const sources = {};
sources[options.filename] = { content: source }; sources[options.filename] = { content: source };
let input = { const input = {
language: "Solidity", language: "Solidity",
sources: sources, sources: sources,
settings: { settings: {
@ -40,6 +37,21 @@ export function compile(source, options) {
runs: 200 runs: 200
}; };
} }
return input;
}
function _compile(_solc, source, options) {
const compilerVersion = _solc.version();
const ver = compilerVersion.match(/(\d+)\.(\d+)\.(\d+)/);
if (!ver || ver[1] !== "0") {
throw new Error("unknown version");
}
const version = parseFloat(ver[2] + "." + ver[3]);
//if (version < 4.11 || version >= 7) {
if (version < 5.0 || version >= 7.0) {
throw new Error(`unsupported version: ${ver[1]}.${ver[2]}.${ver[3]}`);
}
options = populateOptions(options);
const input = getInput(source, options);
let findImport = (filename) => { let findImport = (filename) => {
try { try {
return { return {
@ -50,24 +62,59 @@ export function compile(source, options) {
return { error: error.message }; return { error: error.message };
} }
}; };
let output = JSON.parse(getSolc().compile(JSON.stringify(input), findImport)); if (version >= 6) {
let errors = (output.errors || []).filter((x) => (x.severity === "error" || options.throwWarnings)).map((x) => x.formattedMessage); findImport = { import: findImport };
}
const outputJson = _solc.compile(JSON.stringify(input), findImport);
const output = JSON.parse(outputJson);
const errors = (output.errors || []).filter((x) => (x.severity === "error" || options.throwWarnings)).map((x) => x.formattedMessage);
if (errors.length) { if (errors.length) {
let error = new Error("compilation error"); const error = new Error("compilation error");
error.errors = errors; error.errors = errors;
throw error; throw error;
} }
let result = []; const result = [];
for (let filename in output.contracts) { for (let filename in output.contracts) {
for (let name in output.contracts[filename]) { for (let name in output.contracts[filename]) {
let contract = output.contracts[filename][name]; let contract = output.contracts[filename][name];
// Skip empty contracts
if (!contract.evm.bytecode.object) {
continue;
}
result.push({ result.push({
name: name, name: name,
interface: new ethers.utils.Interface(contract.abi), interface: new ethers.utils.Interface(contract.abi),
bytecode: "0x" + contract.evm.bytecode.object, bytecode: "0x" + contract.evm.bytecode.object,
runtime: "0x" + contract.evm.deployedBytecode.object runtime: "0x" + contract.evm.deployedBytecode.object,
compiler: compilerVersion
}); });
} }
} }
return result; return result;
} }
// Creates a require which will first search from the current location,
// and for solc will fallback onto the version included in @ethersproject/cli
export function customRequire(path) {
const pathRequire = _module.createRequireFromPath(resolve(path, "./sandbox.js"));
const libRequire = _module.createRequireFromPath(resolve(__filename));
return function (name) {
try {
return pathRequire(name);
}
catch (error) {
if (name === "solc") {
try {
return libRequire(name);
}
catch (error) { }
}
throw error;
}
};
}
export function wrapSolc(_solc) {
return function (source, options) {
return _compile(_solc, source, options || {});
};
}
export const compile = wrapSolc(customRequire(".")("solc"));

View File

@ -1 +1 @@
export declare const version = "cli/5.0.0-beta.148"; export declare const version = "cli/5.0.0-beta.149";

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "cli/5.0.0-beta.148"; exports.version = "cli/5.0.0-beta.149";

View File

@ -54,7 +54,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = __importDefault(require("fs")); var fs_1 = __importDefault(require("fs"));
var module_1 = __importDefault(require("module"));
var path_1 = require("path"); var path_1 = require("path");
var repl_1 = __importDefault(require("repl")); var repl_1 = __importDefault(require("repl"));
var util_1 = __importDefault(require("util")); var util_1 = __importDefault(require("util"));
@ -76,7 +75,8 @@ function setupContext(path, context, plugin) {
context.console = console; context.console = console;
} }
if (!context.require) { if (!context.require) {
context.require = module_1.default.createRequireFromPath(path); //context.require = _module.createRequireFromPath(path);
context.require = solc_1.customRequire(path);
} }
if (!context.process) { if (!context.process) {
context.process = process; context.process = process;
@ -316,23 +316,32 @@ var FundPlugin = /** @class */ (function (_super) {
}; };
FundPlugin.prototype.prepareArgs = function (args) { FundPlugin.prototype.prepareArgs = function (args) {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var _a; var _a, _b;
return __generator(this, function (_b) { return __generator(this, function (_c) {
switch (_b.label) { switch (_c.label) {
case 0: return [4 /*yield*/, _super.prototype.prepareArgs.call(this, args)]; case 0: return [4 /*yield*/, _super.prototype.prepareArgs.call(this, args)];
case 1: case 1:
_b.sent(); _c.sent();
if (this.network.name !== "ropsten") { if (this.network.name !== "ropsten") {
this.throwError("Funding requires --network ropsten"); this.throwError("Funding requires --network ropsten");
} }
if (args.length !== 1) { if (!(args.length === 1)) return [3 /*break*/, 3];
this.throwUsageError("fund requires ADDRESS");
}
_a = this; _a = this;
return [4 /*yield*/, this.getAddress(args[0], "Cannot fund ZERO address", false)]; return [4 /*yield*/, this.getAddress(args[0], "Cannot fund ZERO address", false)];
case 2: case 2:
_a.toAddress = _b.sent(); _a.toAddress = _c.sent();
return [2 /*return*/]; return [3 /*break*/, 6];
case 3:
if (!(args.length === 0 && this.accounts.length === 1)) return [3 /*break*/, 5];
_b = this;
return [4 /*yield*/, this.accounts[0].getAddress()];
case 4:
_b.toAddress = _c.sent();
return [3 /*break*/, 6];
case 5:
this.throwUsageError("fund requires ADDRESS");
_c.label = 6;
case 6: return [2 /*return*/];
} }
}); });
}); });
@ -1106,7 +1115,7 @@ var CompilePlugin = /** @class */ (function (_super) {
if (args.length !== 1) { if (args.length !== 1) {
this.throwError("compile requires exactly FILENAME"); this.throwError("compile requires exactly FILENAME");
} }
this.filename = args[0]; this.filename = path_1.resolve(args[0]);
return [2 /*return*/]; return [2 /*return*/];
} }
}); });
@ -1117,16 +1126,31 @@ var CompilePlugin = /** @class */ (function (_super) {
var source, result, output; var source, result, output;
return __generator(this, function (_a) { return __generator(this, function (_a) {
source = fs_1.default.readFileSync(this.filename).toString(); source = fs_1.default.readFileSync(this.filename).toString();
result = null;
try {
result = solc_1.compile(source, { result = solc_1.compile(source, {
filename: this.filename, filename: this.filename,
optimize: (!this.noOptimize) optimize: (!this.noOptimize)
}); });
}
catch (error) {
if (error.errors) {
error.errors.forEach(function (error) {
console.log(error);
});
}
else {
throw error;
}
throw new Error("Failed to compile contract.");
}
output = {}; output = {};
result.forEach(function (contract, index) { result.forEach(function (contract, index) {
output[contract.name] = { output[contract.name] = {
bytecode: contract.bytecode, bytecode: contract.bytecode,
runtime: contract.runtime, runtime: contract.runtime,
interface: contract.interface.fragments.map(function (f) { return f.format(ethers_1.ethers.utils.FormatTypes.full); }) interface: contract.interface.fragments.map(function (f) { return f.format(ethers_1.ethers.utils.FormatTypes.full); }),
compiler: contract.compiler
}; };
}); });
console.log(JSON.stringify(output, null, 4)); console.log(JSON.stringify(output, null, 4));
@ -1187,7 +1211,7 @@ var DeployPlugin = /** @class */ (function (_super) {
if (args.length !== 1) { if (args.length !== 1) {
this.throwError("deploy requires exactly FILENAME"); this.throwError("deploy requires exactly FILENAME");
} }
this.filename = args[0]; this.filename = path_1.resolve(args[0]);
return [2 /*return*/]; return [2 /*return*/];
} }
}); });
@ -1201,26 +1225,45 @@ var DeployPlugin = /** @class */ (function (_super) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
source = fs_1.default.readFileSync(this.filename).toString(); source = fs_1.default.readFileSync(this.filename).toString();
result = null;
try {
result = solc_1.compile(source, { result = solc_1.compile(source, {
filename: this.filename, filename: this.filename,
optimize: (!this.noOptimize) optimize: (!this.noOptimize)
}); });
codes = result.filter(function (c) { return (c.bytecode !== "0x" && (_this.contractName == null || _this.contractName == c.name)); }); }
catch (error) {
if (error.errors) {
error.errors.forEach(function (error) {
console.log(error);
});
}
else {
throw error;
}
throw new Error("Failed to compile contract.");
}
codes = result.filter(function (c) { return (_this.contractName == null || _this.contractName == c.name); });
if (codes.length > 1) { if (codes.length > 1) {
this.throwError("Please specify a contract with --contract NAME"); this.throwError("Multiple contracts found; please specify a contract with --contract NAME");
} }
if (codes.length === 0) { if (codes.length === 0) {
this.throwError("No contract found"); this.throwError("No contract found");
} }
factory = new ethers_1.ethers.ContractFactory(codes[0].interface, codes[0].bytecode, this.accounts[0]); factory = new ethers_1.ethers.ContractFactory(codes[0].interface, codes[0].bytecode, this.accounts[0]);
cli_1.dump("Deploying:", {
Contract: codes[0].name,
Bytecode: codes[0].bytecode,
Interface: codes[0].interface.fragments.map(function (f) { return f.format(ethers_1.ethers.utils.FormatTypes.full); }),
Compiler: codes[0].compiler,
Optimizer: (this.noOptimize ? "No" : "Yes")
});
return [4 /*yield*/, factory.deploy()]; return [4 /*yield*/, factory.deploy()];
case 1: case 1:
contract = _a.sent(); contract = _a.sent();
cli_1.dump("Deployed:", { cli_1.dump("Deployed:", {
Contract: codes[0].name, Contract: codes[0].name,
Address: contract.address, Address: contract.address,
Bytecode: codes[0].bytecode,
Interface: codes[0].interface.fragments.map(function (f) { return f.format(ethers_1.ethers.utils.FormatTypes.full); })
}); });
return [2 /*return*/]; return [2 /*return*/];
} }

View File

@ -2,8 +2,9 @@ import { ethers } from "ethers";
export interface ContractCode { export interface ContractCode {
interface: ethers.utils.Interface; interface: ethers.utils.Interface;
name: string; name: string;
bytecode?: string; compiler: string;
runtime?: string; bytecode: string;
runtime: string;
} }
export declare type CompilerOptions = { export declare type CompilerOptions = {
filename?: string; filename?: string;
@ -11,4 +12,6 @@ export declare type CompilerOptions = {
optimize?: boolean; optimize?: boolean;
throwWarnings?: boolean; throwWarnings?: boolean;
}; };
export declare function compile(source: string, options?: CompilerOptions): Array<ContractCode>; export declare function customRequire(path: string): (name: string) => any;
export declare function wrapSolc(_solc: any): (source: string, options?: CompilerOptions) => Array<ContractCode>;
export declare const compile: (source: string, options?: CompilerOptions) => ContractCode[];

View File

@ -4,17 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = __importDefault(require("fs")); var fs_1 = __importDefault(require("fs"));
var module_1 = __importDefault(require("module"));
var path_1 = require("path"); var path_1 = require("path");
var ethers_1 = require("ethers"); var ethers_1 = require("ethers");
var _solc = null;
function getSolc() {
if (!_solc) {
_solc = require("solc");
}
return _solc;
}
; ;
function compile(source, options) { function populateOptions(options) {
options = ethers_1.ethers.utils.shallowCopy(options || {}); options = ethers_1.ethers.utils.shallowCopy(options || {});
if (options.filename && !options.basedir) { if (options.filename && !options.basedir) {
options.basedir = path_1.dirname(options.filename); options.basedir = path_1.dirname(options.filename);
@ -25,6 +19,9 @@ function compile(source, options) {
if (!options.basedir) { if (!options.basedir) {
options.basedir = "."; options.basedir = ".";
} }
return options;
}
function getInput(source, options) {
var sources = {}; var sources = {};
sources[options.filename] = { content: source }; sources[options.filename] = { content: source };
var input = { var input = {
@ -44,6 +41,21 @@ function compile(source, options) {
runs: 200 runs: 200
}; };
} }
return input;
}
function _compile(_solc, source, options) {
var compilerVersion = _solc.version();
var ver = compilerVersion.match(/(\d+)\.(\d+)\.(\d+)/);
if (!ver || ver[1] !== "0") {
throw new Error("unknown version");
}
var version = parseFloat(ver[2] + "." + ver[3]);
//if (version < 4.11 || version >= 7) {
if (version < 5.0 || version >= 7.0) {
throw new Error("unsupported version: " + ver[1] + "." + ver[2] + "." + ver[3]);
}
options = populateOptions(options);
var input = getInput(source, options);
var findImport = function (filename) { var findImport = function (filename) {
try { try {
return { return {
@ -54,7 +66,11 @@ function compile(source, options) {
return { error: error.message }; return { error: error.message };
} }
}; };
var output = JSON.parse(getSolc().compile(JSON.stringify(input), findImport)); if (version >= 6) {
findImport = { import: findImport };
}
var outputJson = _solc.compile(JSON.stringify(input), findImport);
var output = JSON.parse(outputJson);
var errors = (output.errors || []).filter(function (x) { return (x.severity === "error" || options.throwWarnings); }).map(function (x) { return x.formattedMessage; }); var errors = (output.errors || []).filter(function (x) { return (x.severity === "error" || options.throwWarnings); }).map(function (x) { return x.formattedMessage; });
if (errors.length) { if (errors.length) {
var error = new Error("compilation error"); var error = new Error("compilation error");
@ -65,14 +81,46 @@ function compile(source, options) {
for (var filename in output.contracts) { for (var filename in output.contracts) {
for (var name_1 in output.contracts[filename]) { for (var name_1 in output.contracts[filename]) {
var contract = output.contracts[filename][name_1]; var contract = output.contracts[filename][name_1];
// Skip empty contracts
if (!contract.evm.bytecode.object) {
continue;
}
result.push({ result.push({
name: name_1, name: name_1,
interface: new ethers_1.ethers.utils.Interface(contract.abi), interface: new ethers_1.ethers.utils.Interface(contract.abi),
bytecode: "0x" + contract.evm.bytecode.object, bytecode: "0x" + contract.evm.bytecode.object,
runtime: "0x" + contract.evm.deployedBytecode.object runtime: "0x" + contract.evm.deployedBytecode.object,
compiler: compilerVersion
}); });
} }
} }
return result; return result;
} }
exports.compile = compile; // Creates a require which will first search from the current location,
// and for solc will fallback onto the version included in @ethersproject/cli
function customRequire(path) {
var pathRequire = module_1.default.createRequireFromPath(path_1.resolve(path, "./sandbox.js"));
var libRequire = module_1.default.createRequireFromPath(path_1.resolve(__filename));
return function (name) {
try {
return pathRequire(name);
}
catch (error) {
if (name === "solc") {
try {
return libRequire(name);
}
catch (error) { }
}
throw error;
}
};
}
exports.customRequire = customRequire;
function wrapSolc(_solc) {
return function (source, options) {
return _compile(_solc, source, options || {});
};
}
exports.wrapSolc = wrapSolc;
exports.compile = wrapSolc(customRequire(".")("solc"));

View File

@ -37,7 +37,7 @@
"scripts": { "scripts": {
"test": "exit 1" "test": "exit 1"
}, },
"tarballHash": "0x8c1c74059eaf59d10d94fcb2285fb2512a1fdf121ef5c3167e8afa16807bbbb3", "tarballHash": "0xebbe9e618094f2c7d91e811cbccffa95f315c6e83f730ddff4741ca31fa1a92e",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.0.0-beta.148" "version": "5.0.0-beta.149"
} }

View File

@ -1 +1 @@
export const version = "cli/5.0.0-beta.148"; export const version = "cli/5.0.0-beta.149";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15194,7 +15194,7 @@ function verifyMessage(message, signature) {
return recoverAddress(hashMessage(message), signature); return recoverAddress(hashMessage(message), signature);
} }
const version$h = "networks/5.0.0-beta.134"; const version$h = "networks/5.0.0-beta.135";
"use strict"; "use strict";
const logger$l = new Logger(version$h); const logger$l = new Logger(version$h);
@ -15237,8 +15237,13 @@ function ethDefaultProvider(network) {
quorum = options.quorum; quorum = options.quorum;
} }
else if (quorum > 2) { else if (quorum > 2) {
if (network === "homestead") {
quorum = 2; quorum = 2;
} }
else {
quorum = 1;
}
}
return new providers.FallbackProvider(providerList, quorum); return new providers.FallbackProvider(providerList, quorum);
} }
return providerList[0]; return providerList[0];
@ -15254,13 +15259,13 @@ function etcDefaultProvider(url, network) {
} }
const homestead = { const homestead = {
chainId: 1, chainId: 1,
ensAddress: "0x314159265dd8dbb310642f98f50c066173c1259b", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "homestead", name: "homestead",
_defaultProvider: ethDefaultProvider("homestead") _defaultProvider: ethDefaultProvider("homestead")
}; };
const ropsten = { const ropsten = {
chainId: 3, chainId: 3,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "ropsten", name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten") _defaultProvider: ethDefaultProvider("ropsten")
}; };
@ -15284,7 +15289,7 @@ const networks = {
testnet: ropsten, testnet: ropsten,
rinkeby: { rinkeby: {
chainId: 4, chainId: 4,
ensAddress: "0xe7410170f87102DF0055eB195163A03B7F2Bff4A", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "rinkeby", name: "rinkeby",
_defaultProvider: ethDefaultProvider("rinkeby") _defaultProvider: ethDefaultProvider("rinkeby")
}, },
@ -15295,7 +15300,7 @@ const networks = {
}, },
goerli: { goerli: {
chainId: 5, chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "goerli", name: "goerli",
_defaultProvider: ethDefaultProvider("goerli") _defaultProvider: ethDefaultProvider("goerli")
}, },
@ -19213,6 +19218,8 @@ var utils$1 = /*#__PURE__*/Object.freeze({
concat: concat, concat: concat,
stripZeros: stripZeros, stripZeros: stripZeros,
zeroPad: zeroPad, zeroPad: zeroPad,
isBytes: isBytes,
isBytesLike: isBytesLike,
defaultPath: defaultPath, defaultPath: defaultPath,
HDNode: HDNode, HDNode: HDNode,
SigningKey: SigningKey, SigningKey: SigningKey,
@ -19273,7 +19280,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed Indexed: Indexed
}); });
const version$l = "ethers/5.0.0-beta.170"; const version$l = "ethers/5.0.0-beta.171";
"use strict"; "use strict";
const errors = Logger.errors; const errors = Logger.errors;

File diff suppressed because one or more lines are too long

View File

@ -16558,7 +16558,7 @@
var _version$C = createCommonjsModule(function (module, exports) { var _version$C = createCommonjsModule(function (module, exports) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "networks/5.0.0-beta.134"; exports.version = "networks/5.0.0-beta.135";
}); });
var _version$D = unwrapExports(_version$C); var _version$D = unwrapExports(_version$C);
@ -16609,8 +16609,13 @@
quorum = options.quorum; quorum = options.quorum;
} }
else if (quorum > 2) { else if (quorum > 2) {
if (network === "homestead") {
quorum = 2; quorum = 2;
} }
else {
quorum = 1;
}
}
return new providers.FallbackProvider(providerList, quorum); return new providers.FallbackProvider(providerList, quorum);
} }
return providerList[0]; return providerList[0];
@ -16626,13 +16631,13 @@
} }
var homestead = { var homestead = {
chainId: 1, chainId: 1,
ensAddress: "0x314159265dd8dbb310642f98f50c066173c1259b", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "homestead", name: "homestead",
_defaultProvider: ethDefaultProvider("homestead") _defaultProvider: ethDefaultProvider("homestead")
}; };
var ropsten = { var ropsten = {
chainId: 3, chainId: 3,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "ropsten", name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten") _defaultProvider: ethDefaultProvider("ropsten")
}; };
@ -16656,7 +16661,7 @@
testnet: ropsten, testnet: ropsten,
rinkeby: { rinkeby: {
chainId: 4, chainId: 4,
ensAddress: "0xe7410170f87102DF0055eB195163A03B7F2Bff4A", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "rinkeby", name: "rinkeby",
_defaultProvider: ethDefaultProvider("rinkeby") _defaultProvider: ethDefaultProvider("rinkeby")
}, },
@ -16667,7 +16672,7 @@
}, },
goerli: { goerli: {
chainId: 5, chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "goerli", name: "goerli",
_defaultProvider: ethDefaultProvider("goerli") _defaultProvider: ethDefaultProvider("goerli")
}, },
@ -21622,6 +21627,8 @@
exports.hexStripZeros = lib$1.hexStripZeros; exports.hexStripZeros = lib$1.hexStripZeros;
exports.hexValue = lib$1.hexValue; exports.hexValue = lib$1.hexValue;
exports.hexZeroPad = lib$1.hexZeroPad; exports.hexZeroPad = lib$1.hexZeroPad;
exports.isBytes = lib$1.isBytes;
exports.isBytesLike = lib$1.isBytesLike;
exports.isHexString = lib$1.isHexString; exports.isHexString = lib$1.isHexString;
exports.joinSignature = lib$1.joinSignature; exports.joinSignature = lib$1.joinSignature;
exports.zeroPad = lib$1.zeroPad; exports.zeroPad = lib$1.zeroPad;
@ -21724,67 +21731,69 @@
var utils_21 = utils$3.hexStripZeros; var utils_21 = utils$3.hexStripZeros;
var utils_22 = utils$3.hexValue; var utils_22 = utils$3.hexValue;
var utils_23 = utils$3.hexZeroPad; var utils_23 = utils$3.hexZeroPad;
var utils_24 = utils$3.isHexString; var utils_24 = utils$3.isBytes;
var utils_25 = utils$3.joinSignature; var utils_25 = utils$3.isBytesLike;
var utils_26 = utils$3.zeroPad; var utils_26 = utils$3.isHexString;
var utils_27 = utils$3.splitSignature; var utils_27 = utils$3.joinSignature;
var utils_28 = utils$3.stripZeros; var utils_28 = utils$3.zeroPad;
var utils_29 = utils$3.hashMessage; var utils_29 = utils$3.splitSignature;
var utils_30 = utils$3.id; var utils_30 = utils$3.stripZeros;
var utils_31 = utils$3.isValidName; var utils_31 = utils$3.hashMessage;
var utils_32 = utils$3.namehash; var utils_32 = utils$3.id;
var utils_33 = utils$3.defaultPath; var utils_33 = utils$3.isValidName;
var utils_34 = utils$3.entropyToMnemonic; var utils_34 = utils$3.namehash;
var utils_35 = utils$3.HDNode; var utils_35 = utils$3.defaultPath;
var utils_36 = utils$3.isValidMnemonic; var utils_36 = utils$3.entropyToMnemonic;
var utils_37 = utils$3.mnemonicToEntropy; var utils_37 = utils$3.HDNode;
var utils_38 = utils$3.mnemonicToSeed; var utils_38 = utils$3.isValidMnemonic;
var utils_39 = utils$3.getJsonWalletAddress; var utils_39 = utils$3.mnemonicToEntropy;
var utils_40 = utils$3.keccak256; var utils_40 = utils$3.mnemonicToSeed;
var utils_41 = utils$3.Logger; var utils_41 = utils$3.getJsonWalletAddress;
var utils_42 = utils$3.sha256; var utils_42 = utils$3.keccak256;
var utils_43 = utils$3.solidityKeccak256; var utils_43 = utils$3.Logger;
var utils_44 = utils$3.solidityPack; var utils_44 = utils$3.sha256;
var utils_45 = utils$3.soliditySha256; var utils_45 = utils$3.solidityKeccak256;
var utils_46 = utils$3.randomBytes; var utils_46 = utils$3.solidityPack;
var utils_47 = utils$3.checkProperties; var utils_47 = utils$3.soliditySha256;
var utils_48 = utils$3.deepCopy; var utils_48 = utils$3.randomBytes;
var utils_49 = utils$3.defineReadOnly; var utils_49 = utils$3.checkProperties;
var utils_50 = utils$3.getStatic; var utils_50 = utils$3.deepCopy;
var utils_51 = utils$3.resolveProperties; var utils_51 = utils$3.defineReadOnly;
var utils_52 = utils$3.shallowCopy; var utils_52 = utils$3.getStatic;
var utils_53 = utils$3.RLP; var utils_53 = utils$3.resolveProperties;
var utils_54 = utils$3.computePublicKey; var utils_54 = utils$3.shallowCopy;
var utils_55 = utils$3.recoverPublicKey; var utils_55 = utils$3.RLP;
var utils_56 = utils$3.SigningKey; var utils_56 = utils$3.computePublicKey;
var utils_57 = utils$3.formatBytes32String; var utils_57 = utils$3.recoverPublicKey;
var utils_58 = utils$3.nameprep; var utils_58 = utils$3.SigningKey;
var utils_59 = utils$3.parseBytes32String; var utils_59 = utils$3.formatBytes32String;
var utils_60 = utils$3._toEscapedUtf8String; var utils_60 = utils$3.nameprep;
var utils_61 = utils$3.toUtf8Bytes; var utils_61 = utils$3.parseBytes32String;
var utils_62 = utils$3.toUtf8CodePoints; var utils_62 = utils$3._toEscapedUtf8String;
var utils_63 = utils$3.toUtf8String; var utils_63 = utils$3.toUtf8Bytes;
var utils_64 = utils$3.Utf8ErrorFuncs; var utils_64 = utils$3.toUtf8CodePoints;
var utils_65 = utils$3.computeAddress; var utils_65 = utils$3.toUtf8String;
var utils_66 = utils$3.parseTransaction; var utils_66 = utils$3.Utf8ErrorFuncs;
var utils_67 = utils$3.recoverAddress; var utils_67 = utils$3.computeAddress;
var utils_68 = utils$3.serializeTransaction; var utils_68 = utils$3.parseTransaction;
var utils_69 = utils$3.commify; var utils_69 = utils$3.recoverAddress;
var utils_70 = utils$3.formatEther; var utils_70 = utils$3.serializeTransaction;
var utils_71 = utils$3.parseEther; var utils_71 = utils$3.commify;
var utils_72 = utils$3.formatUnits; var utils_72 = utils$3.formatEther;
var utils_73 = utils$3.parseUnits; var utils_73 = utils$3.parseEther;
var utils_74 = utils$3.verifyMessage; var utils_74 = utils$3.formatUnits;
var utils_75 = utils$3.fetchJson; var utils_75 = utils$3.parseUnits;
var utils_76 = utils$3.poll; var utils_76 = utils$3.verifyMessage;
var utils_77 = utils$3.SupportedAlgorithm; var utils_77 = utils$3.fetchJson;
var utils_78 = utils$3.UnicodeNormalizationForm; var utils_78 = utils$3.poll;
var utils_79 = utils$3.Utf8ErrorReason; var utils_79 = utils$3.SupportedAlgorithm;
var utils_80 = utils$3.UnicodeNormalizationForm;
var utils_81 = utils$3.Utf8ErrorReason;
var _version$K = createCommonjsModule(function (module, exports) { var _version$K = createCommonjsModule(function (module, exports) {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.170"; exports.version = "ethers/5.0.0-beta.171";
}); });
var _version$L = unwrapExports(_version$K); var _version$L = unwrapExports(_version$K);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.170"; export declare const version = "ethers/5.0.0-beta.171";

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.170"; export const version = "ethers/5.0.0-beta.171";

View File

@ -1,7 +1,7 @@
import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi"; import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi";
import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address"; import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address";
import * as base64 from "@ethersproject/base64"; import * as base64 from "@ethersproject/base64";
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes"; import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes";
import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash"; import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash";
import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode"; import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode";
import { getJsonWalletAddress } from "@ethersproject/json-wallets"; import { getJsonWalletAddress } from "@ethersproject/json-wallets";
@ -26,4 +26,4 @@ import { Mnemonic } from "@ethersproject/hdnode";
import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets"; import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets";
import { Utf8ErrorFunc } from "@ethersproject/strings"; import { Utf8ErrorFunc } from "@ethersproject/strings";
import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web"; import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web";
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback }; export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };

View File

@ -2,7 +2,7 @@
import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi"; import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi";
import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address"; import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address";
import * as base64 from "@ethersproject/base64"; import * as base64 from "@ethersproject/base64";
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes"; import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes";
import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash"; import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash";
import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode"; import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode";
import { getJsonWalletAddress } from "@ethersproject/json-wallets"; import { getJsonWalletAddress } from "@ethersproject/json-wallets";
@ -25,7 +25,7 @@ import { SupportedAlgorithm } from "@ethersproject/sha2";
import { UnicodeNormalizationForm, Utf8ErrorReason } from "@ethersproject/strings"; import { UnicodeNormalizationForm, Utf8ErrorReason } from "@ethersproject/strings";
//////////////////////// ////////////////////////
// Exports // Exports
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed,
//////////////////////// ////////////////////////
// Enums // Enums
SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Indexed }; SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Indexed };

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.170"; export declare const version = "ethers/5.0.0-beta.171";

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.170"; exports.version = "ethers/5.0.0-beta.171";

View File

@ -1,7 +1,7 @@
import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi"; import { AbiCoder, defaultAbiCoder, EventFragment, FormatTypes, Fragment, FunctionFragment, Indexed, Interface, ParamType } from "@ethersproject/abi";
import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address"; import { getAddress, getCreate2Address, getContractAddress, getIcapAddress, isAddress } from "@ethersproject/address";
import * as base64 from "@ethersproject/base64"; import * as base64 from "@ethersproject/base64";
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes"; import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexValue, hexZeroPad, isBytes, isBytesLike, isHexString, joinSignature, zeroPad, splitSignature, stripZeros } from "@ethersproject/bytes";
import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash"; import { hashMessage, id, isValidName, namehash } from "@ethersproject/hash";
import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode"; import { defaultPath, entropyToMnemonic, HDNode, isValidMnemonic, mnemonicToEntropy, mnemonicToSeed } from "@ethersproject/hdnode";
import { getJsonWalletAddress } from "@ethersproject/json-wallets"; import { getJsonWalletAddress } from "@ethersproject/json-wallets";
@ -26,4 +26,4 @@ import { Mnemonic } from "@ethersproject/hdnode";
import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets"; import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets";
import { Utf8ErrorFunc } from "@ethersproject/strings"; import { Utf8ErrorFunc } from "@ethersproject/strings";
import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web"; import { ConnectionInfo, FetchJsonResponse, OnceBlockable, PollOptions } from "@ethersproject/web";
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback }; export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, Logger, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, getStatic, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, isBytes, isBytesLike, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, nameprep, _toEscapedUtf8String, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, formatBytes32String, parseBytes32String, hashMessage, namehash, isValidName, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithm, UnicodeNormalizationForm, Utf8ErrorReason, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, Mnemonic, Utf8ErrorFunc, ConnectionInfo, OnceBlockable, PollOptions, FetchJsonResponse, EncryptOptions, ProgressCallback };

View File

@ -34,6 +34,8 @@ exports.hexlify = bytes_1.hexlify;
exports.hexStripZeros = bytes_1.hexStripZeros; exports.hexStripZeros = bytes_1.hexStripZeros;
exports.hexValue = bytes_1.hexValue; exports.hexValue = bytes_1.hexValue;
exports.hexZeroPad = bytes_1.hexZeroPad; exports.hexZeroPad = bytes_1.hexZeroPad;
exports.isBytes = bytes_1.isBytes;
exports.isBytesLike = bytes_1.isBytesLike;
exports.isHexString = bytes_1.isHexString; exports.isHexString = bytes_1.isHexString;
exports.joinSignature = bytes_1.joinSignature; exports.joinSignature = bytes_1.joinSignature;
exports.zeroPad = bytes_1.zeroPad; exports.zeroPad = bytes_1.zeroPad;

View File

@ -52,7 +52,7 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"tarballHash": "0xda5868f4939f7d6b03cd8f0fc273209321e1e0885054a9c3b1eba25fe1757e85", "tarballHash": "0xc0383754c70bbdd3130d16e98a5a4b49a50a3d3194c36f65cd7e88dfd51365c3",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.0.0-beta.170" "version": "5.0.0-beta.171"
} }

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.170"; export const version = "ethers/5.0.0-beta.171";

View File

@ -1 +1 @@
export declare const version = "networks/5.0.0-beta.134"; export declare const version = "networks/5.0.0-beta.135";

View File

@ -1 +1 @@
export const version = "networks/5.0.0-beta.134"; export const version = "networks/5.0.0-beta.135";

View File

@ -41,8 +41,13 @@ function ethDefaultProvider(network) {
quorum = options.quorum; quorum = options.quorum;
} }
else if (quorum > 2) { else if (quorum > 2) {
if (network === "homestead") {
quorum = 2; quorum = 2;
} }
else {
quorum = 1;
}
}
return new providers.FallbackProvider(providerList, quorum); return new providers.FallbackProvider(providerList, quorum);
} }
return providerList[0]; return providerList[0];
@ -58,13 +63,13 @@ function etcDefaultProvider(url, network) {
} }
const homestead = { const homestead = {
chainId: 1, chainId: 1,
ensAddress: "0x314159265dd8dbb310642f98f50c066173c1259b", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "homestead", name: "homestead",
_defaultProvider: ethDefaultProvider("homestead") _defaultProvider: ethDefaultProvider("homestead")
}; };
const ropsten = { const ropsten = {
chainId: 3, chainId: 3,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "ropsten", name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten") _defaultProvider: ethDefaultProvider("ropsten")
}; };
@ -88,7 +93,7 @@ const networks = {
testnet: ropsten, testnet: ropsten,
rinkeby: { rinkeby: {
chainId: 4, chainId: 4,
ensAddress: "0xe7410170f87102DF0055eB195163A03B7F2Bff4A", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "rinkeby", name: "rinkeby",
_defaultProvider: ethDefaultProvider("rinkeby") _defaultProvider: ethDefaultProvider("rinkeby")
}, },
@ -99,7 +104,7 @@ const networks = {
}, },
goerli: { goerli: {
chainId: 5, chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "goerli", name: "goerli",
_defaultProvider: ethDefaultProvider("goerli") _defaultProvider: ethDefaultProvider("goerli")
}, },

View File

@ -1 +1 @@
export declare const version = "networks/5.0.0-beta.134"; export declare const version = "networks/5.0.0-beta.135";

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "networks/5.0.0-beta.134"; exports.version = "networks/5.0.0-beta.135";

View File

@ -42,8 +42,13 @@ function ethDefaultProvider(network) {
quorum = options.quorum; quorum = options.quorum;
} }
else if (quorum > 2) { else if (quorum > 2) {
if (network === "homestead") {
quorum = 2; quorum = 2;
} }
else {
quorum = 1;
}
}
return new providers.FallbackProvider(providerList, quorum); return new providers.FallbackProvider(providerList, quorum);
} }
return providerList[0]; return providerList[0];
@ -59,13 +64,13 @@ function etcDefaultProvider(url, network) {
} }
var homestead = { var homestead = {
chainId: 1, chainId: 1,
ensAddress: "0x314159265dd8dbb310642f98f50c066173c1259b", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "homestead", name: "homestead",
_defaultProvider: ethDefaultProvider("homestead") _defaultProvider: ethDefaultProvider("homestead")
}; };
var ropsten = { var ropsten = {
chainId: 3, chainId: 3,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "ropsten", name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten") _defaultProvider: ethDefaultProvider("ropsten")
}; };
@ -89,7 +94,7 @@ var networks = {
testnet: ropsten, testnet: ropsten,
rinkeby: { rinkeby: {
chainId: 4, chainId: 4,
ensAddress: "0xe7410170f87102DF0055eB195163A03B7F2Bff4A", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "rinkeby", name: "rinkeby",
_defaultProvider: ethDefaultProvider("rinkeby") _defaultProvider: ethDefaultProvider("rinkeby")
}, },
@ -100,7 +105,7 @@ var networks = {
}, },
goerli: { goerli: {
chainId: 5, chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010", ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
name: "goerli", name: "goerli",
_defaultProvider: ethDefaultProvider("goerli") _defaultProvider: ethDefaultProvider("goerli")
}, },

View File

@ -23,7 +23,7 @@
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"tarballHash": "0x909090e2916921154ccd5fa346872e290e6af7af03e141127edac0a7bdcf0a18", "tarballHash": "0xa9e016289333d17590090a4da1468c8d91d94b6b0f8c6cb6060c02ef2ca90712",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.0.0-beta.134" "version": "5.0.0-beta.135"
} }

View File

@ -1 +1 @@
export const version = "networks/5.0.0-beta.134"; export const version = "networks/5.0.0-beta.135";

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.149"; export declare const version = "tests/5.0.0-beta.150";

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.149"; export const version = "tests/5.0.0-beta.150";

View File

@ -18,7 +18,11 @@ const blockchainData = {
storage: { storage: {
"0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300" "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
} }
} },
{
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
name: "ricmoo.firefly.eth"
},
], ],
blocks: [ blocks: [
{ {
@ -449,6 +453,14 @@ function testProvider(providerName, networkName) {
}); });
}); });
} }
if (test.name) {
it(`fetches the ENS name: ${test.name}`, function () {
this.timeout(20000);
return provider.resolveName(test.name).then((address) => {
equals("ENS Name", test.address, address);
});
});
}
}); });
tests.blocks.forEach((test) => { tests.blocks.forEach((test) => {
function checkBlock(promise) { function checkBlock(promise) {

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.149"; export declare const version = "tests/5.0.0-beta.150";

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "tests/5.0.0-beta.149"; exports.version = "tests/5.0.0-beta.150";

View File

@ -22,7 +22,11 @@ var blockchainData = {
storage: { storage: {
"0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300" "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300"
} }
} },
{
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
name: "ricmoo.firefly.eth"
},
], ],
blocks: [ blocks: [
{ {
@ -453,6 +457,14 @@ function testProvider(providerName, networkName) {
}); });
}); });
} }
if (test.name) {
it("fetches the ENS name: " + test.name, function () {
this.timeout(20000);
return provider.resolveName(test.name).then(function (address) {
equals("ENS Name", test.address, address);
});
});
}
}); });
tests.blocks.forEach(function (test) { tests.blocks.forEach(function (test) {
function checkBlock(promise) { function checkBlock(promise) {

View File

@ -33,7 +33,7 @@
"scripts": { "scripts": {
"test": "exit 1" "test": "exit 1"
}, },
"tarballHash": "0xecdd7eb420e52aa96c3cb6ab178604594112f3506952a6a5d2a848542753eb3b", "tarballHash": "0x6934f6ce2dcc6360227954303709404ba6d758881c139eeac5cad3b33efc1b36",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.0.0-beta.149" "version": "5.0.0-beta.150"
} }

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.149"; export const version = "tests/5.0.0-beta.150";