Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flattening and etherscan upload #253

Closed
montyly opened this issue May 20, 2019 · 16 comments
Closed

Flattening and etherscan upload #253

montyly opened this issue May 20, 2019 · 16 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@montyly
Copy link
Member

montyly commented May 20, 2019

Slither should be able to flatten any codebase and upload it to the etherscan verified contracts database, through their API

One caveat is to support aliasing of import

@montyly montyly added enhancement New feature or request good first issue Good for newcomers labels May 20, 2019
@montyly
Copy link
Member Author

montyly commented Jun 13, 2019

Task Description

The goal is to create a new utility (ex: slither-upload-etherscan) that will:

  • Takes as input a project and an address
  • Flatten the codebase
  • Upload the flatten code to etherscan verified contracts list

The utility guideline shows how to create new utility.

Acceptance criteria

  • Projects can be flattened and uploaded to etherscan
  • The utility removes unnecessary import and pragma statements when flattening the code

A nice to have feature is the handling of import aliasing.

Required Skill

  • Experience with Python 3.6
  • Experience with Solidity smart contracts

No experience with Slither is required, but it would be a plus

Feel free to ask questions here, or join our slack (#ethereum)

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 150.0 DAI (150.0 USD @ $1.0/DAI) attached to it.

@Skyge
Copy link

Skyge commented Jul 13, 2019

I am not sure, but for some have been verified contracts, they upload repeated pragma statements, such like this one: cDAI
so we want to remove these, Whether these have influence or not?

@montyly
Copy link
Member Author

montyly commented Jul 18, 2019

Hi @Skyge,

Thank you for your interest in this work.

It's a good question. After some thinking, maybe we can offer an option like --clean-code that will for now, remove the unnecessary pragma statements. In the long run, this option could do other modifications, like re-ordering the contracts to improve the readability, etc.

Does that make sense?

@Skyge
Copy link

Skyge commented Jul 18, 2019

OK, I see. That sounds good.

@spm32
Copy link

spm32 commented Aug 6, 2019

Hi @Skyge do you still have some time to take this one on, how's it going?

@Skyge
Copy link

Skyge commented Aug 8, 2019

@ceresstation Yeah, sorry for my delaying, I will finish this in three weeks.

@gitcoinbot
Copy link

@Skyge Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@Skyge
Copy link

Skyge commented Aug 14, 2019

Hi, I want to find a file to save etherscan api key by this approach:

import os
os.environ['ETHERSCAN_API] = xxx

so which one has existed is suitable, if not, I will create a new file, or we would like to use some packages, such as python-dotenv or something else to do this in the .env.

@montyly
Copy link
Member Author

montyly commented Aug 15, 2019

Hi @Skyge ,

That's a potential solution, but I would favor another approach:

  • Asking the key in an interactive mode, from the command line.
  • Having an option to provide the key through a config file. Most of the options in Slither are configurable through json, so it would make sense to keep this format.

I would favor the use of the interactive mode, to prevent the write of the key locally. Only people uploading frequently to etherscan should have to save the key.

@Skyge
Copy link

Skyge commented Aug 15, 2019

@montyly Emmm, but when we verify the contract by the etherscan api, we need some config message, such as, compilerversion , optimizationUsed, constructorArguements and so on, so if we use the interactive mode, the user really needs to type these necessary parameters, so I think maybe we can use a config file to add these config parameters. so what's your final recommendation?

@gitcoinbot
Copy link

@Skyge Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@Skyge
Copy link

Skyge commented Aug 19, 2019

I made a temporary pr, it has not been finished totally.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@Skyge due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@marcusrbrown
Copy link

Since this appears to be completd, would you mind closing out the bounty on Gitcoin?

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Cancelled


The funding of 150.0 DAI (150.0 USD @ $1.0/DAI) attached to this issue has been cancelled by the bounty submitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants