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

verify grant contribution transactions on the blockchain #5950

Closed
wants to merge 1 commit into from
Closed

verify grant contribution transactions on the blockchain #5950

wants to merge 1 commit into from

Conversation

evgeniuz
Copy link
Contributor

@evgeniuz evgeniuz commented Feb 5, 2020

Description

Added verification of grant contributions against blockchain.

Refers/Fixes

Fixes: #5762

@evgeniuz
Copy link
Contributor Author

evgeniuz commented Feb 5, 2020

CI job failed, because error log exceeded maximum length, but all those errors are related to JS, which I didn't touch. Not sure how to fix this.

@owocki
Copy link
Contributor

owocki commented Mar 19, 2020

should i pay this out @gitcoinco/engineers ? could be good to get in before round 5

return False, 'approval is not given to splitter'

if not same_address(split_call[1]['tokenAddress'], approve_tx['to']):
return False, 'splitter uses incorrect token'
Copy link
Contributor

Choose a reason for hiding this comment

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

what transactions did you use to test this against?

Copy link
Contributor Author

@evgeniuz evgeniuz Apr 1, 2020

Choose a reason for hiding this comment

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

Here's a successful one I've used for testing:

tx_id: https://etherscan.io/tx/0x45c9d0b6d29386d5996d58d6687bb27be13fb7488493cb6feb16db22920f1aba
split_tx_id: https://etherscan.io/tx/0x6fae97cc0e2810b3929ce53e95a0e1c4959362cce9818d8631934bcca83f96b7

Here's the one where all calls were made, but amount approved and actually sent is incorrect (this is trickiest case, because here everything looks correct, except actual amount of tokens).

tx_id: https://etherscan.io/tx/0xe83d42ed1d6305ac099adb61929af921fd8ea3ca61a6585c1c6a840d452bfe02
split_tx_id: https://etherscan.io/tx/0x0f4837fc443dea4ae50e511c2f79960675e99287d97891aa6ded06a539bf5fec

I've created contributions with these tx's using Django shell, then ran verify_contributions against them.

P. S. I've used some other ones, but these are the ones that are still in my testing database.

@owocki
Copy link
Contributor

owocki commented Apr 3, 2020 via email

@owocki owocki closed this Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants