0.0.1 • Published 10 months ago

@gluwa/tron-contract-formatter v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

license npm version

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

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
    )