0.1.0 • Published 2 years ago
run_solidity v0.1.0
run_solidity
Runs the main()
function of all contracts in a Solidity file.
Installing
Install
run_solidity
:npm i -g run_solidity
Usage
Start the local Ganache network:
NODE_OPTIONS=--openssl-legacy-provider ganache-cli
Create a Solidity contract and save as
main.sol
:// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <=0.9.0; contract Example { event Hello(uint256 number); function main() public { for (uint i = 0; i < 10; ++i) { emit Hello(i); } buy(500); } }
Run it with
run_solidity main.sol
This will run the main()
function on each contract inside this .sol
file. It
will show all the events emitted, and the total gas used. That's all.
0.1.0
2 years ago