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
feat: added sourcify with tests #879
feat: added sourcify with tests #879
Conversation
✔️ Preview deployment is ready! 🔨 Explore the source changes: 82fde4b 😎 Browse the preview: https://bafybeiarb35g6flwo6havr2jut6wmm5paqkn3u33osift4vgng2kevrsnu.ipfs.dweb.link |
✔️ Preview deployment is ready! 🔨 Explore the source changes: 5f8868c 😎 Browse the preview: https://bafybeib2ik6rjpbqc5nfex6huwmabe2eotwdownuelpfudlj4m37zcmzwq.ipfs.dweb.link |
}; | ||
}, [call, contracts, chainId]); | ||
|
||
return decodedCall || { decodedCall: null, contract: null }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing approval in the fallback object.
@@ -0,0 +1,10 @@ | |||
export const lookUpContractWithSourcify = async ({ chainId, address }) => { | |||
const baseUrl = `https://sourcify.dev/server/files/any`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we store this in env/configs/constants file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sourcify will be used to lookup contracts that we are not storing ourselves. Or am I missing something in your question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if we should pull this url from config file, or env. Nothing serious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, now I understand!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that It is missing is a test comparing a the abi and contact byecode hash from the richContractData with one from sourcify, I see you are only testing against a random contract/
Hm, I'm not certain why we would need to have that test? The |
@AugustoL I've tested some of our |
Approved, we see how we can add those tests for sourcify after then |
Description
Issue: #755
Adding a Sourcify API call to see if the contract chosen is verified or not. If it is chosen, we will decode the ABI and give the user an interface.
Difficult to test, but I added tests and tested it so it doesn't break any of the existing logic we use to show the contract interface.
Type of change
How Has This Been Tested?
Manually and with unit tests.
Checklist: