Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
deployments/
artifacts/
cache/
coverage/
node_modules/
package.json
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -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',
},
};
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Why are these changes needed?

<!-- Please give a short summary of the change and the problem this solves. -->

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
- [ ] I've made sure all auto checks have passed.
22 changes: 22 additions & 0 deletions .github/workflows/linux-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ubuntu test

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
build:
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
- name: build
run: |
pnpm install
pnpm run build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
pnpm-lock.yaml
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
18 changes: 16 additions & 2 deletions src/DeploymentsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -834,7 +835,20 @@ 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);
if(actualReceipt.contractAddress) {
actualReceipt.contractAddress = tronweb.address.fromHex(actualReceipt.contractAddress);
}
}
}
// from : https://stackoverflow.com/a/14810722/1663971
function objectMap(object: any, mapFn: (obj: any) => any) {
return Object.keys(object).reduce(function (result: any, key) {
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,8 +1105,9 @@ subtask(
hre,
runSuper
) => {
let nw = hre.hardhatArguments["network"]?hre.hardhatArguments["network"]:"localhost";
if (hre.config.networks[nw].tron) {
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);
}
return runSuper();
Expand Down
Loading