bepronetwork / bepro-js-edge

alpha repo for dev of webnetworks issues
2 stars 18 forks source link

Liquifier: A tool to parse Solidity.json contracts #264

Closed bepro-bot closed 3 years ago

bepro-bot commented 3 years ago

Bounty

72 Integrate Automated Javascript Class creation based on Solidity Class

Describe the solution Introduces a cli tool, liquifier, that parses the provided Abi object from the solidity json file, filters out the functions and creates the corresponding javascript class with dummy function body that calls __sendTx on the contract method, with the needed arguments. A basic documentation of the entry params is also created, as well as a interface file.

Preview image image

more can be seen by cloning https://github.com/moshmage/bepro-js/tree/feat/liquifier and issuing

$ npm install
$ node liquifier -h

ETH Wallet 0x0e6B6ae33f345E1CbAc096a2644f7748F347d218

bepro-bot commented 3 years ago

Created by Ruiub3i at 2021-06-09T09:31:15.000Z and updated at 2021-06-09T09:31:15.000Z

1) @moshmage Please add a package.json command to run this 2) Please let me know the expected result for functions already existent (does this overwrite? ) - as it shound´t overwrite 3) Any action that should take in consideration to change in our "how to developer a feature" in gitbook?

bepro-bot commented 3 years ago

Created by moshmage at 2021-06-09T14:57:29.000Z and updated at 2021-06-09T15:09:48.000Z

@Ruiub3i

Please let me know the expected result for functions already existent (does this overwrite? ) - as it shound´t overwrite

This tool has a --override flag that will override THE ENTIRE FILE if the output file exists, this flag is false by default and the program will output something like could not output to [output/file] because no override flag was provided

more options,

Options:
      --version        Show version number                             [boolean]
  -f, --file           File to parse                                  [required]
  -d, --dir            Output dir                                [default: "./"]
  -i, --interface-dir  Folder to create the interface file on
                                                  [default: "./src/interfaces/"]
  -o, --override       Override existing output file on -d
                                                      [boolean] [default: false]
  -s, --showoff        Dry run                        [boolean] [default: false]
  -S, --SHOWOFF        Dry run with show source at the end
                                                      [boolean] [default: false]
  -v, --verbose        Blablabla blabla, bla blaa!    [boolean] [default: false]
  -h, --help           Show help                                       [boolean]

Please add a package.json command to run this

Will do, but calling this from npm will look like this: npm run liquifier -- [flags] (pex: npm run liquifier -- -f path/to/file)


Any action that should take in consideration to change in our "how to developer a feature" in gitbook?

Replace step 2 and 3 for something along the lines of

2 - Liquefy your solidity contract by issuing npm run liquifier -- -f ./build/contracts/X.json -d ./src/models/ 3 - Edit the output of the file as needed

bepro-bot commented 3 years ago

Created by Ruiub3i at 2021-06-09T16:18:47.000Z and updated at 2021-06-09T16:18:47.000Z

Memo (Add to Gitbook how to)

2 - Liquefy your solidity contract by issuing npm run liquifier -- -f ./build/contracts/X.json -d ./src/models/ 3 - Edit the output of the file as needed

bepro-bot commented 3 years ago

Created by Ruiub3i at 2021-06-09T16:20:38.000Z and updated at 2021-06-09T16:20:38.000Z

Add this information into the README.md also @moshmage in a section about what is the liquifier and how you should use it.

After that we are good

Also please confirm the "npm run build" command doesn't run the liquifier automatically

bepro-bot commented 3 years ago

Created by Ruiub3i at 2021-06-09T16:28:06.000Z and updated at 2021-06-09T16:28:06.000Z

Also @moshmage can we add functionalities to the liquifier to do the steps 4,5 & 6 (unit tests setup) to speed up the skeleton of those files & imports

bepro-bot commented 3 years ago

Created by moshmage at 2021-06-10T13:11:39.000Z and updated at 2021-06-10T13:11:39.000Z

Also @moshmage can we add functionalities to the liquifier to do the steps 4,5 & 6 (unit tests setup) to speed up the skeleton of those files & imports

We can, but in a new issue as that goes outside of the scope of the bounty

Bounty

72 Integrate Automated Javascript Class creation based on Solidity Class

Not only that, but some structural refactor must happen and I'd like to have that discussed before starting that work

Add this information into the README.md also @moshmage in a section about what is the liquifier and how you should use it.

Will do

Also please confirm the "npm run build" command doesn't run the liquifier automatically

It doesn't, there's isn't even a connection from npm run build to npm run liquifier

bepro-bot commented 3 years ago

Created by Ruiub3i at 2021-06-26T16:55:24.000Z and updated at 2021-06-26T16:55:24.000Z

@moshmage just need to add this to our gitbook, but the rest is all ok