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

Support upload of multiple contracts #205

Closed
ligi opened this issue Jul 6, 2020 · 3 comments
Closed

Support upload of multiple contracts #205

ligi opened this issue Jul 6, 2020 · 3 comments
Milestone

Comments

@ligi
Copy link
Member

ligi commented Jul 6, 2020

as discussed in sourcifyeth/org#7

hijacked by @chriseth

Suggested UI:

VERIFIER

FILE UPLOAD

Files uploaded:

/my/source/code/Contract.sol
/my/other/file.sol
someMetadata.json
/some/file.zip/inside/the/zip/contract.sol
... (scroll list, scroll to newest uploaded files)

Found the following metadata files:

- /my/source/code/Contract.sol:MyContract1
   - source missing: /my/othe/source/Source.sol
   - please use the upload dialog above to add the file


- /my/source/code/Contract.sol:MyContract2
   - all files found, but could not determine address
   - Network: [ Mainnet ]
   - Address: [            ] [SUBMIT]

- /my/source/code/Contract.sol:MyContract4
   - all files found, but could not determine address
   - Network: [ Mainnet ]
   - Address: [            ] [SUBMIT]
   - Bytecode does not match

- /my/source/code/Contract.sol:MyContract3
   - all files found, address determined.
   - successfully verified at: <link>

  1. Initially, the user is presented just with a file upload element. Files can be added there incrementally, it is not possible to delete files. They will be stored in a session directory on the server which is deleted after X minutes of inactivity.
  2. After the files have been uploaded, they are shown in a scroll list (height: about 4 elements), which always shows the latest files (i.e. either scroll down or add at the top)
  3. After each file upload, the server processes the files and looks for metadata files. If no metadata file has been found, the user is asked to upload a metadata json file, maybe with a short explanation how to find it. At this point, there is enough screen space to just show this text (and all other error messages) below the list of files.
  4. For each metadata file found, a new UI element is added at the bottom, starting with the full name of the contract the metadata file is generated for. Below that, there are the following options:

4a) one or more source files are missing. List the missing files and tell the user how to upload them

4b) the address of the contract could not be determined automatically. Provide input fields to select the network and the address. A button will submit this and update the UI element.

4c) after the address has been manually selected, the verificaiton result is displayed. If there was no match, it is shown somehow and the UI elements to specify network and address are still present and functional

4d) If everything worked out, a link to the verified contract is displayed.

View in Huly HI-252

@chriseth
Copy link
Contributor

We just discussed how the UI for verifying multiple contracts at the same time could look like. I updated the main description. One thing we still have to consider is how to handle the situation when the same contract is present at multiple addresses. We should try to verify all of them. The user should also be able to enter multiple addresses after each other.

@edisinovcic
Copy link
Contributor

We can have a session id for a each verification session.
Flow should go:

  • users sends a request with files without session-id
  • backend checks if session-id exists, if not it generates new one (https://www.npmjs.com/package/uuid)
  • backend then extracts those files (if zip) or just stores them in /tmp/session-id
  • if a session-id was sent then add additional files to the /tmp/session-id, otherwise create new session-id

@kuzdogan
Copy link
Member

kuzdogan commented Apr 5, 2022

Closing with #708 🎉

@kuzdogan kuzdogan closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants