From cb9508ca7fb13a3531fabb3fd6eb93b3e3e39497 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 17:49:51 +0000 Subject: [PATCH 01/17] use tronSolc config to select compile --- src/index.ts | 3 +- src/tron/solc.ts | 175 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 175 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3f01781..72cc25f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1106,7 +1106,8 @@ subtask( runSuper ) => { let nw = hre.hardhatArguments["network"]?hre.hardhatArguments["network"]:"localhost"; - if (hre.config.networks[nw].tron) { + if (hre.config.networks[nw].tron && (hre.config as any)?.tronSolc?.enable) { + // are we using tron-solc compiler and is the network a Tron network return await loadTronSolc(args.solcVersion); } return runSuper(); diff --git a/src/tron/solc.ts b/src/tron/solc.ts index 240424c..3c570c4 100644 --- a/src/tron/solc.ts +++ b/src/tron/solc.ts @@ -36,20 +36,191 @@ export async function loadTronSolc(solcVersion: string) { let longVersion = ''; if (solcVersion == "0.8.23") { - compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.23/soljson.js' + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.23/soljson.js'; compilerPath = path.join( __dirname, "soljson-tv_0.8.23.js" ); longVersion = "0.8.23"; } else if (solcVersion == "0.8.22") { - compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.22/soljson.js' + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.22/soljson.js'; compilerPath = path.join( __dirname, "soljson-tv_0.8.22.js" ); longVersion = "0.8.22"; + } else if (solcVersion == "0.8.21") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.21/soljson.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.21.js" + ); + longVersion = "0.8.21"; + } else if (solcVersion == "0.8.20") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.20/soljson.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.20.js" + ); + longVersion = "0.8.20"; + } else if (solcVersion == "0.8.18") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.18/soljson.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.18.js" + ); + longVersion = "0.8.18"; + } else if (solcVersion == "0.8.11") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.11/solidity-js_0.8.11_Rousseau_v4.4.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.11.js" + ); + longVersion = "0.8.11"; + } else if (solcVersion == "0.8.7") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.7/solidity-js_0.8.7_Rousseau_v4.4.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.7.js" + ); + longVersion = "0.8.7"; + } else if (solcVersion == "0.8.6") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.6/solidity-js_0.8.6_Bacon_v4.3.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.6.js" + ); + longVersion = "0.8.6"; + } else if (solcVersion == "0.7.7") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.7.7/solidity-js_0.7.7_Bacon_v4.3.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.7.7.js" + ); + longVersion = "0.7.7"; + } else if (solcVersion == "0.6.13") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.6.13/solidity-js_0.6.13_Bacon_v4.3.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.6.13.js" + ); + longVersion = "0.6.13"; + } else if (solcVersion == "0.5.18") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.18/solidity-js_0.5.18_Bacon_v4.3.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.18.js" + ); + longVersion = "0.5.18"; + } else if (solcVersion == "0.8.0") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.8.0/solidity-js_0.8.0_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.8.0.js" + ); + longVersion = "0.8.0"; + } else if (solcVersion == "0.7.6") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.7.6/solidity-js_0.7.6_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.7.6.js" + ); + longVersion = "0.7.6"; + } else if (solcVersion == "0.7.0") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.7.0/solidity-js_0.7.0_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.7.0.js" + ); + longVersion = "0.7.0"; + } else if (solcVersion == "0.6.12") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.6.12/solidity-js_0.6.12_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.6.12.js" + ); + longVersion = "0.6.12"; + } else if (solcVersion == "0.6.8") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.6.8/solidity-js_0.6.8_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.6.8.js" + ); + longVersion = "0.6.8"; + } else if (solcVersion == "0.6.2") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.6.2/solidity-js_0.6.2_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.6.2.js" + ); + longVersion = "0.6.2"; + } else if (solcVersion == "0.5.17") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.17/solidity-js_0.5.17_Plato_v4.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.17.js" + ); + longVersion = "0.5.17"; + } else if (solcVersion == "0.5.16") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.16/solidity-js_0.5.16_GreatVoyage_v4.1.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.16.js" + ); + longVersion = "0.5.16"; + } else if (solcVersion == "0.6.0") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.6.0/solidity-js_0.6.0_GreatVoyage_v4.1.2.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.6.0.js" + ); + longVersion = "0.6.0"; + } else if (solcVersion == "0.5.15") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.15/solidity-js_0.5.15_GreatVoyage_v4.1.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.15.js" + ); + longVersion = "0.5.15"; + } else if (solcVersion == "0.5.14") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.14/solidity-js_0.5.14_GreatVoyage_v4.1.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.14.js" + ); + longVersion = "0.5.14"; + } else if (solcVersion == "0.5.12") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.12/solidity-js_0.5.12_GreatVoyage_v4.0.1.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.12.js" + ); + longVersion = "0.5.12"; + } else if (solcVersion == "0.5.8") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.8/soljson.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.8.js" + ); + longVersion = "0.5.8"; + } else if (solcVersion == "0.5.4") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/tv_0.5.4/tron-solidity-0.5.4_Odyssey_v3.6.0.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.5.4.js" + ); + longVersion = "0.5.4"; + } else if (solcVersion == "0.4.25") { + compilerRemotePath = 'https://github.com/tronprotocol/solidity/releases/download/0.4.25_Odyssey_v3.2.3/tron-solidity-0.4.25_Odyssey_v3.2.3.js'; + compilerPath = path.join( + __dirname, + "soljson-tv_0.4.25.js" + ); + longVersion = "0.4.25"; + } else { + throw new Error(`unkown solcVersion = ${solcVersion}`); } + let needDownload = !await checkFileExists(compilerPath); if (needDownload) { await downloadFile(compilerRemotePath, compilerPath); From 19a57312885da3260415832a68d875357bd24288 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 18:47:27 +0000 Subject: [PATCH 02/17] upgrade ethers version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 12511b2..a79f477 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.7.0", + "ethers": "^6.13.5", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", From dd0a4000721a6a0e8ef56c6480e22fc62efb63ab Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:03:02 +0000 Subject: [PATCH 03/17] fix lint error --- src/index.ts | 2 +- src/tron/solc.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 72cc25f..7fbe162 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1105,7 +1105,7 @@ subtask( hre, runSuper ) => { - let nw = hre.hardhatArguments["network"]?hre.hardhatArguments["network"]:"localhost"; + const nw = hre.hardhatArguments["network"]?hre.hardhatArguments["network"]:"localhost"; if (hre.config.networks[nw].tron && (hre.config as any)?.tronSolc?.enable) { // are we using tron-solc compiler and is the network a Tron network return await loadTronSolc(args.solcVersion); diff --git a/src/tron/solc.ts b/src/tron/solc.ts index 3c570c4..6ed2cc0 100644 --- a/src/tron/solc.ts +++ b/src/tron/solc.ts @@ -1,7 +1,7 @@ -const path = require("path"); -import { access, constants, promises as fsPromises } from 'fs'; +/* eslint-disable @typescript-eslint/no-explicit-any */ +import * as path from 'path'; +import { constants, promises as fsPromises } from 'fs'; import fetch from 'node-fetch'; -import { writeFile } from 'fs/promises'; import { createWriteStream } from 'fs'; import { pipeline } from 'stream'; import { promisify } from 'util'; @@ -221,7 +221,7 @@ export async function loadTronSolc(solcVersion: string) { throw new Error(`unkown solcVersion = ${solcVersion}`); } - let needDownload = !await checkFileExists(compilerPath); + const needDownload = !await checkFileExists(compilerPath); if (needDownload) { await downloadFile(compilerRemotePath, compilerPath); } From 292dee95299ca024aee5853de4d08e5486b99440 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:05:57 +0000 Subject: [PATCH 04/17] add workflow --- .eslintignore | 7 +++++++ .eslintrc.js | 22 ++++++++++++++++++++++ .github/workflows/linux-test.yml | 21 +++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .github/workflows/linux-test.yml diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..c14b634 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +dist/ +deployments/ +artifacts/ +cache/ +coverage/ +node_modules/ +package.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..086aadd --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features + sourceType: 'module', // Allows for the use of imports + }, + env: { + commonjs: true, + }, + plugins: ['@typescript-eslint'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + ], + rules: { + 'no-empty': 'off', + 'no-empty-function': 'off', + '@typescript-eslint/no-empty-function': 'off', + }, +}; diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml new file mode 100644 index 0000000..0867eff --- /dev/null +++ b/.github/workflows/linux-test.yml @@ -0,0 +1,21 @@ +name: ubuntu test + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Build and Test ubuntu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: build + run: | + pnpm install + pnpm run build + - name: test + run: | + pnpm run test From 2db133687d549dd96aac2641bc9bba316b5062f6 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:09:15 +0000 Subject: [PATCH 05/17] up --- .github/workflows/linux-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 0867eff..935857c 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -11,7 +11,7 @@ jobs: name: Build and Test ubuntu runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v4 - name: build run: | pnpm install From a3a31e81cf48a75f5f0aacd0b7f91ceebc4794b5 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:13:06 +0000 Subject: [PATCH 06/17] set pnpm version --- .github/workflows/linux-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 935857c..48a6365 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: pnpm/action-setup@v4 + with: + version: 10 - name: build run: | pnpm install From 3750e9f9574cd384249c8eccc69e6fb5ea9e92d6 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:18:11 +0000 Subject: [PATCH 07/17] rollback ethers --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a79f477..12511b2 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^6.13.5", + "ethers": "^5.7.0", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", From a1c175e3f5bdd57881fb092417f4aae8dbd31a59 Mon Sep 17 00:00:00 2001 From: "parson.chen" Date: Thu, 6 Mar 2025 19:20:16 +0000 Subject: [PATCH 08/17] rollback ethers --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 12511b2..ca235dd 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "chokidar": "^3.5.2", "debug": "^4.3.2", "enquirer": "^2.3.6", - "ethers": "^5.7.0", + "ethers": "^5.8.0", "form-data": "^4.0.0", "fs-extra": "^10.0.0", "match-all": "^1.2.6", From fb23ab391a5c4891402517a18823151189e2c0c7 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Tue, 11 Mar 2025 18:37:03 +0800 Subject: [PATCH 09/17] add issue template --- .github/ISSUE_TEMPLATE/bug_report.yml | 55 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.yml | 18 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 12 +++++ 4 files changed, 90 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..967fd70 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,55 @@ +name: Bug Report +description: Report a bug +type: "bug" + +body: + - type: textarea + attributes: + label: What happened? + description: Please provide as much information as possible, this helps us address the issue. + validations: + required: true + - type: textarea + attributes: + label: What did you expect to happen? + validations: + required: true + - type: textarea + attributes: + label: How can we reproduce it (as minimally and precisely as possible)? + description: Please provide steps to reproduce. Provide code that can be run if possible. + validations: + required: true + - type: input + attributes: + label: AutoGen version + description: What version or commit of the library was used + validations: + required: true + - type: dropdown + attributes: + label: Which package was this bug in + options: + - Core + - AgentChat + - Extensions + - AutoGen Studio + - Magentic One + - AutoGen Bench + - Other + validations: + required: true + - type: input + attributes: + label: Model used + description: If a model was used, please describe it here, indicating whether it is a local model or a cloud-hosted model + placeholder: gpt-4, mistral-7B etc + - type: input + attributes: + label: Python version + - type: input + attributes: + label: Operating system + - type: textarea + attributes: + label: Any additional info you think would be helpful for fixing this bug diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..76afcbc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Questions or general help 💬 + url: https://github.com/microsoft/autogen/discussions + about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..1b1de6f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,18 @@ +name: Feature Request +description: Request a new feature or enhancement +type: "feature" + +body: + - type: textarea + attributes: + label: What feature would you like to be added? + description: Please describe the desired feature. Be descriptive, provide examples and if possible, provide a proposed solution. + validations: + required: true + + - type: textarea + attributes: + label: Why is this needed? + description: Why is it important that this feature is implemented? What problem or need does it solve? + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..df41ac4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +## Why are these changes needed? + + + +## Related issue number + + + +## Checks + +- [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR. +- [ ] I've made sure all auto checks have passed. From 5bcc2d7057d5ddb41d877d36cc1c685741f5c8ec Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Tue, 18 Mar 2025 20:01:37 +0800 Subject: [PATCH 10/17] add gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4cbfff --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +dist +node_modules +pnpm-lock.yaml From dbbee6a1ffa160851f36309a49f8960899718233 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Wed, 19 Mar 2025 18:40:32 +0800 Subject: [PATCH 11/17] chage. hex to base58 on address in saveDeployment --- src/DeploymentsManager.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/DeploymentsManager.ts b/src/DeploymentsManager.ts index 2844d22..a522d2f 100644 --- a/src/DeploymentsManager.ts +++ b/src/DeploymentsManager.ts @@ -35,6 +35,7 @@ import {TransactionResponse} from '@ethersproject/providers'; import {Artifact, HardhatRuntimeEnvironment, Network} from 'hardhat/types'; import {store} from './globalStore'; import {bnReplacer} from './internal/utils'; +import TronWeb from 'tronweb'; export class DeploymentsManager { public deploymentsExtension: DeploymentsExtension; @@ -795,7 +796,7 @@ export class DeploymentsManager { `deployment name must not be a path or Fully Qualified Name - for such purposes consider using the "contract" field of deployment options` ); } - + const chainId = await this.getChainId(); const toSave = @@ -834,7 +835,17 @@ export class DeploymentsManager { byzantium: receipt.byzantium, } : undefined; - + if (this.isTronNetworkWithTronSolc) { + const tronweb = new TronWeb( + this.env.config.networks.localhost.url, + this.env.config.networks.localhost.url, + false, + false); + deployment.address = tronweb.address.fromHex(deployment.address); + if(actualReceipt){ + actualReceipt.from = tronweb.address.fromHex(actualReceipt.from); + } + } // from : https://stackoverflow.com/a/14810722/1663971 function objectMap(object: any, mapFn: (obj: any) => any) { return Object.keys(object).reduce(function (result: any, key) { From f072d2c2597230b8d4080999404ab3e80aeaafac Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Wed, 19 Mar 2025 19:38:14 +0800 Subject: [PATCH 12/17] chage tags --- src/DeploymentsManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DeploymentsManager.ts b/src/DeploymentsManager.ts index a522d2f..b9e312e 100644 --- a/src/DeploymentsManager.ts +++ b/src/DeploymentsManager.ts @@ -17,7 +17,7 @@ import path from 'path'; import {BigNumber} from '@ethersproject/bignumber'; import debug from 'debug'; -const log = debug('hardhat:wighawag:hardhat-deploy'); +const log = debug('hardhat:sun-protocol:tron-studio'); import { addDeployments, @@ -796,7 +796,7 @@ export class DeploymentsManager { `deployment name must not be a path or Fully Qualified Name - for such purposes consider using the "contract" field of deployment options` ); } - + const chainId = await this.getChainId(); const toSave = From 6f90b4b6df02b6fe27d959ad0a8ee0a6ad53cede Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Wed, 19 Mar 2025 20:32:42 +0800 Subject: [PATCH 13/17] change hex to base58 on contract address in saveDeployment --- src/DeploymentsManager.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DeploymentsManager.ts b/src/DeploymentsManager.ts index b9e312e..cebd665 100644 --- a/src/DeploymentsManager.ts +++ b/src/DeploymentsManager.ts @@ -844,6 +844,9 @@ export class DeploymentsManager { deployment.address = tronweb.address.fromHex(deployment.address); if(actualReceipt){ actualReceipt.from = tronweb.address.fromHex(actualReceipt.from); + if(actualReceipt.contractAddress) { + actualReceipt.contractAddress = tronweb.address.fromHex(actualReceipt.contractAddress); + } } } // from : https://stackoverflow.com/a/14810722/1663971 From 8c0dca81222ea6554ead77f58dbffd8d521ea5fc Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Thu, 20 Mar 2025 16:18:17 +0800 Subject: [PATCH 14/17] publish 0.0.6 version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ca235dd..a359d4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@sun-protocol/tron-studio", - "version": "0.0.5", - "description": "Hardhat Plugin For Replicable Deployments And Tests", + "version": "0.0.6", + "description": "Environment configuration and partial optimization", "repository": "https://github.com/sun-protocol/TronStudio", "author": "dev", "license": "MIT", From 4f9b5d6f88afb01585cb85c72a6aed2ea38f4d22 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Fri, 21 Mar 2025 11:45:01 +0800 Subject: [PATCH 15/17] add useage in README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 7ac8c73..3aa7025 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ # TronStudio TRON Smart Contract Code Develep + +# Build + +Install dependencies + +``` +npm install +``` + +Build + +``` +npm run build +``` +# Useage + +see https://github.com/sun-protocol/tron-studio-demo \ No newline at end of file From d8812d397fd9a8ca9e520a4f07d6054b187a91af Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Fri, 21 Mar 2025 11:58:08 +0800 Subject: [PATCH 16/17] CI fix --- .github/workflows/linux-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 48a6365..d6721e0 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -11,6 +11,8 @@ jobs: name: Build and Test ubuntu runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 - uses: pnpm/action-setup@v4 with: version: 10 From f007bd5dc1814a0d67893c4c31ad2549c6d7adf1 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Fri, 21 Mar 2025 12:22:57 +0800 Subject: [PATCH 17/17] fix CI --- .github/workflows/linux-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index d6721e0..64c37fc 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -20,6 +20,3 @@ jobs: run: | pnpm install pnpm run build - - name: test - run: | - pnpm run test