truffle
Version:
Truffle - Simple development framework for Ethereum
1,723 lines (1,448 loc) • 757 kB
JavaScript
#!/usr/bin/env node
exports.id = 439;
exports.ids = [439];
exports.modules = {
/***/ 42817:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const axiosRetry = (__webpack_require__(59164)/* ["default"] */ .ZP);
module.exports = axiosRetry;
module.exports["default"] = axiosRetry;
/***/ }),
/***/ 1691:
/***/ ((module) => {
"use strict";
const denyList = new Set([
'ENOTFOUND',
'ENETUNREACH',
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
'UNABLE_TO_GET_ISSUER_CERT',
'UNABLE_TO_GET_CRL',
'UNABLE_TO_DECRYPT_CERT_SIGNATURE',
'UNABLE_TO_DECRYPT_CRL_SIGNATURE',
'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',
'CERT_SIGNATURE_FAILURE',
'CRL_SIGNATURE_FAILURE',
'CERT_NOT_YET_VALID',
'CERT_HAS_EXPIRED',
'CRL_NOT_YET_VALID',
'CRL_HAS_EXPIRED',
'ERROR_IN_CERT_NOT_BEFORE_FIELD',
'ERROR_IN_CERT_NOT_AFTER_FIELD',
'ERROR_IN_CRL_LAST_UPDATE_FIELD',
'ERROR_IN_CRL_NEXT_UPDATE_FIELD',
'OUT_OF_MEM',
'DEPTH_ZERO_SELF_SIGNED_CERT',
'SELF_SIGNED_CERT_IN_CHAIN',
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
'CERT_CHAIN_TOO_LONG',
'CERT_REVOKED',
'INVALID_CA',
'PATH_LENGTH_EXCEEDED',
'INVALID_PURPOSE',
'CERT_UNTRUSTED',
'CERT_REJECTED',
'HOSTNAME_MISMATCH'
]);
// TODO: Use `error?.code` when targeting Node.js 14
module.exports = error => !denyList.has(error && error.code);
/***/ }),
/***/ 2517:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
/*
The MIT License (MIT)
Original Library
- Copyright (c) Marak Squires
Additional functionality
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var colors = {};
module['exports'] = colors;
colors.themes = {};
var util = __webpack_require__(73837);
var ansiStyles = colors.styles = __webpack_require__(35784);
var defineProps = Object.defineProperties;
var newLineRegex = new RegExp(/[\r\n]+/g);
colors.supportsColor = (__webpack_require__(56561).supportsColor);
if (typeof colors.enabled === 'undefined') {
colors.enabled = colors.supportsColor() !== false;
}
colors.enable = function() {
colors.enabled = true;
};
colors.disable = function() {
colors.enabled = false;
};
colors.stripColors = colors.strip = function(str) {
return ('' + str).replace(/\x1B\[\d+m/g, '');
};
// eslint-disable-next-line no-unused-vars
var stylize = colors.stylize = function stylize(str, style) {
if (!colors.enabled) {
return str+'';
}
var styleMap = ansiStyles[style];
// Stylize should work for non-ANSI styles, too
if(!styleMap && style in colors){
// Style maps like trap operate as functions on strings;
// they don't have properties like open or close.
return colors[style](str);
}
return styleMap.open + str + styleMap.close;
};
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
var escapeStringRegexp = function(str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
return str.replace(matchOperatorsRe, '\\$&');
};
function build(_styles) {
var builder = function builder() {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
// __proto__ is used because we must return a function, but there is
// no way to create a function with a different prototype.
builder.__proto__ = proto;
return builder;
}
var styles = (function() {
var ret = {};
ansiStyles.grey = ansiStyles.gray;
Object.keys(ansiStyles).forEach(function(key) {
ansiStyles[key].closeRe =
new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
ret[key] = {
get: function() {
return build(this._styles.concat(key));
},
};
});
return ret;
})();
var proto = defineProps(function colors() {}, styles);
function applyStyle() {
var args = Array.prototype.slice.call(arguments);
var str = args.map(function(arg) {
// Use weak equality check so we can colorize null/undefined in safe mode
if (arg != null && arg.constructor === String) {
return arg;
} else {
return util.inspect(arg);
}
}).join(' ');
if (!colors.enabled || !str) {
return str;
}
var newLinesPresent = str.indexOf('\n') != -1;
var nestedStyles = this._styles;
var i = nestedStyles.length;
while (i--) {
var code = ansiStyles[nestedStyles[i]];
str = code.open + str.replace(code.closeRe, code.open) + code.close;
if (newLinesPresent) {
str = str.replace(newLineRegex, function(match) {
return code.close + match + code.open;
});
}
}
return str;
}
colors.setTheme = function(theme) {
if (typeof theme === 'string') {
console.log('colors.setTheme now only accepts an object, not a string. ' +
'If you are trying to set a theme from a file, it is now your (the ' +
'caller\'s) responsibility to require the file. The old syntax ' +
'looked like colors.setTheme(__dirname + ' +
'\'/../themes/generic-logging.js\'); The new syntax looks like '+
'colors.setTheme(require(__dirname + ' +
'\'/../themes/generic-logging.js\'));');
return;
}
for (var style in theme) {
(function(style) {
colors[style] = function(str) {
if (typeof theme[style] === 'object') {
var out = str;
for (var i in theme[style]) {
out = colors[theme[style][i]](out);
}
return out;
}
return colors[theme[style]](str);
};
})(style);
}
};
function init() {
var ret = {};
Object.keys(styles).forEach(function(name) {
ret[name] = {
get: function() {
return build([name]);
},
};
});
return ret;
}
var sequencer = function sequencer(map, str) {
var exploded = str.split('');
exploded = exploded.map(map);
return exploded.join('');
};
// custom formatter methods
colors.trap = __webpack_require__(55117);
colors.zalgo = __webpack_require__(71492);
// maps
colors.maps = {};
colors.maps.america = __webpack_require__(26260)(colors);
colors.maps.zebra = __webpack_require__(43270)(colors);
colors.maps.rainbow = __webpack_require__(35920)(colors);
colors.maps.random = __webpack_require__(62449)(colors);
for (var map in colors.maps) {
(function(map) {
colors[map] = function(str) {
return sequencer(colors.maps[map], str);
};
})(map);
}
defineProps(colors, init());
/***/ }),
/***/ 55117:
/***/ ((module) => {
module['exports'] = function runTheTrap(text, options) {
var result = '';
text = text || 'Run the trap, drop the bass';
text = text.split('');
var trap = {
a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
c: ['\u00a9', '\u023b', '\u03fe'],
d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
'\u0a6c'],
f: ['\u04fa'],
g: ['\u0262'],
h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
i: ['\u0f0f'],
j: ['\u0134'],
k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
l: ['\u0139'],
m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
'\u06dd', '\u0e4f'],
p: ['\u01f7', '\u048e'],
q: ['\u09cd'],
r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
t: ['\u0141', '\u0166', '\u0373'],
u: ['\u01b1', '\u054d'],
v: ['\u05d8'],
w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
y: ['\u00a5', '\u04b0', '\u04cb'],
z: ['\u01b5', '\u0240'],
};
text.forEach(function(c) {
c = c.toLowerCase();
var chars = trap[c] || [' '];
var rand = Math.floor(Math.random() * chars.length);
if (typeof trap[c] !== 'undefined') {
result += trap[c][rand];
} else {
result += c;
}
});
return result;
};
/***/ }),
/***/ 71492:
/***/ ((module) => {
// please no
module['exports'] = function zalgo(text, options) {
text = text || ' he is here ';
var soul = {
'up': [
'̍', '̎', '̄', '̅',
'̿', '̑', '̆', '̐',
'͒', '͗', '͑', '̇',
'̈', '̊', '͂', '̓',
'̈', '͊', '͋', '͌',
'̃', '̂', '̌', '͐',
'̀', '́', '̋', '̏',
'̒', '̓', '̔', '̽',
'̉', 'ͣ', 'ͤ', 'ͥ',
'ͦ', 'ͧ', 'ͨ', 'ͩ',
'ͪ', 'ͫ', 'ͬ', 'ͭ',
'ͮ', 'ͯ', '̾', '͛',
'͆', '̚',
],
'down': [
'̖', '̗', '̘', '̙',
'̜', '̝', '̞', '̟',
'̠', '̤', '̥', '̦',
'̩', '̪', '̫', '̬',
'̭', '̮', '̯', '̰',
'̱', '̲', '̳', '̹',
'̺', '̻', '̼', 'ͅ',
'͇', '͈', '͉', '͍',
'͎', '͓', '͔', '͕',
'͖', '͙', '͚', '̣',
],
'mid': [
'̕', '̛', '̀', '́',
'͘', '̡', '̢', '̧',
'̨', '̴', '̵', '̶',
'͜', '͝', '͞',
'͟', '͠', '͢', '̸',
'̷', '͡', ' ҉',
],
};
var all = [].concat(soul.up, soul.down, soul.mid);
function randomNumber(range) {
var r = Math.floor(Math.random() * range);
return r;
}
function isChar(character) {
var bool = false;
all.filter(function(i) {
bool = (i === character);
});
return bool;
}
function heComes(text, options) {
var result = '';
var counts;
var l;
options = options || {};
options['up'] =
typeof options['up'] !== 'undefined' ? options['up'] : true;
options['mid'] =
typeof options['mid'] !== 'undefined' ? options['mid'] : true;
options['down'] =
typeof options['down'] !== 'undefined' ? options['down'] : true;
options['size'] =
typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
text = text.split('');
for (l in text) {
if (isChar(l)) {
continue;
}
result = result + text[l];
counts = {'up': 0, 'down': 0, 'mid': 0};
switch (options.size) {
case 'mini':
counts.up = randomNumber(8);
counts.mid = randomNumber(2);
counts.down = randomNumber(8);
break;
case 'maxi':
counts.up = randomNumber(16) + 3;
counts.mid = randomNumber(4) + 1;
counts.down = randomNumber(64) + 3;
break;
default:
counts.up = randomNumber(8) + 1;
counts.mid = randomNumber(6) / 2;
counts.down = randomNumber(8) + 1;
break;
}
var arr = ['up', 'mid', 'down'];
for (var d in arr) {
var index = arr[d];
for (var i = 0; i <= counts[index]; i++) {
if (options[index]) {
result = result + soul[index][randomNumber(soul[index].length)];
}
}
}
}
return result;
}
// don't summon him
return heComes(text, options);
};
/***/ }),
/***/ 99883:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var colors = __webpack_require__(2517);
module['exports'] = function() {
//
// Extends prototype of native string object to allow for "foo".red syntax
//
var addProperty = function(color, func) {
String.prototype.__defineGetter__(color, func);
};
addProperty('strip', function() {
return colors.strip(this);
});
addProperty('stripColors', function() {
return colors.strip(this);
});
addProperty('trap', function() {
return colors.trap(this);
});
addProperty('zalgo', function() {
return colors.zalgo(this);
});
addProperty('zebra', function() {
return colors.zebra(this);
});
addProperty('rainbow', function() {
return colors.rainbow(this);
});
addProperty('random', function() {
return colors.random(this);
});
addProperty('america', function() {
return colors.america(this);
});
//
// Iterate through all default styles and colors
//
var x = Object.keys(colors.styles);
x.forEach(function(style) {
addProperty(style, function() {
return colors.stylize(this, style);
});
});
function applyTheme(theme) {
//
// Remark: This is a list of methods that exist
// on String that you should not overwrite.
//
var stringPrototypeBlacklist = [
'__defineGetter__', '__defineSetter__', '__lookupGetter__',
'__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty',
'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString',
'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length',
'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice',
'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase',
'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight',
];
Object.keys(theme).forEach(function(prop) {
if (stringPrototypeBlacklist.indexOf(prop) !== -1) {
console.log('warn: '.red + ('String.prototype' + prop).magenta +
' is probably something you don\'t want to override. ' +
'Ignoring style name');
} else {
if (typeof(theme[prop]) === 'string') {
colors[prop] = colors[theme[prop]];
addProperty(prop, function() {
return colors[prop](this);
});
} else {
var themePropApplicator = function(str) {
var ret = str || this;
for (var t = 0; t < theme[prop].length; t++) {
ret = colors[theme[prop][t]](ret);
}
return ret;
};
addProperty(prop, themePropApplicator);
colors[prop] = function(str) {
return themePropApplicator(str);
};
}
}
});
}
colors.setTheme = function(theme) {
if (typeof theme === 'string') {
console.log('colors.setTheme now only accepts an object, not a string. ' +
'If you are trying to set a theme from a file, it is now your (the ' +
'caller\'s) responsibility to require the file. The old syntax ' +
'looked like colors.setTheme(__dirname + ' +
'\'/../themes/generic-logging.js\'); The new syntax looks like '+
'colors.setTheme(require(__dirname + ' +
'\'/../themes/generic-logging.js\'));');
return;
} else {
applyTheme(theme);
}
};
};
/***/ }),
/***/ 83196:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var colors = __webpack_require__(2517);
module['exports'] = colors;
// Remark: By default, colors will add style properties to String.prototype.
//
// If you don't wish to extend String.prototype, you can do this instead and
// native String will not be touched:
//
// var colors = require('colors/safe);
// colors.red("foo")
//
//
__webpack_require__(99883)();
/***/ }),
/***/ 26260:
/***/ ((module) => {
module['exports'] = function(colors) {
return function(letter, i, exploded) {
if (letter === ' ') return letter;
switch (i%3) {
case 0: return colors.red(letter);
case 1: return colors.white(letter);
case 2: return colors.blue(letter);
}
};
};
/***/ }),
/***/ 35920:
/***/ ((module) => {
module['exports'] = function(colors) {
// RoY G BiV
var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
return function(letter, i, exploded) {
if (letter === ' ') {
return letter;
} else {
return colors[rainbowColors[i++ % rainbowColors.length]](letter);
}
};
};
/***/ }),
/***/ 62449:
/***/ ((module) => {
module['exports'] = function(colors) {
var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
return function(letter, i, exploded) {
return letter === ' ' ? letter :
colors[
available[Math.round(Math.random() * (available.length - 2))]
](letter);
};
};
/***/ }),
/***/ 43270:
/***/ ((module) => {
module['exports'] = function(colors) {
return function(letter, i, exploded) {
return i % 2 === 0 ? letter : colors.inverse(letter);
};
};
/***/ }),
/***/ 35784:
/***/ ((module) => {
/*
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var styles = {};
module['exports'] = styles;
var codes = {
reset: [0, 0],
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29],
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
gray: [90, 39],
grey: [90, 39],
brightRed: [91, 39],
brightGreen: [92, 39],
brightYellow: [93, 39],
brightBlue: [94, 39],
brightMagenta: [95, 39],
brightCyan: [96, 39],
brightWhite: [97, 39],
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
bgGray: [100, 49],
bgGrey: [100, 49],
bgBrightRed: [101, 49],
bgBrightGreen: [102, 49],
bgBrightYellow: [103, 49],
bgBrightBlue: [104, 49],
bgBrightMagenta: [105, 49],
bgBrightCyan: [106, 49],
bgBrightWhite: [107, 49],
// legacy styles for colors pre v1.0.0
blackBG: [40, 49],
redBG: [41, 49],
greenBG: [42, 49],
yellowBG: [43, 49],
blueBG: [44, 49],
magentaBG: [45, 49],
cyanBG: [46, 49],
whiteBG: [47, 49],
};
Object.keys(codes).forEach(function(key) {
var val = codes[key];
var style = styles[key] = [];
style.open = '\u001b[' + val[0] + 'm';
style.close = '\u001b[' + val[1] + 'm';
});
/***/ }),
/***/ 64340:
/***/ ((module) => {
"use strict";
/*
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
module.exports = function(flag, argv) {
argv = argv || process.argv;
var terminatorPos = argv.indexOf('--');
var prefix = /^-{1,2}/.test(flag) ? '' : '--';
var pos = argv.indexOf(prefix + flag);
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
};
/***/ }),
/***/ 56561:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/*
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var os = __webpack_require__(22037);
var hasFlag = __webpack_require__(64340);
var env = process.env;
var forceColor = void 0;
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
forceColor = false;
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
|| hasFlag('color=always')) {
forceColor = true;
}
if ('FORCE_COLOR' in env) {
forceColor = env.FORCE_COLOR.length === 0
|| parseInt(env.FORCE_COLOR, 10) !== 0;
}
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level: level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3,
};
}
function supportsColor(stream) {
if (forceColor === false) {
return 0;
}
if (hasFlag('color=16m') || hasFlag('color=full')
|| hasFlag('color=truecolor')) {
return 3;
}
if (hasFlag('color=256')) {
return 2;
}
if (stream && !stream.isTTY && forceColor !== true) {
return 0;
}
var min = forceColor ? 1 : 0;
if (process.platform === 'win32') {
// Node.js 7.5.0 is the first version of Node.js to include a patch to
// libuv that enables 256 color output on Windows. Anything earlier and it
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
// release, and Node.js 7 is not. Windows 10 build 10586 is the first
// Windows release that supports 256 colors. Windows 10 build 14931 is the
// first release that supports 16m/TrueColor.
var osRelease = os.release().split('.');
if (Number(process.versions.node.split('.')[0]) >= 8
&& Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
return Number(osRelease[2]) >= 14931 ? 3 : 2;
}
return 1;
}
if ('CI' in env) {
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
return sign in env;
}) || env.CI_NAME === 'codeship') {
return 1;
}
return min;
}
if ('TEAMCITY_VERSION' in env) {
return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
);
}
if ('TERM_PROGRAM' in env) {
var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
return version >= 3 ? 3 : 2;
case 'Hyper':
return 3;
case 'Apple_Terminal':
return 2;
// No default
}
}
if (/-256(color)?$/i.test(env.TERM)) {
return 2;
}
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
return 1;
}
if ('COLORTERM' in env) {
return 1;
}
if (env.TERM === 'dumb') {
return min;
}
return min;
}
function getSupportLevel(stream) {
var level = supportsColor(stream);
return translateLevel(level);
}
module.exports = {
supportsColor: getSupportLevel,
stdout: getSupportLevel(process.stdout),
stderr: getSupportLevel(process.stderr),
};
/***/ }),
/***/ 44174:
/***/ ((module) => {
/**
* A specialized version of `baseAggregator` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function arrayAggregator(array, setter, iteratee, accumulator) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
var value = array[index];
setter(accumulator, value, iteratee(value), array);
}
return accumulator;
}
module.exports = arrayAggregator;
/***/ }),
/***/ 81119:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var baseEach = __webpack_require__(89881);
/**
* Aggregates elements of `collection` on `accumulator` with keys transformed
* by `iteratee` and values set by `setter`.
*
* @private
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} setter The function to set `accumulator` values.
* @param {Function} iteratee The iteratee to transform keys.
* @param {Object} accumulator The initial aggregated object.
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
}
module.exports = baseAggregator;
/***/ }),
/***/ 55189:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var arrayAggregator = __webpack_require__(44174),
baseAggregator = __webpack_require__(81119),
baseIteratee = __webpack_require__(67206),
isArray = __webpack_require__(1469);
/**
* Creates a function like `_.groupBy`.
*
* @private
* @param {Function} setter The function to set accumulator values.
* @param {Function} [initializer] The accumulator object initializer.
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
return func(collection, setter, baseIteratee(iteratee, 2), accumulator);
};
}
module.exports = createAggregator;
/***/ }),
/***/ 50361:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var baseClone = __webpack_require__(85990);
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;
/***/ }),
/***/ 43174:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var createAggregator = __webpack_require__(55189);
/**
* Creates an array of elements split into two groups, the first of which
* contains elements `predicate` returns truthy for, the second of which
* contains elements `predicate` returns falsey for. The predicate is
* invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 3.0.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @returns {Array} Returns the array of grouped elements.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36, 'active': false },
* { 'user': 'fred', 'age': 40, 'active': true },
* { 'user': 'pebbles', 'age': 1, 'active': false }
* ];
*
* _.partition(users, function(o) { return o.active; });
* // => objects for [['fred'], ['barney', 'pebbles']]
*
* // The `_.matches` iteratee shorthand.
* _.partition(users, { 'age': 1, 'active': false });
* // => objects for [['pebbles'], ['barney', 'fred']]
*
* // The `_.matchesProperty` iteratee shorthand.
* _.partition(users, ['active', false]);
* // => objects for [['barney', 'pebbles'], ['fred']]
*
* // The `_.property` iteratee shorthand.
* _.partition(users, 'active');
* // => objects for [['fred'], ['barney', 'pebbles']]
*/
var partition = createAggregator(function(result, value, key) {
result[key ? 0 : 1].push(value);
}, function() { return [[], []]; });
module.exports = partition;
/***/ }),
/***/ 26015:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var STREAM = __webpack_require__(12781),
UTIL = __webpack_require__(73837),
StringDecoder = (__webpack_require__(71576).StringDecoder);
function MemoryReadableStream(data, options) {
if (!(this instanceof MemoryReadableStream))
return new MemoryReadableStream(data, options);
MemoryReadableStream.super_.call(this, options);
this.init(data, options);
}
UTIL.inherits(MemoryReadableStream, STREAM.Readable);
function MemoryWritableStream(data, options) {
if (!(this instanceof MemoryWritableStream))
return new MemoryWritableStream(data, options);
MemoryWritableStream.super_.call(this, options);
this.init(data, options);
}
UTIL.inherits(MemoryWritableStream, STREAM.Writable);
function MemoryDuplexStream(data, options) {
if (!(this instanceof MemoryDuplexStream))
return new MemoryDuplexStream(data, options);
MemoryDuplexStream.super_.call(this, options);
this.init(data, options);
}
UTIL.inherits(MemoryDuplexStream, STREAM.Duplex);
MemoryReadableStream.prototype.init =
MemoryWritableStream.prototype.init =
MemoryDuplexStream.prototype.init = function init (data, options) {
var self = this;
this.queue = [];
if (data) {
if (!Array.isArray(data)) {
data = [ data ];
}
data.forEach(function (chunk) {
if (!(chunk instanceof Buffer)) {
chunk = new Buffer(chunk);
}
self.queue.push(chunk);
});
}
options = options || {};
this.maxbufsize = options.hasOwnProperty('maxbufsize') ? options.maxbufsize
: null;
this.bufoverflow = options.hasOwnProperty('bufoverflow') ? options.bufoverflow
: null;
this.frequence = options.hasOwnProperty('frequence') ? options.frequence
: null;
};
function MemoryStream (data, options) {
if (!(this instanceof MemoryStream))
return new MemoryStream(data, options);
options = options || {};
var readable = options.hasOwnProperty('readable') ? options.readable : true,
writable = options.hasOwnProperty('writable') ? options.writable : true;
if (readable && writable) {
return new MemoryDuplexStream(data, options);
} else if (readable) {
return new MemoryReadableStream(data, options);
} else if (writable) {
return new MemoryWritableStream(data, options);
} else {
throw new Error("Unknown stream type Readable, Writable or Duplex ");
}
}
MemoryStream.createReadStream = function (data, options) {
options = options || {};
options.readable = true;
options.writable = false;
return new MemoryStream(data, options);
};
MemoryStream.createWriteStream = function (data, options) {
options = options || {};
options.readable = false;
options.writable = true;
return new MemoryStream(data, options);
};
MemoryReadableStream.prototype._read =
MemoryDuplexStream.prototype._read = function _read (n) {
var self = this,
frequence = self.frequence || 0,
wait_data = this instanceof STREAM.Duplex && ! this._writableState.finished ? true : false;
if ( ! this.queue.length && ! wait_data) {
this.push(null);// finish stream
} else if (this.queue.length) {
setTimeout(function () {
if (self.queue.length) {
var chunk = self.queue.shift();
if (chunk && ! self._readableState.ended) {
if ( ! self.push(chunk) ) {
self.queue.unshift(chunk);
}
}
}
}, frequence);
}
};
MemoryWritableStream.prototype._write =
MemoryDuplexStream.prototype._write = function _write (chunk, encoding, cb) {
var decoder = null;
try {
decoder = this.decodeStrings && encoding ? new StringDecoder(encoding) : null;
} catch (err){
return cb(err);
}
var decoded_chunk = decoder ? decoder.write(chunk) : chunk,
queue_size = this._getQueueSize(),
chunk_size = decoded_chunk.length;
if (this.maxbufsize && (queue_size + chunk_size) > this.maxbufsize ) {
if (this.bufoverflow) {
return cb("Buffer overflowed (" + this.bufoverflow + "/" + queue_size + ")");
} else {
return cb();
}
}
if (this instanceof STREAM.Duplex) {
while (this.queue.length) {
this.push(this.queue.shift());
}
this.push(decoded_chunk);
} else {
this.queue.push(decoded_chunk);
}
cb();
};
MemoryDuplexStream.prototype.end = function (chunk, encoding, cb) {
var self = this;
return MemoryDuplexStream.super_.prototype.end.call(this, chunk, encoding, function () {
self.push(null);//finish readble stream too
if (cb) cb();
});
};
MemoryReadableStream.prototype._getQueueSize =
MemoryWritableStream.prototype._getQueueSize =
MemoryDuplexStream.prototype._getQueueSize = function () {
var queuesize = 0, i;
for (i = 0; i < this.queue.length; i++) {
queuesize += Array.isArray(this.queue[i]) ? this.queue[i][0].length
: this.queue[i].length;
}
return queuesize;
};
MemoryWritableStream.prototype.toString =
MemoryDuplexStream.prototype.toString =
MemoryReadableStream.prototype.toString =
MemoryWritableStream.prototype.getAll =
MemoryDuplexStream.prototype.getAll =
MemoryReadableStream.prototype.getAll = function () {
var self = this,
ret = '';
this.queue.forEach(function (data) {
ret += data;
});
return ret;
};
MemoryWritableStream.prototype.toBuffer =
MemoryDuplexStream.prototype.toBuffer =
MemoryReadableStream.prototype.toBuffer = function () {
var buffer = new Buffer(this._getQueueSize()),
currentOffset = 0;
this.queue.forEach(function (data) {
var data_buffer = data instanceof Buffer ? data : new Buffer(data);
data_buffer.copy(buffer, currentOffset);
currentOffset += data.length;
});
return buffer;
};
module.exports = MemoryStream;
/***/ }),
/***/ 46029:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
/* module decorator */ module = __webpack_require__.nmd(module);
var Module = __webpack_require__(98188);
var path = __webpack_require__(71017);
module.exports = function requireFromString(code, filename, opts) {
if (typeof filename === 'object') {
opts = filename;
filename = undefined;
}
opts = opts || {};
filename = filename || '';
opts.appendPaths = opts.appendPaths || [];
opts.prependPaths = opts.prependPaths || [];
if (typeof code !== 'string') {
throw new Error('code must be a string, not ' + typeof code);
}
var paths = Module._nodeModulePaths(path.dirname(filename));
var parent = module.parent;
var m = new Module(filename, parent);
m.filename = filename;
m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths);
m._compile(code, filename);
var exports = m.exports;
parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1);
return exports;
};
/***/ }),
/***/ 21581:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setupCompile = void 0;
const assert_1 = __importDefault(__webpack_require__(39491));
const helpers_1 = __webpack_require__(83855);
const helpers_2 = __webpack_require__(71438);
function setupCompile(solJson, core) {
return {
compileJson: bindCompileJson(solJson),
compileJsonCallback: bindCompileJsonCallback(solJson, core),
compileJsonMulti: bindCompileJsonMulti(solJson),
compileStandard: bindCompileStandard(solJson, core)
};
}
exports.setupCompile = setupCompile;
/**********************
* COMPILE
**********************/
/**
* Returns a binding to the solidity compileJSON method.
* input (text), optimize (bool) -> output (jsontext)
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindCompileJson(solJson) {
return (0, helpers_2.bindSolcMethod)(solJson, 'compileJSON', 'string', ['string', 'number'], null);
}
/**
* Returns a binding to the solidity compileJSONMulti method.
* input (jsontext), optimize (bool) -> output (jsontext)
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindCompileJsonMulti(solJson) {
return (0, helpers_2.bindSolcMethod)(solJson, 'compileJSONMulti', 'string', ['string', 'number'], null);
}
/**
* Returns a binding to the solidity compileJSONCallback method.
* input (jsontext), optimize (bool), callback (ptr) -> output (jsontext)
*
* @param solJson The Emscripten compiled Solidity object.
* @param coreBindings The core bound Solidity methods.
*/
function bindCompileJsonCallback(solJson, coreBindings) {
const compileInternal = (0, helpers_2.bindSolcMethod)(solJson, 'compileJSONCallback', 'string', ['string', 'number', 'number'], null);
if ((0, helpers_1.isNil)(compileInternal))
return null;
return function (input, optimize, readCallback) {
return runWithCallbacks(solJson, coreBindings, readCallback, compileInternal, [input, optimize]);
};
}
/**
* Returns a binding to the solidity solidity_compile method with a fallback to
* compileStandard.
* input (jsontext), callback (optional >= v6 only - ptr) -> output (jsontext)
*
* @param solJson The Emscripten compiled Solidity object.
* @param coreBindings The core bound Solidity methods.
*/
function bindCompileStandard(solJson, coreBindings) {
let boundFunctionStandard = null;
let boundFunctionSolidity = null;
// input (jsontext), callback (ptr) -> output (jsontext)
const compileInternal = (0, helpers_2.bindSolcMethod)(solJson, 'compileStandard', 'string', ['string', 'number'], null);
if (coreBindings.isVersion6OrNewer) {
// input (jsontext), callback (ptr), callback_context (ptr) -> output (jsontext)
boundFunctionSolidity = (0, helpers_2.bindSolcMethod)(solJson, 'solidity_compile', 'string', ['string', 'number', 'number'], null);
}
else {
// input (jsontext), callback (ptr) -> output (jsontext)
boundFunctionSolidity = (0, helpers_2.bindSolcMethod)(solJson, 'solidity_compile', 'string', ['string', 'number'], null);
}
if (!(0, helpers_1.isNil)(compileInternal)) {
boundFunctionStandard = function (input, readCallback) {
return runWithCallbacks(solJson, coreBindings, readCallback, compileInternal, [input]);
};
}
if (!(0, helpers_1.isNil)(boundFunctionSolidity)) {
boundFunctionStandard = function (input, callbacks) {
return runWithCallbacks(solJson, coreBindings, callbacks, boundFunctionSolidity, [input]);
};
}
return boundFunctionStandard;
}
/**********************
* CALL BACKS
**********************/
function wrapCallback(coreBindings, callback) {
(0, assert_1.default)(typeof callback === 'function', 'Invalid callback specified.');
return function (data, contents, error) {
const result = callback(coreBindings.copyFromCString(data));
if (typeof result.contents === 'string') {
coreBindings.copyToCString(result.contents, contents);
}
if (typeof result.error === 'string') {
coreBindings.copyToCString(result.error, error);
}
};
}
function wrapCallbackWithKind(coreBindings, callback) {
(0, assert_1.default)(typeof callback === 'function', 'Invalid callback specified.');
return function (context, kind, data, contents, error) {
// Must be a null pointer.
(0, assert_1.default)(context === 0, 'Callback context must be null.');
const result = callback(coreBindings.copyFromCString(kind), coreBindings.copyFromCString(data));
if (typeof result.contents === 'string') {
coreBindings.copyToCString(result.contents, contents);
}
if (typeof result.error === 'string') {
coreBindings.copyToCString(result.error, error);
}
};
}
// calls compile() with args || cb
function runWithCallbacks(solJson, coreBindings, callbacks, compile, args) {
if (callbacks) {
(0, assert_1.default)(typeof callbacks === 'object', 'Invalid callback object specified.');
}
else {
callbacks = {};
}
let readCallback = callbacks.import;
if (readCallback === undefined) {
readCallback = function (data) {
return {
error: 'File import callback not supported'
};
};
}
let singleCallback;
if (coreBindings.isVersion6OrNewer) {
// After 0.6.x multiple kind of callbacks are supported.
let smtSolverCallback = callbacks.smtSolver;
if (smtSolverCallback === undefined) {
smtSolverCallback = function (data) {
return {
error: 'SMT solver callback not supported'
};
};
}
singleCallback = function (kind, data) {
if (kind === 'source') {
return readCallback(data);
}
else if (kind === 'smt-query') {
return smtSolverCallback(data);
}
else {
(0, assert_1.default)(false, 'Invalid callback kind specified.');
}
};
singleCallback = wrapCallbackWithKind(coreBindings, singleCallback);
}
else {
// Old Solidity version only supported imports.
singleCallback = wrapCallback(coreBindings, readCallback);
}
const cb = coreBindings.addFunction(singleCallback, 'viiiii');
let output;
try {
args.push(cb);
if (coreBindings.isVersion6OrNewer) {
// Callback context.
args.push(null);
}
output = compile(...args);
}
finally {
coreBindings.removeFunction(cb);
}
if (coreBindings.reset) {
// Explicitly free memory.
//
// NOTE: cwrap() of "compile" will copy the returned pointer into a
// Javascript string and it is not possible to call free() on it.
// reset() however will clear up all allocations.
coreBindings.reset();
}
return output;
}
/***/ }),
/***/ 5931:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.setupCore = void 0;
const helpers_1 = __webpack_require__(71438);
const translate_1 = __importDefault(__webpack_require__(25897));
const semver = __importStar(__webpack_require__(89316));
const helpers_2 = __webpack_require__(83855);
function setupCore(solJson) {
const core = {
alloc: bindAlloc(solJson),
license: bindLicense(solJson),
version: bindVersion(solJson),
reset: bindReset(solJson)
};
const helpers = {
addFunction: unboundAddFunction.bind(this, solJson),
removeFunction: unboundRemoveFunction.bind(this, solJson),
copyFromCString: unboundCopyFromCString.bind(this, solJson),
copyToCString: unboundCopyToCString.bind(this, solJson, core.alloc),
// @ts-ignore
versionToSemver: versionToSemver(core.version())
};
return {
...core,
...helpers,
isVersion6OrNewer: semver.gt(helpers.versionToSemver(), '0.5.99')
};
}
exports.setupCore = setupCore;
/**********************
* Core Functions
**********************/
/**
* Returns a binding to the solidity_alloc function.
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindAlloc(solJson) {
const allocBinding = (0, helpers_1.bindSolcMethod)(solJson, 'solidity_alloc', 'number', ['number'], null);
// the fallback malloc is not a cwrap function and should just be returned
// directly in-case the alloc binding could not happen.
if ((0, helpers_2.isNil)(allocBinding)) {
return solJson._malloc;
}
return allocBinding;
}
/**
* Returns a binding to the solidity_version method.
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindVersion(solJson) {
return (0, helpers_1.bindSolcMethodWithFallbackFunc)(solJson, 'solidity_version', 'string', [], 'version');
}
function versionToSemver(version) {
return translate_1.default.versionToSemver.bind(this, version);
}
/**
* Returns a binding to the solidity_license method.
*
* If the current solJson version < 0.4.14 then this will bind an empty function.
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindLicense(solJson) {
return (0, helpers_1.bindSolcMethodWithFallbackFunc)(solJson, 'solidity_license', 'string', [], 'license', () => {
});
}
/**
* Returns a binding to the solidity_reset method.
*
* @param solJson The Emscripten compiled Solidity object.
*/
function bindReset(solJson) {
return (0, helpers_1.bindSolcMethod)(solJson, 'solidity_reset', null, [], null);
}
/**********************
* Helpers Functions
**********************/
/**
* Copy to a C string.
*
* Allocates memory using solc's allocator.
*
* Before 0.6.0:
* Assuming copyToCString is only used in the context of wrapCallback, solc will free these pointers.
* See https://github.com/ethereum/solidity/blob/v0.5.13/libsolc/libsolc.h#L37-L40
*
* After 0.6.0:
* The duty is on solc-js to free these pointers. We accomplish that by calling `reset` at the end.
*
* @param solJson The Emscripten compiled Solidity object.
* @param alloc The memory allocation function.
* @param str The source string being copied to a C string.
* @param ptr The pointer location where the C string will be set.
*/
function unboundCopyToCString(solJson, alloc, str, ptr) {
const length = solJson.lengthBytesUTF8(str);
const buffer = alloc(length + 1);
solJson.stringToUTF8(str, buffer, length + 1);
solJson.setValue(ptr, buffer, '*');
}
/**
* Wrapper over Emscripten's C String copying function (which can be different
* on different versions).
*
* @param solJson The Emscripten compiled Solidity object.
* @param ptr The pointer location where the C string will be referenced.
*/
function unboundCopyFromCStri