@layerzerolabs/hardhat-tron 2.1.12

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.
Files changed (69) hide show
  1. package/README.md +78 -0
  2. package/dist/DeploymentFactory.d.ts +13 -0
  3. package/dist/DeploymentFactory.d.ts.map +1 -0
  4. package/dist/DeploymentFactory.js +46 -0
  5. package/dist/DeploymentFactory.js.map +1 -0
  6. package/dist/DeploymentsManager.d.ts +10 -0
  7. package/dist/DeploymentsManager.d.ts.map +1 -0
  8. package/dist/DeploymentsManager.js +78 -0
  9. package/dist/DeploymentsManager.js.map +1 -0
  10. package/dist/constants.d.ts +10 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/constants.js +70 -0
  13. package/dist/constants.js.map +1 -0
  14. package/dist/downloader.d.ts +14 -0
  15. package/dist/downloader.d.ts.map +1 -0
  16. package/dist/downloader.js +107 -0
  17. package/dist/downloader.js.map +1 -0
  18. package/dist/extendedArtifactsTron/Diamond.json +17557 -0
  19. package/dist/extendedArtifactsTron/DiamondCutFacet.json +10112 -0
  20. package/dist/extendedArtifactsTron/DiamondERC165Init.json +1549 -0
  21. package/dist/extendedArtifactsTron/DiamondLoupeFacet.json +3194 -0
  22. package/dist/extendedArtifactsTron/EIP173Proxy.json +4707 -0
  23. package/dist/extendedArtifactsTron/EIP173ProxyWithReceive.json +4524 -0
  24. package/dist/extendedArtifactsTron/ERC1967Proxy.json +4039 -0
  25. package/dist/extendedArtifactsTron/OptimizedTransparentUpgradeableProxy.json +6143 -0
  26. package/dist/extendedArtifactsTron/OwnershipFacet.json +793 -0
  27. package/dist/extendedArtifactsTron/ProxyAdmin.json +4339 -0
  28. package/dist/extendedArtifactsTron/TransparentUpgradeableProxy.json +6829 -0
  29. package/dist/helper.d.ts +39 -0
  30. package/dist/helper.d.ts.map +1 -0
  31. package/dist/helper.js +2484 -0
  32. package/dist/helper.js.map +1 -0
  33. package/dist/index.d.ts +3 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +159 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/tron/contract.d.ts +12 -0
  38. package/dist/tron/contract.d.ts.map +1 -0
  39. package/dist/tron/contract.js +38 -0
  40. package/dist/tron/contract.js.map +1 -0
  41. package/dist/tron/provider.d.ts +41 -0
  42. package/dist/tron/provider.d.ts.map +1 -0
  43. package/dist/tron/provider.js +165 -0
  44. package/dist/tron/provider.js.map +1 -0
  45. package/dist/tron/signer.d.ts +31 -0
  46. package/dist/tron/signer.d.ts.map +1 -0
  47. package/dist/tron/signer.js +102 -0
  48. package/dist/tron/signer.js.map +1 -0
  49. package/dist/tron/types.d.ts +10 -0
  50. package/dist/tron/types.d.ts.map +1 -0
  51. package/dist/tron/types.js +9 -0
  52. package/dist/tron/types.js.map +1 -0
  53. package/dist/tron/utils.d.ts +26 -0
  54. package/dist/tron/utils.d.ts.map +1 -0
  55. package/dist/tron/utils.js +64 -0
  56. package/dist/tron/utils.js.map +1 -0
  57. package/dist/type-extensions.d.ts +34 -0
  58. package/dist/type-extensions.d.ts.map +1 -0
  59. package/dist/type-extensions.js +4 -0
  60. package/dist/type-extensions.js.map +1 -0
  61. package/dist/types.d.ts +30 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +3 -0
  64. package/dist/types.js.map +1 -0
  65. package/dist/utils.d.ts +19 -0
  66. package/dist/utils.d.ts.map +1 -0
  67. package/dist/utils.js +118 -0
  68. package/dist/utils.js.map +1 -0
  69. package/package.json +114 -0
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # @layerzerolabs/hardhat-tron
2
+
3
+ [Hardhat](https://hardhat.org) plugin for integrating the Tron Solidity Compiler.
4
+
5
+ This plugin provides seamless integration of the Tron Solidity Compiler into the Hardhat build environment. It extends Hardhat's native Solidity compilation tasks to support Tron's version of the solc compiler. This allows developers working on Tron blockchain projects to compile their smart contracts within the familiar Hardhat environment, using Tron's specific compiler versions and configurations.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ yarn add -D @layerzerolabs/hardhat-tron
11
+ ```
12
+
13
+ Import the plugin in your `hardhat.config.ts`:
14
+
15
+ ```ts
16
+ import "@layerzerolabs/hardhat-tron";
17
+ ```
18
+
19
+ ## required plugins
20
+
21
+ The following plugin is needed to support hardhat deployments on Tron chains
22
+
23
+ - [@layerzerolabs/hardhat-deploy](https://www.npmjs.com/package/@layerzerolabs/hardhat-deploy)
24
+
25
+ ## Tasks
26
+
27
+ This plugin overrides several internal Hardhat tasks to integrate the Tron Solidity Compiler:
28
+
29
+ - `compile`: Extended for compiling with the Tron solc compiler.
30
+ - `clean`: Enhanced to clean Tron-specific artifacts and cache.
31
+
32
+ ## Environment extensions
33
+
34
+ This plugin extends the Hardhat Runtime Environment by adding configurations and utilities for handling the Tron Solidity Compiler. This includes network configurations specific to the Tron blockchain and support for downloading and setting up the Tron version of solc.
35
+
36
+ ## Configuration
37
+
38
+ This plugin extends the `HardhatUserConfig` with Tron-specific compiler configurations.
39
+ In addition to the predefined versions known by the plugin, it is possible to select a compiler version greater than the latest known. The plugin will attempt to download and use the specified compiler version. However, if the specified version does not exist, it will throw an error.
40
+
41
+ > **All tronSolc.compilers versions must also be declared in the solidity.compilers array.**
42
+
43
+ ```js
44
+ const hardhatConfig = {
45
+ ...regularHardhatConfig,
46
+ tronSolc: {
47
+ enable: true,
48
+ // Optional: specify an array of contract filenames (without path) to selectively compile. Leave as empty array to compile all contracts.
49
+ filter: [],
50
+ compilers: [{ version: "0.7.7" }, { version: "0.8.20" }], // can be any tron-solc version
51
+ // Optional: Define version remappings for compiler versions
52
+ versionRemapping: [
53
+ ["0.7.7", "0.7.6"], // Remap version "0.7.7" to "0.7.6"
54
+ ["0.8.22", "0.8.20"], // Remap version "0.8.20" to "0.8.19"
55
+ ],
56
+ },
57
+ };
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ After installation, the plugin automatically hooks into Hardhat's compilation tasks. Configure the Tron solc compiler in the Hardhat configuration file as shown above. The plugin handles the rest, ensuring that your smart contracts are compiled with the appropriate version of the Tron Solidity Compiler.
63
+
64
+ Note: Make sure to enable the plugin in your Hardhat configuration and specify the required compiler versions for your project.
65
+
66
+ ## Version Remapping
67
+
68
+ The versionRemapping option allows you to specify Solidity versions to remap. This is useful when you want to compile contracts with a specific version of the Tron Solidity Compiler that is different from the one declared in the contract files. The map keys are the original versions specified in your contract files, and the values are the target compiler versions you wish to use instead.
69
+
70
+ To use this feature, simply add the versionRemapping property to your tronSolc configuration in the Hardhat config file.
71
+ The map should contain entries where each key is the version to be replaced, and each value is the new target version.
72
+
73
+ ## Filter Option
74
+
75
+ The filter option in the tronSolc configuration allows for selective compilation of Solidity contracts.
76
+ By specifying an array of contract filenames, you can target specific contracts for compilation.
77
+ To compile all contracts in your project, set filter to an empty array.
78
+ Note: The filenames in the filter array should not include the path, only the contract file names without the extension.
@@ -0,0 +1,13 @@
1
+ import { TransactionResponse } from '@ethersproject/providers';
2
+ import { PayableOverrides, Signer } from 'ethers';
3
+ import { Artifact } from 'hardhat/types';
4
+ import { DeploymentFactory } from 'hardhat-deploy/dist/src/DeploymentFactory';
5
+ import { ExtendedArtifact } from 'hardhat-deploy/dist/types';
6
+ import * as zk from 'zksync-web3';
7
+ import { TronSigner } from './tron/signer';
8
+ export declare class CustomDeploymentFactory extends DeploymentFactory {
9
+ private isTron;
10
+ constructor(getArtifact: (name: string) => Promise<Artifact>, artifact: Artifact | ExtendedArtifact, args: any[], network: any, ethersSigner?: Signer | zk.Signer | TronSigner, overrides?: PayableOverrides);
11
+ compareDeploymentTransaction(transaction: TransactionResponse): Promise<boolean>;
12
+ }
13
+ //# sourceMappingURL=DeploymentFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentFactory.d.ts","sourceRoot":"","sources":["../src/DeploymentFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAC7E,OAAO,EAAW,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,qBAAa,uBAAwB,SAAQ,iBAAiB;IAC1D,OAAO,CAAC,MAAM,CAAS;gBAGnB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,EAChD,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EACrC,IAAI,EAAE,GAAG,EAAE,EACX,OAAO,EAAE,GAAG,EACZ,YAAY,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,GAAG,UAAU,EAC9C,SAAS,GAAE,gBAAqB;IAwCvB,4BAA4B,CAAC,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAahG"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomDeploymentFactory = void 0;
4
+ const address_1 = require("@ethersproject/address");
5
+ const solidity_1 = require("@ethersproject/solidity");
6
+ const DeploymentFactory_1 = require("hardhat-deploy/dist/src/DeploymentFactory");
7
+ const contract_1 = require("./tron/contract");
8
+ class CustomDeploymentFactory extends DeploymentFactory_1.DeploymentFactory {
9
+ constructor(getArtifact, artifact, args, network, ethersSigner, overrides = {}) {
10
+ super(getArtifact, artifact, args, network, ethersSigner, overrides);
11
+ this.isTron = network.tron;
12
+ if (this.isTron) {
13
+ let contractName = '';
14
+ if ('contractName' in artifact)
15
+ ({ contractName } = artifact);
16
+ this['factory'] = new contract_1.TronContractFactory(artifact.abi, artifact.bytecode, ethersSigner, contractName);
17
+ this['calculateEvmCreate2Address'] = async (create2DeployerAddress, salt) => {
18
+ const deploymentTx = await this.getDeployTransaction();
19
+ if (typeof deploymentTx.data !== 'string') {
20
+ throw Error('unsigned tx data as bytes not supported');
21
+ }
22
+ const prefix = '0x41';
23
+ return (0, address_1.getAddress)('0x' +
24
+ (0, solidity_1.keccak256)(['bytes'], [
25
+ `${prefix}${create2DeployerAddress.slice(2)}${salt.slice(2)}${(0, solidity_1.keccak256)(['bytes'], [deploymentTx.data]).slice(2)}`,
26
+ ]).slice(-40));
27
+ };
28
+ }
29
+ }
30
+ async compareDeploymentTransaction(transaction) {
31
+ const newTransaction = await this.getDeployTransaction();
32
+ if (this.isTron) {
33
+ const tronDeployTx = newTransaction;
34
+ const res = await this['factory'].signer.getTronWebTransaction(transaction.hash);
35
+ const contract = res.raw_data.contract[0];
36
+ const deployed_bytecode = contract.parameter.value.new_contract?.bytecode;
37
+ const newBytecode = tronDeployTx.bytecode + tronDeployTx.rawParameter;
38
+ return deployed_bytecode !== newBytecode;
39
+ }
40
+ else {
41
+ return super.compareDeploymentTransaction(transaction);
42
+ }
43
+ }
44
+ }
45
+ exports.CustomDeploymentFactory = CustomDeploymentFactory;
46
+ //# sourceMappingURL=DeploymentFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentFactory.js","sourceRoot":"","sources":["../src/DeploymentFactory.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AAEnD,sDAAwE;AAGxE,iFAA6E;AAI7E,8CAAqD;AAIrD,MAAa,uBAAwB,SAAQ,qCAAiB;IAG1D,YACI,WAAgD,EAChD,QAAqC,EACrC,IAAW,EACX,OAAY,EACZ,YAA8C,EAC9C,YAA8B,EAAE;QAEhC,KAAK,CAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,CAAA;QACpE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAA;QAC1B,IAAI,IAAI,CAAC,MAAM,EAAE;YAC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AC,IAAI,CAAC,CAAA;YAChG,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;YACzC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAA;YACzE,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAA;YACrE,OAAO,iBAAiB,KAAK,WAAW,CAAA;SAC3C;aAAM;YACH,OAAO,KAAK,CAAC,4BAA4B,CAAC,WAAW,CAAC,CAAA;SACzD;IACL,CAAC;CACJ;AA9DD,0DA8DC"}
@@ -0,0 +1,10 @@
1
+ import { BigNumber } from '@ethersproject/bignumber';
2
+ import { HardhatRuntimeEnvironment, Network } from 'hardhat/types';
3
+ import { DeploymentsManager } from 'hardhat-deploy/dist/src/DeploymentsManager';
4
+ export declare class CustomDeploymentsManager extends DeploymentsManager {
5
+ readonly isTronNetworkWithTronSolc: boolean;
6
+ constructor(env: HardhatRuntimeEnvironment, network: Network);
7
+ private getTronImportPaths;
8
+ getDeterministicDeploymentFactoryFunding(): Promise<BigNumber>;
9
+ }
10
+ //# sourceMappingURL=DeploymentsManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentsManager.d.ts","sourceRoot":"","sources":["../src/DeploymentsManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAA;AAM/E,qBAAa,wBAAyB,SAAQ,kBAAkB;IAC5D,SAAgB,yBAAyB,EAAE,OAAO,CAAQ;gBAE9C,GAAG,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO;IAoE5D,OAAO,CAAC,kBAAkB;IAmBb,wCAAwC,IAAI,OAAO,CAAC,SAAS,CAAC;CAO9E"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomDeploymentsManager = void 0;
4
+ const bignumber_1 = require("@ethersproject/bignumber");
5
+ const DeploymentsManager_1 = require("hardhat-deploy/dist/src/DeploymentsManager");
6
+ const helper_1 = require("./helper");
7
+ class CustomDeploymentsManager extends DeploymentsManager_1.DeploymentsManager {
8
+ constructor(env, network) {
9
+ super(env, network);
10
+ this.isTronNetworkWithTronSolc = false;
11
+ if (network.tron && env.config?.tronSolc?.enable) {
12
+ this.isTronNetworkWithTronSolc = true;
13
+ this['getImportPaths'] = () => this.getTronImportPaths();
14
+ const partialExtension = this['partialExtension'];
15
+ const network = this['network'];
16
+ const db = this['db'];
17
+ const print = (msg) => {
18
+ if (db.logEnabled) {
19
+ process.stdout.write(msg);
20
+ }
21
+ };
22
+ const helpers = (0, helper_1.addHelpers)(this, partialExtension, network, partialExtension.getArtifact, async (name, deployment, artifactName) => {
23
+ if (artifactName && db.writeDeploymentsToFiles && network.saveDeployments) {
24
+ const extendedArtifact = await partialExtension.getExtendedArtifact(artifactName);
25
+ deployment = {
26
+ ...deployment,
27
+ ...extendedArtifact,
28
+ };
29
+ }
30
+ await partialExtension.save(name, deployment);
31
+ }, () => {
32
+ return db.writeDeploymentsToFiles && network.saveDeployments;
33
+ }, this.onPendingTx.bind(this), async () => {
34
+ let gasPrice;
35
+ let maxFeePerGas;
36
+ let maxPriorityFeePerGas;
37
+ if (db.gasPrice) {
38
+ gasPrice = bignumber_1.BigNumber.from(db.gasPrice);
39
+ }
40
+ else {
41
+ if (db.maxFeePerGas) {
42
+ maxFeePerGas = bignumber_1.BigNumber.from(db.maxFeePerGas);
43
+ }
44
+ if (db.maxPriorityFeePerGas) {
45
+ maxPriorityFeePerGas = bignumber_1.BigNumber.from(db.maxPriorityFeePerGas);
46
+ }
47
+ }
48
+ return { gasPrice, maxFeePerGas, maxPriorityFeePerGas };
49
+ }, partialExtension.log, print);
50
+ this.deploymentsExtension = helpers.extension;
51
+ this['utils'] = helpers.utils;
52
+ }
53
+ }
54
+ getTronImportPaths() {
55
+ const importPaths = [];
56
+ const env = this['env'];
57
+ if (env.config.paths.imports.endsWith('-tron')) {
58
+ importPaths.push(env.config.paths.imports);
59
+ }
60
+ if (env.config.external && env.config.external.contracts) {
61
+ for (const externalContracts of env.config.external.contracts) {
62
+ for (const artifact of externalContracts.artifacts) {
63
+ if (artifact.endsWith('-tron')) {
64
+ importPaths.push(artifact);
65
+ }
66
+ }
67
+ }
68
+ }
69
+ return importPaths;
70
+ }
71
+ async getDeterministicDeploymentFactoryFunding() {
72
+ const info = await this['getDeterminisityDeploymentInfo']();
73
+ const funding_default = this.isTronNetworkWithTronSolc ? '100000' : '10000000000000000';
74
+ return bignumber_1.BigNumber.from(info?.funding || funding_default);
75
+ }
76
+ }
77
+ exports.CustomDeploymentsManager = CustomDeploymentsManager;
78
+ //# sourceMappingURL=DeploymentsManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentsManager.js","sourceRoot":"","sources":["../src/DeploymentsManager.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAEpD,mFAA+E;AAI/E,qCAAqC;AAErC,MAAa,wBAAyB,SAAQ,uCAAkB;IAG5D,YAAY,GAA8B,EAAE,OAAgB;QACxD,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAHP,8BAAyB,GAAY,KAAK,CAAA;QAKtD,IAAI,OAAO,CAAC,IAAI,IAAK,GAAG,CAAC,MAAc,EAAE,QAAQ,EAAE,MAAM,EAAE;YACvD,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAA;YACrC,IAAI,CAAC,gBAAgB,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACxD,MAAM,gBAAgB,GAAqB,IAAI,CAAC,kBAAkB,CAAC,CAAA;YACnE,MAAM,OAAO,GAAG,IAAI,CAAC,SA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AAC,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAA;QACvF,OAAO,qBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,IAAI,eAAe,CAAC,CAAA;IAC3D,CAAC;CACJ;AAjGD,4DAiGC"}
@@ -0,0 +1,10 @@
1
+ export declare const PLUGIN_NAME = "@layerzerolabs/hardhat-tron";
2
+ declare const _TRON_SOLC_VERSIONS: readonly ["0.4.24", "0.4.25", "0.5.4", "0.5.8", "0.5.10", "0.5.12", "0.5.13", "0.5.14", "0.5.15", "0.5.16", "0.5.17", "0.5.18", "0.6.0", "0.6.2", "0.6.8", "0.6.12", "0.6.13", "0.7.0", "0.7.6", "0.7.7", "0.8.0", "0.8.6", "0.8.7", "0.8.11", "0.8.18", "0.8.20"];
3
+ export type TronSolcVersion = (typeof _TRON_SOLC_VERSIONS)[number];
4
+ export declare const TRON_SOLC_VERSIONS: Set<"0.4.24" | "0.4.25" | "0.5.4" | "0.5.8" | "0.5.10" | "0.5.12" | "0.5.13" | "0.5.14" | "0.5.15" | "0.5.16" | "0.5.17" | "0.5.18" | "0.6.0" | "0.6.2" | "0.6.8" | "0.6.12" | "0.6.13" | "0.7.0" | "0.7.6" | "0.7.7" | "0.8.0" | "0.8.6" | "0.8.7" | "0.8.11" | "0.8.18" | "0.8.20">;
5
+ export declare const LATEST_TRON_SOLC_VERSION: "0.4.24" | "0.4.25" | "0.5.4" | "0.5.8" | "0.5.10" | "0.5.12" | "0.5.13" | "0.5.14" | "0.5.15" | "0.5.16" | "0.5.17" | "0.5.18" | "0.6.0" | "0.6.2" | "0.6.8" | "0.6.12" | "0.6.13" | "0.7.0" | "0.7.6" | "0.7.7" | "0.8.0" | "0.8.6" | "0.8.7" | "0.8.11" | "0.8.18" | "0.8.20";
6
+ export declare const tronSolcDir: () => string;
7
+ export declare const tronSolcPath: (version: string) => string;
8
+ export declare const tronboxSupportedOutputs: Set<string>;
9
+ export {};
10
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,gCAAgC,CAAA;AACxD,QAAA,MAAM,mBAAmB,oQA2Bf,CAAA;AACV,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAClE,eAAO,MAAM,kBAAkB,uRAAgD,CAAA;AAC/E,eAAO,MAAM,wBAAwB,kRAAmF,CAAA;AAExH,eAAO,MAAM,WAAW,cAAiD,CAAA;AACzE,eAAO,MAAM,YAAY,YAAa,MAAM,WAAuD,CAAA;AAmBnG,eAAO,MAAM,uBAAuB,aAahC,CAAA"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.tronboxSupportedOutputs = exports.tronSolcPath = exports.tronSolcDir = exports.LATEST_TRON_SOLC_VERSION = exports.TRON_SOLC_VERSIONS = exports.PLUGIN_NAME = void 0;
7
+ const os_1 = __importDefault(require("os"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const semver_1 = require("semver");
10
+ exports.PLUGIN_NAME = '@layerzerolabs/hardhat-tron';
11
+ const _TRON_SOLC_VERSIONS = [
12
+ '0.4.24',
13
+ '0.4.25',
14
+ '0.5.4',
15
+ '0.5.8',
16
+ '0.5.10',
17
+ '0.5.12',
18
+ '0.5.13',
19
+ '0.5.14',
20
+ '0.5.15',
21
+ '0.5.16',
22
+ '0.5.17',
23
+ '0.5.18',
24
+ '0.6.0',
25
+ '0.6.2',
26
+ '0.6.8',
27
+ '0.6.12',
28
+ '0.6.13',
29
+ '0.7.0',
30
+ '0.7.6',
31
+ '0.7.7',
32
+ '0.8.0',
33
+ '0.8.6',
34
+ '0.8.7',
35
+ '0.8.11',
36
+ '0.8.18',
37
+ '0.8.20',
38
+ ];
39
+ exports.TRON_SOLC_VERSIONS = new Set(_TRON_SOLC_VERSIONS);
40
+ exports.LATEST_TRON_SOLC_VERSION = (() => [..._TRON_SOLC_VERSIONS].sort(semver_1.compare)[_TRON_SOLC_VERSIONS.length - 1])();
41
+ const tronSolcDir = () => path_1.default.join(os_1.default.homedir(), '.tron', 'solc');
42
+ exports.tronSolcDir = tronSolcDir;
43
+ const tronSolcPath = (version) => path_1.default.join((0, exports.tronSolcDir)(), `soljson_v${version}.js`);
44
+ exports.tronSolcPath = tronSolcPath;
45
+ const tronboxOutputSelection = {
46
+ '*': {
47
+ '': ['legacyAST', 'ast'],
48
+ '*': [
49
+ 'abi',
50
+ 'evm.bytecode.object',
51
+ 'evm.bytecode.sourceMap',
52
+ 'evm.bytecode.linkReferences',
53
+ 'evm.deployedBytecode.object',
54
+ 'evm.deployedBytecode.sourceMap',
55
+ ],
56
+ },
57
+ };
58
+ exports.tronboxSupportedOutputs = (() => {
59
+ const supportedOutputs = new Set();
60
+ for (const files of Object.values(tronboxOutputSelection)) {
61
+ for (const outputs of Object.values(files)) {
62
+ for (const output of outputs) {
63
+ const formattedOutput = output.split('.').slice(0, 2).join('.');
64
+ supportedOutputs.add(formattedOutput);
65
+ }
66
+ }
67
+ }
68
+ return supportedOutputs;
69
+ })();
70
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AAEvB,mCAAgC;AAEnB,QAAA,WAAW,GAAG,6BAA6B,CAAA;AACxD,MAAM,mBAAmB,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;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AAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBAC/D,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;aACxC;SACJ;KACJ;IACD,OAAO,gBAAgB,CAAA;AAC3B,CAAC,CAAC,EAAE,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { TronSolcVersion } from './constants';
2
+ export declare class TronSolcCompilerDownloader {
3
+ private readonly url;
4
+ private readonly _mutex;
5
+ readonly version: TronSolcVersion;
6
+ constructor(version: string);
7
+ private _download;
8
+ setExecBit(path: string): void;
9
+ private _logDownloadProgress;
10
+ getCompilerPath(): Promise<string>;
11
+ getVersions(solcJsPath: string): Promise<[string, string]>;
12
+ verifyCompiler(solcJsPath: string): Promise<[string, string]>;
13
+ }
14
+ //# sourceMappingURL=downloader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloader.d.ts","sourceRoot":"","sources":["../src/downloader.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAA6B,MAAM,aAAa,CAAA;AAmBxE,qBAAa,0BAA0B;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,SAAgB,OAAO,EAAE,eAAe,CAAA;gBAC5B,OAAO,EAAE,MAAM;YAqBb,SAAS;IAoCvB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAkB9B,OAAO,CAAC,oBAAoB;IAkCtB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAyBlC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAuB1D,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAQtE"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TronSolcCompilerDownloader = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const promises_1 = require("stream/promises");
9
+ const fs_extra_1 = require("fs-extra");
10
+ const wrapper_1 = __importDefault(require("solc/wrapper"));
11
+ const undici_1 = require("undici");
12
+ const constants_1 = require("./constants");
13
+ const utils_1 = require("./utils");
14
+ class TronSolcCompilerDownloader {
15
+ constructor(version) {
16
+ this._mutex = utils_1._mutex;
17
+ if (!(0, utils_1.validateTronSolcVersion)(version)) {
18
+ throw new utils_1.TronSolcPluginError(`unsupported tron solc version ${version}`);
19
+ }
20
+ this.version = version;
21
+ this.url = `https://tronsuper.github.io/tron-solc-bin/bin/soljson_v${version}.js`;
22
+ }
23
+ async _download() {
24
+ const dir = (0, constants_1.tronSolcDir)();
25
+ const soljsonPath = (0, constants_1.tronSolcPath)(this.version);
26
+ await (0, fs_extra_1.ensureDir)(path_1.default.join(dir));
27
+ console.log(soljsonPath, ' <- ', this.url);
28
+ const { statusCode, body } = await (0, undici_1.request)(this.url, {
29
+ method: 'GET',
30
+ headersTimeout: 10000,
31
+ maxRedirections: 10,
32
+ });
33
+ if (statusCode < 200 || statusCode >= 300 || !body) {
34
+ if (body)
35
+ await body.text();
36
+ throw new utils_1.TronSolcPluginError(`Could not download tron solc v${this.version}, code ${statusCode}`);
37
+ }
38
+ const clearLogger = this._logDownloadProgress(soljsonPath);
39
+ try {
40
+ await (0, promises_1.pipeline)(body, (0, fs_extra_1.createWriteStream)(soljsonPath));
41
+ }
42
+ catch (error) {
43
+ throw new utils_1.TronSolcPluginError(`could not download tron solc: ${error.message}`, error);
44
+ }
45
+ finally {
46
+ await clearLogger();
47
+ }
48
+ }
49
+ setExecBit(path) {
50
+ (0, fs_extra_1.chmodSync)(path, 0o755);
51
+ }
52
+ _logDownloadProgress(filePath, interval = 500) {
53
+ const start = Date.now();
54
+ const states = ['|', '/', '-', '\\'];
55
+ let currentState = 0;
56
+ let size = 0;
57
+ const sizeUpdateInterval = setInterval(async () => {
58
+ ;
59
+ ({ size } = (await (0, utils_1.fetchStats)(filePath)) ?? { size });
60
+ }, interval);
61
+ const animation = setInterval(() => {
62
+ (0, utils_1.clearAndPrint)(`Download in progress ${states[currentState]} ${(0, utils_1.bytesToKb)(size)} KB`);
63
+ currentState = (currentState + 1) % states.length;
64
+ }, 200);
65
+ return async () => {
66
+ clearInterval(sizeUpdateInterval);
67
+ clearInterval(animation);
68
+ ({ size } = (await (0, utils_1.fetchStats)(filePath)) ?? { size });
69
+ (0, utils_1.clearAndPrint)(`Downloaded compiler - ${(0, utils_1.bytesToKb)(size)} KB in ${Math.floor((Date.now() - start) / 1000)} secs\n`);
70
+ };
71
+ }
72
+ async getCompilerPath() {
73
+ const soljsonPath = (0, constants_1.tronSolcPath)(this.version);
74
+ return this._mutex.use(async () => {
75
+ if (!(0, fs_extra_1.existsSync)(soljsonPath)) {
76
+ console.info('Downloading tron solc compiler...');
77
+ const downloader = new TronSolcCompilerDownloader(this.version);
78
+ await downloader._download();
79
+ }
80
+ await this.verifyCompiler(soljsonPath);
81
+ return soljsonPath;
82
+ });
83
+ }
84
+ async getVersions(solcJsPath) {
85
+ try {
86
+ const { default: soljson } = await import(solcJsPath);
87
+ const solc = (0, wrapper_1.default)(soljson);
88
+ const longVersion = solc.version() ?? '';
89
+ const shortVersion = longVersion.match(/\d+\.\d+\.\d+/)?.toString() ?? '';
90
+ return [shortVersion, longVersion];
91
+ }
92
+ catch (error) {
93
+ return ['', ''];
94
+ }
95
+ }
96
+ async verifyCompiler(solcJsPath) {
97
+ const [shortVersion, longVersion] = await this.getVersions(solcJsPath);
98
+ if (shortVersion != this.version) {
99
+ if ((0, fs_extra_1.existsSync)(solcJsPath))
100
+ await (0, fs_extra_1.remove)(solcJsPath);
101
+ throw new utils_1.TronSolcPluginError(`deleting corrupted tron solc binary... please try again`);
102
+ }
103
+ return [shortVersion, longVersion];
104
+ }
105
+ }
106
+ exports.TronSolcCompilerDownloader = TronSolcCompilerDownloader;
107
+ //# sourceMappingURL=downloader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloader.js","sourceRoot":"","sources":["../src/downloader.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,8CAA0C;AAE1C,uCAAsF;AACtF,2DAAkC;AAClC,mCAAgC;AAEhC,2CAAwE;AACxE,mCAAoH;AAkBpH,MAAa,0BAA0B;IAInC,YAAY,OAAe;QAFV,WAAM,GAAG,cAAM,CAAA;QAG5B,IAAI,CAAC,IAAA,+BAAuB,EAAC,OAAO,CAAC,EAAE;YACnC,MAAM,IAAI,2BAAmB,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAA;SAC5E;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,0DAA0D,OAAO,KAAK,CAAA;IACrF,CAAC;IAeO,KAAK,CAAC,SAAS;QACnB,MAAM,GAAG,GAAG,IAAA,uBAAW,GAAE,CAAA;QACzB,MAAM,WAAW,GAAG,IAAA,wBAAY,EAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE9C,MAAM,IAAA,oBAAS,EAAC,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QAC/B,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QAC1C,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,gBAAO,EAAC,IAAI,CAAC,GAAG,EAAE;YACjD,MAAM,EAAE,KAAK;YACb,cAAc,EAAE,KAAK;YACrB,eAAe,EAAE,EAAE;SACtB,CAAC,CAAA;QACF,IAAI,UAAU,GAAG,GAAG,IAAI,UAAU,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;YAEhD,IAAI,IAAI;gBAA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