1.5.2 • Published 2 years ago

fuel-analyzer v1.5.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Fuel Analyzer

npm (tag)

A simple gas estimation module for your Truffle project.

Keep Updated

For the latest news, please follow the @MartikKing. Dm me if you get some bugs.

Installing

node.js

$.../temmartik/some_project> npm install --save fuel-analyzer

How to

Simply import fuel-analyzer into your Truffle project.

const fa = require('fuel-analyzer');

Then create an instance of the fuel-analyzer.

let estimation= new fa.FuelAnalyzer(web3, UniswapRouterInstance, 
        [
            "swapExactTokensForTokens",
            "swapExactTokensForETH"
        ],
        [
            [1000, 20, [USDT, UNI], user, time, {from: owner}],
            [2000, 40, [USDT, WETH], user, time, {from: owner}]
        ],
        [
            "1000 USDT has been swapped for UNI via swapExactTokensForTokens function",
            "2000 USDT has been swapped for ETH via swapExactTokensForETH function"
        ], false
    );
estimation.getReport();

Where:

-First param: a web3 instance.

-Second param: a contract instance.

-Third param: an array that includes one or more functions that have to be estimated.

-Fourth param: an array of arrays of params for each function.

-Fifth param: a decription for each estimated function (Optional).

-Sixth param: a flag that decides should the local node's state be reverted to the last snapshot after every test (True by default).

After estimation completed the state of your local node will be reverted to previous snapshot.

Report will be saved in gas_price.md file in your project directory.

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

3 years ago

1.3.93

3 years ago

1.3.92

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.71

3 years ago

1.3.72

3 years ago

1.3.91

3 years ago

1.3.61

3 years ago

1.3.81

3 years ago

1.3.86

3 years ago

1.3.64

3 years ago

1.3.87

3 years ago

1.3.65

3 years ago

1.3.9

3 years ago

1.3.62

3 years ago

1.3.85

3 years ago

1.3.8

3 years ago

1.3.63

3 years ago

1.3.68

3 years ago

1.3.69

3 years ago

1.3.66

3 years ago

1.3.89

3 years ago

1.3.67

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago