@gluwa/tron-contract-formatter
v0.0.1
Published
Tool to format a contract to then be deployed on Tron network
Downloads
2
Readme
Tron Contract Formatter
A Hardhat plugin that exports a task call format and takes a contract path and a output path. It flattens the contract and formats it to be deployed on the Tron network.
Installation
To install the Tron Contract Formatter, run the following command in your terminal:
How to install this package
1. Install this package
With NPM
npm install tron-contract-formatter --save-dev
Or with Yarn
yarn add tron-contract-formatter --save-dev
2. Import/Require this package in your hardhat.config.js/.ts
Inside inside hardhat.config.js
require("tron-contract-formatter");
or inside hardhat.config.ts (Typescript)
import 'tron-contract-formatter'
Other option
git clone https://github.com/marc-aurele-besner/tron-contract-formatter
cd tron-contract-formatter
npm install
npm run build
npm link
in the hardhat project, you want to use this plugin
npm link tron-contract-formatter
Tasks
npx hardhat format
Task: deploy-contract
Usage: hardhat [GLOBAL OPTIONS] format [--contract ] [--output ]
OPTIONS:
--contract The contract to format (default: "contracts/MyContract.sol") --output The output formatted contract (default: "Formatted.sol")
Functions
Function to format the contract
const { tronContractFormatter } = require('hardhat');
tronContractFormatter.format(
contract: string,
output: string
)