evm-contracts-tools 0.0.68 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evm-contract-deployment-address/evm-contract-deployment-address.js +1 -1
- package/dist/libevm-contract-deployment-address/libevm-contract-deployment-address.js +1 -1
- package/eslint.config.mjs +3 -3
- package/evm-contract-deployment-address +66 -10
- package/libevm-contract-deployment +103 -20
- package/libevm-contract-deployment-address +8 -3
- package/package.json +5 -5
- package/webpack.config.cjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var t={122(t,e,
|
|
1
|
+
(()=>{"use strict";var t={122(t,e,r){r.a(t,async(t,e)=>{try{const n=await r.e(35).then(()=>r(35)),o=n._argv_get,a=n._argv_url_get,i=n._cmdline_check,s=n._echo,c=n._echo2,d=n._exit,l=n._get,u=n._global_get,p=n._get_date_human,f=n._msg_info,m=n._msg_error,_=n._override_set,g=n._printf,h=n._set,w=await r.e(825).then(()=>r(825)),y=w._evm_contract_deployment_address,v=w._contract_version_auto_detect,b=w._deployments_dir_auto_detect,k=w._networks_all_auto_detect,E=w._target_app_auto_detect;function j(){h("app","name","evm-contract-deployments-address.js"),h("app","opts",[]),h("runtime","environment",""),h("resolve","date",""),h("target","networks",[]),h("networks","ids",[]),h("networks","all",[]),h("target","app",""),h("target","contract",""),h("contract","version",""),h("user","defined",""),h("configuration","format",""),h("deployments","dir","");const t=u();t.quiet="",t.verbose=""}async function $(t){_("resolve","date",p()),_("configuration","format","bash"),k(),_("user","defined","n"),""!=l("target","contract")&&(await E(),await b(),await v())}function S(){let t;const e=[`${l("app","name")} configuration:`,` Resolve date: ${resolve_date}`,` Runtime environment: ${runtime_environment}`,` Target networks: ${target_networks}`,` Network ID (chain ID): ${network_ids}`,` All networks: ${networks_all}`,` Target application: ${target_app}`,` User-defined address: ${user_defined}`,` Deployments path: ${deployments_dir}`];for(t of e)f(t)}function O(t){let e;const r=["","Returns an EVM network's contract deployment address","","Usage:","",` ${app_name}`," [options]"," <target-contract>",""," networks:"," All those supported"," by 'evm-chains-info'.",""," options:",""," -n, --network <network> EVM network name."," -i, --chain-id <number> EVM network id (chain ID)."," -a, --target-app <app> Application whose target"," contract is part of.",` Default: '${target_app}'`," -A, --networks-all Returns address for all"," available networks.",` Default: '${networks_all}'`," -V, --contract-version <version> Contract version.",` Default: '${contract_version}'`," -u, --user-defined Returns contract address for"," user-defined file system"," deployment instead of the system"," one.",` Default: '${user_defined}'`," -d, --deployments-dir <dir> Specify contract deployments"," directory path.",` Default: '${deployments_dir}'`," -f, --configuration-format <format> Specify contract deployments"," directory path.",` Default: '${configuration_format}'`,""," -h --help This message."," -v --verbose Enable verbose output.",""];for(e of r)s(e);d(t)}async function A(){let t,e;const r=await o({booleans:["A","networks-all","u","user-defined","h","help","v","verbose"]}),n=r._,a=u();a.quiet="y",h("runtime","environment","node"),r.h&&(t=!0),r.help&&(t=!0),(n.indexOf("--help")>-1||n.indexOf("-h")>-1)&&(t=!0),t&&(quiet="n",await $(),O(0)),(void 0===r||r._.length<1)&&(e="Target contract argument required.",m("Target contract argument required.",0),O(1)),h("target","contract",r._[0]);const i=l("target","networks");"n"in r&&i.push(r.n.toString()),"network"in r&&i.push(r.network.toString()),h("target","networks",i);const s=l("network","ids");"i"in r&&s.push(r.i.toString()),"network-id"in r&&s.push(r["network-id"].toString()),h("network","ids",s),"a"in r&&h("target","app",r.a),"target-app"in r&&h("target","app",r["target-app"]),(r.A||r["networks-all"])&&h("networks","all","y"),(r.u||r["user-defined"])&&h("user","defined","y"),"f"in r&&h("configuration","format",r.f),"configuration-format"in r&&h("configuration","format",r["configuration-format"]),(r.v||r.verbose)&&(a.quiet="n")}function P(){h("runtime","environment","browser"),h("target","networks",a("network")),h("networks","ids",a("network_id")),h("networks","all",a("networks_all")[0]),h("target","app",a("target_app")[0]),h("target","contract",a("target_contract")[0]),h("contract","version",a("contract_version")[0]),h("user","defined",a("user_defined")[0]),h("configuration","format",a("configuration_format")[0]),h("deployments","dir",a("deployments_dir")[0]);const t=u();t.quiet=a("quiet"),0===quiet.length&&(t.quiet="n")}async function T(t){let e,r,n;try{n=await y.apply(null,t)}catch(r){throw e="Error running '_evm_contract_deployment_address' with arguments:",m("Error running '_evm_contract_deployment_address' with arguments:",0),c(t),c(r),r}const o=typeof n;if("object"==o)for(r of n)s(r);else"string"==o&&g(n)}async function q(){let t,e;await $(),S();const r=[target_networks,network_ids,networks_all,target_app,target_contract,contract_version,user_defined,configuration_format,deployments_dir];try{t=await T(r)}catch(t){throw e="Error running '_evm_contract_deployment_adress_cmdline' with arguments:",m("Error running '_evm_contract_deployment_adress_cmdline' with arguments:",0),c(t),t}}j(),await i("evm-contract-deployment-address.js")||await i("evm-contract-deployment-address")?await A():P();try{q()}catch(x){const D=`Error running '${app_name}'.`;m(D,0),c(x)}e()}catch(C){e(C)}},1)}};const e={};function r(n){const o=e[n];if(void 0!==o)return o.exports;const a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.m=t,(()=>{const t=Symbol("webpack queues"),e=Symbol("webpack exports"),n=Symbol("webpack error"),o=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};r.a=(r,a,i)=>{let s;i&&((s=[]).d=-1);const c=new Set,d=r.exports;let l,u,p;const f=new Promise((t,e)=>{p=e,u=t});f[e]=d,f[t]=t=>(s&&t(s),c.forEach(t),f.catch(t=>{})),r.exports=f,a(r=>{let a;l=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[t])return r;if(r.then){const a=[];a.d=0,r.then(t=>{i[e]=t,o(a)},t=>{i[n]=t,o(a)});const i={};return i[t]=t=>t(a),i}}const a={};return a[t]=t=>{},a[e]=r,a}))(r);const i=()=>l.map(t=>{if(t[n])throw t[n];return t[e]}),d=new Promise(e=>{a=()=>e(i),a.r=0;const r=t=>t!==s&&!c.has(t)&&(c.add(t),t&&!t.d&&(a.r++,t.push(a)));l.forEach(e=>e[t](r))});return a.r?d:i()},t=>(t?p(f[n]=t):u(d),o(s))),s?.d<0&&(s.d=0)}})(),(()=>{const t=Object.getPrototypeOf;let e;r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}const a=Object.create(null);r.r(a);const i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(t=>i[t]=()=>n[t]);return i.default=()=>n,r.d(a,i),a}})(),r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var o=e[n++],a=e[n++],i=0===a?{enumerable:!0,value:e[n++]}:{enumerable:!0,get:a};r.o(t,o)||Object.defineProperty(t,o,i)}else for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.f={},r.e=t=>{const e=[];return r.f.j(t,e),Promise.all(e)},r.u=t=>t+".evm-contract-deployment-address.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{const t={},e="evm-contracts-tools:";r.l=(n,o,a,i)=>{if(t[n])return void t[n].push(o);let s,c;if(void 0!==a){const t=document.getElementsByTagName("script");for(var d=0;d<t.length;d++){const r=t[d];if(r.getAttribute("src")==n||r.getAttribute("data-webpack")==e+a){s=r;break}}}s||(c=!0,s=document.createElement("script"),s.charset="utf-8",r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",e+a),s.src=n),t[n]=[o];const l=(e,r)=>{s.onerror=s.onload=null,clearTimeout(u);const o=t[n];if(delete t[n],s.parentNode?.removeChild(s),o?.forEach(t=>t(r)),e)return e(r)},u=setTimeout(l.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=l.bind(null,s.onerror),s.onload=l.bind(null,s.onload),c&&document.head.appendChild(s)}})(),r.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{let t;r.g.importScripts&&(t=r.g.location+"");const e=r.g.document;if(!t&&e&&("SCRIPT"===e.currentScript?.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){const r=e.getElementsByTagName("script");if(r.length){let e=r.length-1;for(;e>-1&&(!t||!/^https?:/.test(t));)t=r[e--].src}}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=t})(),(()=>{const t={792:0};r.f.j=(e,n)=>{let o=r.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{const a=new Promise((r,n)=>o=t[e]=[r,n]);n.push(o[2]=a);const i=new Error,s=n=>{if(r.o(t,e)&&(o=t[e],0!==o&&(t[e]=void 0),o)){const t=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+t+": "+r+")",i.name="ChunkLoadError",i.type=t,i.request=r,i.event=n,o[1](i)}};r.l(r.p+r.u(e),s,"chunk-"+e,e)}};const e=(e,n)=>{let[o,a,i]=n;var s,c,d=0;if(o.some(e=>0!==t[e])){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);i&&i(r)}for(e&&e(n);d<o.length;d++)c=o[d],r.o(t,c)&&t[c]&&t[c][0](),t[c]=0},n=self.webpackChunkevm_contracts_tools=self.webpackChunkevm_contracts_tools||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),r(122)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var
|
|
1
|
+
(()=>{"use strict";var e={825(e,t,o){o.a(e,async(e,r)=>{try{o.d(t,{_evm_contract_deployment_address:()=>v});const n=await o.e(35).then(()=>o(35)),i=(n._basename,n._chmod,n._cp,n._dir_exists,n._echo),c=n._echo2,a=n._file_exists,s=n._file_read,l=n._from_bash_ass_array,d=n._global_get,f=(n._homedir_get,n._json_read),u=(n._lib_get,n._mkdir,n._msg_info),p=n._msg_error,h=(n._override_set,n._path_join),_=(n._pwd,n._require,await o.e(486).then(()=>o(486))),m=(_._config_file_path_check,_._configuration_format_check),y=(_._contract_version_auto_detect,_._deployments_dir_auto_detect,_._network_check),w=(_._networks_all_auto_detect,_._target_app_auto_detect,_._user_deployments_check),g=(await o.e(822).then(()=>o(822)))._evm_contract_deployment_networks;async function b(e,t,r,n,_,y){let w,g,b,v,k,$,j,E,P;const O=d().quiet;E="Reading address from configuration file.",u(E);const S=typeof _;if("bash"==(y=m(y)))g="sh";else{if("json"!=y)throw E=`Unknown configuration format ${y}'.`,p(E,0),E;g="json"}const x=[r,n];for(P of($=!1,x))if(b=h([e,t,P,`config.${g}`]),a(b)){$=!0;break}if(!$)throw E=`No network '${r}' deployment configuration for contract '${t}' found at path '${e}'.`,p(E,0),E;if("json"==y)w=f(b),j="contract-address";else{if("bash"!=y)throw E=`Unknown configuration format '${y}'.`,p(E,0),E;w=l(s(b)),j="contract_address"}if("undefined"===S||""==_){E="No version selected, retrieving.",u(E),k=await o.e(724).then(()=>o(724));const e=k._evm_contract_deployment_versions;v=[b,"y","n",y];try{E="Running '_evm_contract_deployment_versions' with arguments:",u(E),"n"==O&&i(v),E=`Got contract version '${_=await e.apply(null,v)}'.`,u(E)}catch(e){throw E="Error while running '_evm_contract_deployment_versions' with arguments:",p(E,0),c(v),e}}const T=w[j][_],A=typeof T;if("undefined"===A||""==T)throw E=`No '${t}' version '${_}' contract deployment specified for network '${r}' for directory at path '${e}'.`,p(E,0),E;return"string"==A&&(E=`Got contract address '${T}'`,u(E)),T}async function v(e,t,r,n,i,a,s,l,f){let h,_,v,k,$,j,E,P,O,S;l=m(l);const x=d().quiet,T=(await o.e(419).then(()=>o(419)))._evm_contract_deployments_dir,A=[],C=[],N=typeof f;if(void 0!==s&&""!==s||(k="User defined not specified, setting default (n).",u(k),s="n"),"undefined"===N||""===f)try{k="Deployments directory undefined, auto-detecting.",u(k),f=await T(n,s)}catch(e){throw k="Error while retrieving system deployments directory location for auto-detection.",p(k,0),p(e,0),e}if("n"==s){if(""===n)throw k="A target application needs to be specified with option '-a' if not enabling user-defined deployments with '-u' and specifying a deployments directory path with '-d'.",p(k,0),k;try{S=await T(n,s)}catch(e){throw k="Error while retrieving system deployments directory location.",p(k,0),p(e,0),e}if(f!=S)throw k="To set a custom deployments directory path you need to enable the user-defined deployments switch with '-u'."+p(k,0),k}else{if("y"!=s)throw k=`The 'user-defined' switch argument can be 'y' or 'n', current value '${s}'.`,p(k,0),{msg:k};if(""!=n)try{O=await T(n,s)}catch(e){throw k="Error while retrieving user deployments directory location.",p(k,0),p(e,0),e}f!=O?(k=`Using custom deployments directory path '${f}'.`,u(k)):w(n,f)}if("y"==r){k="Selecting all networks.",u(k);try{e=await g(`${f}/${i}`,r)}catch(e){throw k=`Error while retrieving networks for contract '${i}'.`,p(k,0),c(e),e}}for($ of(k=`Getting '${i}' contract address for libEVM app '${n}' for networks with RPCs '${e}' and chain ID '${t}', (user-defined contracts: '${s}'), by looking for configuration files of type '${l}'.`,u(k),e))P="",j=[f,i,$,""],await y.apply(null,j),C.push([f,i,$,"",a,l]);for($ of t)E="",j=[f,i,"",$],await y.apply(null,j),C.push([f,i,"",$,a,l]);for(_ of C){try{k="Running _contract_address_get with parameters:",u(k),"n"==x&&c(_),v=await b.apply(null,_)}catch(e){throw k="Error while running _contract_address_get with parameters:",p(k,0),c(_),c(e),k}A.push(v)}const q={};for(h of A)q[h]=1;return Object.keys(q)}r()}catch(k){r(k)}},1)}};const t={};function o(r){const n=t[r];if(void 0!==n)return n.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),r=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};o.a=(o,i,c)=>{let a;c&&((a=[]).d=-1);const s=new Set,l=o.exports;let d,f,u;const p=new Promise((e,t)=>{u=t,f=e});p[t]=l,p[e]=e=>(a&&e(a),s.forEach(e),p.catch(e=>{})),o.exports=p,i(o=>{let i;d=(o=>o.map(o=>{if(null!==o&&"object"==typeof o){if(o[e])return o;if(o.then){const i=[];i.d=0,o.then(e=>{c[t]=e,n(i)},e=>{c[r]=e,n(i)});const c={};return c[e]=e=>e(i),c}}const i={};return i[e]=e=>{},i[t]=o,i}))(o);const c=()=>d.map(e=>{if(e[r])throw e[r];return e[t]}),l=new Promise(t=>{i=()=>t(c),i.r=0;const o=e=>e!==a&&!s.has(e)&&(s.add(e),e&&!e.d&&(i.r++,e.push(i)));d.forEach(t=>t[e](o))});return i.r?l:c()},e=>(e?u(p[r]=e):f(l),n(a))),a?.d<0&&(a.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}const i=Object.create(null);o.r(i);const c={};t=t||[null,e({}),e([]),e(e)];for(var a=2&n&&r;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>c[e]=()=>r[e]);return c.default=()=>r,o.d(i,c),i}})(),o.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var n=t[r++],i=t[r++],c=0===i?{enumerable:!0,value:t[r++]}:{enumerable:!0,get:i};o.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>{const t=[];return o.f.j(e,t),Promise.all(t)},o.u=e=>e+".libevm-contract-deployment-address.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="evm-contracts-tools:";o.l=(r,n,i,c)=>{if(e[r])return void e[r].push(n);let a,s;if(void 0!==i){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const o=e[l];if(o.getAttribute("src")==r||o.getAttribute("data-webpack")==t+i){a=o;break}}}a||(s=!0,a=document.createElement("script"),a.charset="utf-8",o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",t+i),a.src=r),e[r]=[n];const d=(t,o)=>{a.onerror=a.onload=null,clearTimeout(f);const n=e[r];if(delete e[r],a.parentNode?.removeChild(a),n?.forEach(e=>e(o)),t)return t(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),s&&document.head.appendChild(a)}})(),o.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;o.g.importScripts&&(e=o.g.location+"");const t=o.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const o=t.getElementsByTagName("script");if(o.length){let t=o.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=o[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),o.p=e})(),(()=>{const e={792:0};o.f.j=(t,r)=>{let n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{const i=new Promise((o,r)=>n=e[t]=[o,r]);r.push(n[2]=i);const c=new Error,a=r=>{if(o.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",c.name="ChunkLoadError",c.type=e,c.request=o,c.event=r,n[1](c)}};o.l(o.p+o.u(t),a,"chunk-"+t,t)}};const t=(t,r)=>{let[n,i,c]=r;var a,s,l=0;if(n.some(t=>0!==e[t])){for(a in i)o.o(i,a)&&(o.m[a]=i[a]);c&&c(o)}for(t&&t(r);l<n.length;l++)s=n[l],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0},r=self.webpackChunkevm_contracts_tools=self.webpackChunkevm_contracts_tools||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),o(825)})();
|
package/eslint.config.mjs
CHANGED
|
@@ -35,7 +35,6 @@ const
|
|
|
35
35
|
_ignores = [
|
|
36
36
|
"build/**",
|
|
37
37
|
"dist/**",
|
|
38
|
-
"node_modules/**",
|
|
39
38
|
"eslint.config.js",
|
|
40
39
|
"evm-contract-call.js",
|
|
41
40
|
"**/*.evm-contract-call.js",
|
|
@@ -73,7 +72,8 @@ const
|
|
|
73
72
|
"**/*.libevm-contract-deployment-versions.js",
|
|
74
73
|
"libevm-contract-deployments-dir.js",
|
|
75
74
|
"**/*.libevm-contract-deployments-dir.js",
|
|
76
|
-
"man/**"
|
|
75
|
+
"man/**",
|
|
76
|
+
"node_modules/**"
|
|
77
77
|
];
|
|
78
78
|
|
|
79
79
|
export default defineConfig([
|
|
@@ -123,7 +123,7 @@ export default defineConfig([
|
|
|
123
123
|
"prefer-const":
|
|
124
124
|
"error" },
|
|
125
125
|
files: [
|
|
126
|
-
|
|
126
|
+
"**/*.{cjs,js}",
|
|
127
127
|
],
|
|
128
128
|
languageOptions:
|
|
129
129
|
{ sourceType:
|
|
@@ -62,6 +62,11 @@ const
|
|
|
62
62
|
const
|
|
63
63
|
_echo =
|
|
64
64
|
_libcrash._echo;
|
|
65
|
+
/* global
|
|
66
|
+
_echo2 */
|
|
67
|
+
const
|
|
68
|
+
_echo2 =
|
|
69
|
+
_libcrash._echo2;
|
|
65
70
|
/* global
|
|
66
71
|
_exit */
|
|
67
72
|
const
|
|
@@ -260,12 +265,16 @@ async function
|
|
|
260
265
|
"user",
|
|
261
266
|
"defined",
|
|
262
267
|
"n");
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
const
|
|
269
|
+
_target_contract =
|
|
270
|
+
_get(
|
|
271
|
+
"target",
|
|
272
|
+
"contract");
|
|
273
|
+
if ( _target_contract != "" ) {
|
|
274
|
+
await _target_app_auto_detect();
|
|
275
|
+
await _deployments_dir_auto_detect();
|
|
276
|
+
await _contract_version_auto_detect();
|
|
277
|
+
}
|
|
269
278
|
}
|
|
270
279
|
|
|
271
280
|
function
|
|
@@ -604,12 +613,29 @@ async function
|
|
|
604
613
|
_evm_contract_deployment_address_cmdline(
|
|
605
614
|
_app_opts) {
|
|
606
615
|
let
|
|
607
|
-
|
|
608
|
-
|
|
616
|
+
_msg,
|
|
617
|
+
_result,
|
|
618
|
+
_results;
|
|
619
|
+
try {
|
|
609
620
|
_results =
|
|
610
621
|
await _evm_contract_deployment_address.apply(
|
|
611
622
|
null,
|
|
612
623
|
_app_opts);
|
|
624
|
+
}
|
|
625
|
+
catch(
|
|
626
|
+
_error) {
|
|
627
|
+
_msg =
|
|
628
|
+
"Error running '_evm_contract_deployment_address' " +
|
|
629
|
+
"with arguments:";
|
|
630
|
+
_msg_error(
|
|
631
|
+
_msg,
|
|
632
|
+
0);
|
|
633
|
+
_echo2(
|
|
634
|
+
_app_opts);
|
|
635
|
+
_echo2(
|
|
636
|
+
_error);
|
|
637
|
+
throw _error;
|
|
638
|
+
}
|
|
613
639
|
const
|
|
614
640
|
_results_type =
|
|
615
641
|
typeof(
|
|
@@ -628,6 +654,9 @@ async function
|
|
|
628
654
|
|
|
629
655
|
async function
|
|
630
656
|
_main() {
|
|
657
|
+
let
|
|
658
|
+
_address,
|
|
659
|
+
_msg;
|
|
631
660
|
const
|
|
632
661
|
_overrides_set_up =
|
|
633
662
|
await _overrides_set();
|
|
@@ -644,10 +673,24 @@ async function
|
|
|
644
673
|
configuration_format,
|
|
645
674
|
deployments_dir,
|
|
646
675
|
];
|
|
647
|
-
|
|
676
|
+
try {
|
|
648
677
|
_address =
|
|
649
678
|
await _evm_contract_deployment_address_cmdline(
|
|
650
679
|
app_opts);
|
|
680
|
+
}
|
|
681
|
+
catch(
|
|
682
|
+
_error) {
|
|
683
|
+
_msg =
|
|
684
|
+
"Error running " +
|
|
685
|
+
`'_evm_contract_deployment_adress_cmdline' ` +
|
|
686
|
+
"with arguments:";
|
|
687
|
+
_msg_error(
|
|
688
|
+
_msg,
|
|
689
|
+
0);
|
|
690
|
+
_echo2(
|
|
691
|
+
_error);
|
|
692
|
+
throw _error;
|
|
693
|
+
}
|
|
651
694
|
}
|
|
652
695
|
|
|
653
696
|
_global_variables();
|
|
@@ -660,4 +703,17 @@ if ( await _cmdline_check(
|
|
|
660
703
|
else{
|
|
661
704
|
_url_parse();
|
|
662
705
|
}
|
|
663
|
-
|
|
706
|
+
try {
|
|
707
|
+
_main();
|
|
708
|
+
}
|
|
709
|
+
catch(
|
|
710
|
+
_error) {
|
|
711
|
+
const
|
|
712
|
+
_msg =
|
|
713
|
+
`Error running '${app_name}'.`;
|
|
714
|
+
_msg_error(
|
|
715
|
+
_msg,
|
|
716
|
+
0);
|
|
717
|
+
_echo2(
|
|
718
|
+
_error);
|
|
719
|
+
}
|
|
@@ -451,9 +451,21 @@ async function
|
|
|
451
451
|
_msg_info(
|
|
452
452
|
_msg);
|
|
453
453
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
try {
|
|
455
|
+
_app =
|
|
456
|
+
_app_check(
|
|
457
|
+
_app);
|
|
458
|
+
}
|
|
459
|
+
catch(
|
|
460
|
+
_error) {
|
|
461
|
+
_msg =
|
|
462
|
+
"Error running '_app_check' " +
|
|
463
|
+
`for application '${_app}'.`;
|
|
464
|
+
_msg_error(
|
|
465
|
+
_msg,
|
|
466
|
+
0);
|
|
467
|
+
throw _error;
|
|
468
|
+
}
|
|
457
469
|
const
|
|
458
470
|
_contract_type =
|
|
459
471
|
typeof(
|
|
@@ -762,9 +774,21 @@ async function
|
|
|
762
774
|
_msg_info(
|
|
763
775
|
_msg);
|
|
764
776
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
777
|
+
try {
|
|
778
|
+
_app =
|
|
779
|
+
_app_check(
|
|
780
|
+
_app);
|
|
781
|
+
}
|
|
782
|
+
catch(
|
|
783
|
+
_error) {
|
|
784
|
+
_msg =
|
|
785
|
+
"Error running '_app_check' " +
|
|
786
|
+
`for application '${_app}'.`;
|
|
787
|
+
_msg_error(
|
|
788
|
+
_msg,
|
|
789
|
+
0);
|
|
790
|
+
throw _error;
|
|
791
|
+
}
|
|
768
792
|
const
|
|
769
793
|
_contract_type =
|
|
770
794
|
typeof(
|
|
@@ -1055,9 +1079,21 @@ async function
|
|
|
1055
1079
|
_msg_info(
|
|
1056
1080
|
_msg);
|
|
1057
1081
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1082
|
+
try {
|
|
1083
|
+
_app =
|
|
1084
|
+
_app_check(
|
|
1085
|
+
_app);
|
|
1086
|
+
}
|
|
1087
|
+
catch(
|
|
1088
|
+
_error) {
|
|
1089
|
+
_msg =
|
|
1090
|
+
"Error running '_app_check' " +
|
|
1091
|
+
`for application '${_app}'.`;
|
|
1092
|
+
_msg_error(
|
|
1093
|
+
_msg,
|
|
1094
|
+
0);
|
|
1095
|
+
throw _error;
|
|
1096
|
+
}
|
|
1061
1097
|
const
|
|
1062
1098
|
_contract_type =
|
|
1063
1099
|
typeof(
|
|
@@ -1700,9 +1736,21 @@ async function
|
|
|
1700
1736
|
_error);
|
|
1701
1737
|
throw _error;
|
|
1702
1738
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1739
|
+
try {
|
|
1740
|
+
_app =
|
|
1741
|
+
_app_check(
|
|
1742
|
+
_app);
|
|
1743
|
+
}
|
|
1744
|
+
catch(
|
|
1745
|
+
_error) {
|
|
1746
|
+
_msg =
|
|
1747
|
+
"Error running '_app_check' " +
|
|
1748
|
+
`for application '${_app}'.`;
|
|
1749
|
+
_msg_error(
|
|
1750
|
+
_msg,
|
|
1751
|
+
0);
|
|
1752
|
+
throw _error;
|
|
1753
|
+
}
|
|
1706
1754
|
_user_defined =
|
|
1707
1755
|
_user_defined_check(
|
|
1708
1756
|
_user_defined);
|
|
@@ -1750,9 +1798,21 @@ async function
|
|
|
1750
1798
|
_get(
|
|
1751
1799
|
"target",
|
|
1752
1800
|
"app");
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1801
|
+
try {
|
|
1802
|
+
_app =
|
|
1803
|
+
_app_check(
|
|
1804
|
+
_app);
|
|
1805
|
+
}
|
|
1806
|
+
catch(
|
|
1807
|
+
_error) {
|
|
1808
|
+
_msg =
|
|
1809
|
+
"Error running '_app_check' " +
|
|
1810
|
+
`for application '${_app}'.`;
|
|
1811
|
+
_msg_error(
|
|
1812
|
+
_msg,
|
|
1813
|
+
0);
|
|
1814
|
+
throw _error;
|
|
1815
|
+
}
|
|
1756
1816
|
if ( _app != "" ) {
|
|
1757
1817
|
_user_defined =
|
|
1758
1818
|
_get(
|
|
@@ -1989,9 +2049,9 @@ async function
|
|
|
1989
2049
|
target_networks[
|
|
1990
2050
|
0];
|
|
1991
2051
|
}
|
|
1992
|
-
if ( 0 <
|
|
2052
|
+
if ( 0 < networks_ids.length ) {
|
|
1993
2053
|
_network_id =
|
|
1994
|
-
|
|
2054
|
+
_networks_ids[
|
|
1995
2055
|
0];
|
|
1996
2056
|
}
|
|
1997
2057
|
const
|
|
@@ -2106,8 +2166,18 @@ function
|
|
|
2106
2166
|
_networks_all;
|
|
2107
2167
|
_networks_all =
|
|
2108
2168
|
"n";
|
|
2109
|
-
|
|
2110
|
-
|
|
2169
|
+
const
|
|
2170
|
+
_target_networks =
|
|
2171
|
+
_get(
|
|
2172
|
+
"target",
|
|
2173
|
+
"networks");
|
|
2174
|
+
const
|
|
2175
|
+
_networks_ids =
|
|
2176
|
+
_get(
|
|
2177
|
+
"networks",
|
|
2178
|
+
"ids");
|
|
2179
|
+
if ( _target_networks.length < 1 &&
|
|
2180
|
+
_networks_ids.length < 1 ) {
|
|
2111
2181
|
_networks_all =
|
|
2112
2182
|
"y";
|
|
2113
2183
|
}
|
|
@@ -2535,7 +2605,8 @@ async function
|
|
|
2535
2605
|
let
|
|
2536
2606
|
_address_missing,
|
|
2537
2607
|
_app,
|
|
2538
|
-
_evm_contract_deployments_dir
|
|
2608
|
+
_evm_contract_deployments_dir,
|
|
2609
|
+
_msg;
|
|
2539
2610
|
const
|
|
2540
2611
|
_contract_address =
|
|
2541
2612
|
_get(
|
|
@@ -2587,6 +2658,12 @@ async function
|
|
|
2587
2658
|
_app =
|
|
2588
2659
|
"";
|
|
2589
2660
|
if ( ! _address_missing ) {
|
|
2661
|
+
_msg =
|
|
2662
|
+
"Determining LibEVM application name " +
|
|
2663
|
+
"for contract with address " +
|
|
2664
|
+
`'${_contract_address}'.`;
|
|
2665
|
+
_msg_info(
|
|
2666
|
+
_msg);
|
|
2590
2667
|
const
|
|
2591
2668
|
_dir_current_name =
|
|
2592
2669
|
_basename(
|
|
@@ -2663,6 +2740,12 @@ async function
|
|
|
2663
2740
|
_msg);
|
|
2664
2741
|
}
|
|
2665
2742
|
}
|
|
2743
|
+
else {
|
|
2744
|
+
_msg =
|
|
2745
|
+
"No contract address defined.";
|
|
2746
|
+
_msg_info(
|
|
2747
|
+
_msg);
|
|
2748
|
+
}
|
|
2666
2749
|
_override_set(
|
|
2667
2750
|
"target",
|
|
2668
2751
|
"app",
|
|
@@ -411,7 +411,7 @@ async function
|
|
|
411
411
|
async function
|
|
412
412
|
_evm_contract_deployment_address(
|
|
413
413
|
_target_networks,
|
|
414
|
-
|
|
414
|
+
_networks_ids,
|
|
415
415
|
_networks_all,
|
|
416
416
|
_target_app,
|
|
417
417
|
_target_contract,
|
|
@@ -474,6 +474,11 @@ async function
|
|
|
474
474
|
if ( _deployments_dir_type === "undefined" ||
|
|
475
475
|
_deployments_dir === "" ) {
|
|
476
476
|
try {
|
|
477
|
+
_msg =
|
|
478
|
+
"Deployments directory undefined, " +
|
|
479
|
+
"auto-detecting.";
|
|
480
|
+
_msg_info(
|
|
481
|
+
_msg);
|
|
477
482
|
_deployments_dir =
|
|
478
483
|
await _evm_contract_deployments_dir(
|
|
479
484
|
_target_app,
|
|
@@ -614,7 +619,7 @@ async function
|
|
|
614
619
|
`Getting '${_target_contract}' contract address for ` +
|
|
615
620
|
`libEVM app '${_target_app}' ` +
|
|
616
621
|
`for networks with RPCs '${_target_networks}' ` +
|
|
617
|
-
`and chain ID '${
|
|
622
|
+
`and chain ID '${_networks_ids}', (user-defined contracts: ` +
|
|
618
623
|
`'${_user_defined}'), by looking for configuration files ` +
|
|
619
624
|
`of type '${_configuration_format}'.`;
|
|
620
625
|
_msg_info(
|
|
@@ -645,7 +650,7 @@ async function
|
|
|
645
650
|
_configuration_format
|
|
646
651
|
] );
|
|
647
652
|
}
|
|
648
|
-
for ( _network of
|
|
653
|
+
for ( _network of _networks_ids ) {
|
|
649
654
|
_target_network =
|
|
650
655
|
"";
|
|
651
656
|
_network_check_args = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{ "name": "evm-contracts-tools",
|
|
2
2
|
"version":
|
|
3
|
-
"0.0.
|
|
3
|
+
"0.0.72",
|
|
4
4
|
"description":
|
|
5
5
|
"JavaScript programs and libraries to enable seamless development of native computer applications designed to interact with Ethereum Virtual Machine-compatible networks.",
|
|
6
6
|
"funding": {
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
"evm-chains-info":
|
|
127
127
|
"^0.0.39",
|
|
128
128
|
"evm-transactions-tools":
|
|
129
|
-
"^0.1.
|
|
129
|
+
"^0.1.10000000000001",
|
|
130
130
|
"evm-wallet":
|
|
131
|
-
"npm:evm-wallet.js@^0.0.
|
|
131
|
+
"npm:evm-wallet.js@^0.0.103",
|
|
132
132
|
"libevm":
|
|
133
133
|
"^0.0.46",
|
|
134
134
|
"ws":
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"evm-contracts-tools":
|
|
143
143
|
"./evm-contracts-tools",
|
|
144
144
|
"evm-wallet":
|
|
145
|
-
"npm:evm-wallet.js@^0.0.
|
|
145
|
+
"npm:evm-wallet.js@^0.0.103",
|
|
146
146
|
"evm-wallet.js":
|
|
147
|
-
"npm:evm-wallet.js@^0.0.
|
|
147
|
+
"npm:evm-wallet.js@^0.0.103",
|
|
148
148
|
"libevm":
|
|
149
149
|
"^0.0.46"
|
|
150
150
|
},
|