-
Notifications
You must be signed in to change notification settings - Fork 10
Display contract Source Code and Contract Metadata fields #1890
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
Conversation
Deployed to Cloudflare Pages
|
Just came across this. You can use the new APIv2 to show the sources and a lot more. E.g. https://sourcify.dev/server/v2/contract/42262/0xF8393ab5D6c62D585E5647692E33532c8A5da6E7?fields=all |
Thanks for visiting! |
useEffect(() => { | ||
if (hash === `#${id}`) { | ||
if (element) { | ||
element.scrollIntoView({ | ||
block: 'start', | ||
}) | ||
} else { | ||
setTimeout(() => { | ||
if (divRef.current) { | ||
divRef.current.scrollIntoView({ | ||
block: 'start', | ||
}) | ||
} | ||
}) | ||
if (hash === `#${id}` && divRef.current) { | ||
const element = divRef.current | ||
const yOffset = isMobile ? -160 : -180 | ||
|
||
const scroll = () => { | ||
const y = element.getBoundingClientRect().top + window.scrollY + yOffset | ||
window.scrollTo({ top: y }) | ||
} | ||
setTimeout(scroll, 50) | ||
} | ||
}, [id, hash, element]) | ||
}, [id, hash, isMobile]) |
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.
Lets fix this in a separate pullrequest (+ I don't think this is the most reliable and maintainable approach)
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.
Created #1950
60331e5
to
7acccab
Compare
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.
Great! I'll rebase and combine the commits
7acccab
to
a207989
Compare
a207989
to
e370a3c
Compare
Add RawDataDisplay fields to display Source Code and Contract Metadata in 'Code' tab for verified contracts as displayed in Sourcify.
Fixes: #1881
Before:

After:




