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

Start improving missing contribution page #8546

Merged

Conversation

mds1
Copy link
Contributor

@mds1 mds1 commented Mar 11, 2021

  • Frontend verifies that connected wallet address matches form inputs
  • Frontend asks for a signature and passes that data to backend
  • Backend verifies address recovered from signature matches user address

I think this should work, but before merging needs more testing first against a mainnet token list. The reason is because web3py does not let you recover addresses from PoA networks like Rinkeby and it throws with:

web3.exceptions.ValidationError: The field extraData is 97 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is: HexBytes('0xd883010918846765746888676f312e31352e35856c696e757800000000000000c4f6ccfbbfd37487321a523acfb0d11475512cb299470d2991199c781e5594e80349e828106f55eb2f2a7734b377050624ea517aba9f55178d9fcd1165d9f31000')

So to verify this works:

network = request.POST.get('network')
ingestion_types = [] # after each series of ingestion, we append the ingestion_method to this array

# Setup web3
PROVIDER = f"wss://{network}.infura.io/ws/v3/{settings.INFURA_V3_PROJECT_ID}"
w3 = Web3(Web3.WebsocketProvider(PROVIDER))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w3 = get_web3(network)

Copy link
Contributor Author

@mds1 mds1 Mar 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed commit 9847312 to update this if you want to retest > merge > deploy

@owocki
Copy link
Contributor

owocki commented Mar 11, 2021

just tested on my local, works gr8.

@owocki
Copy link
Contributor

owocki commented Mar 11, 2021

@thelostone-mc any comments on this one?

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

Successfully merging this pull request may close these issues.

3 participants