feat: detect diamond proxy contract and display it in diamond proxy tab#365
feat: detect diamond proxy contract and display it in diamond proxy tab#365tx-nikola wants to merge 7 commits into
Conversation
API E2E Test Results207 tests 207 ✅ 19s ⏱️ Results for commit be4e596. ♻️ This comment has been updated with latest results. |
Unit Test Results 4 files 264 suites 11m 59s ⏱️ Results for commit be4e596. ♻️ This comment has been updated with latest results. |
|
Visit the preview URL for this PR: |
| const isVerified = !!props.contract?.verificationInfo; | ||
| const isProxy = !!props.contract?.proxyInfo; | ||
| const isDiamondProxy = !!props.contract?.diamondProxyInfo; | ||
| if (isVerified || isProxy) { |
There was a problem hiding this comment.
isDiamondProxy has to be added to the if condition. Otherwise the line added below is unreachable.
| @@ -270,23 +278,5 @@ const tabs = computed(() => { | |||
| <style lang="scss" scoped> | |||
| .functions-contract-container { | |||
| @apply mt-4; | |||
There was a problem hiding this comment.
Why have the styles below been moved? Existing tabs are broken (most probably because of this change):
Current version on prod

|
|
||
| const { t } = useI18n(); | ||
|
|
||
| const writeProxyFunctions = computed(() => { |
There was a problem hiding this comment.
Why does Diamond Proxy tab support only write functions?
|
|
||
| const eip2535Diamond = await provider.getStorage(address, EIP2535_DIAMOND_IMPLEMENTATION_SLOT); | ||
|
|
||
| if (eip2535Diamond) { |
There was a problem hiding this comment.
This condition seems to always be true, as it returns 0x0000000000000000000000000000000000000000000000000000000000000000 even for a random slot. I think the check for the slot can be omitted, AFAIU the Diamond Proxy spec doesn't define a particular storage slot, so it can differ. Considering this, checking for facetAddresses is probably enough.
|
Nit: It would be very helpful if, in such a PR, you provide a contract address on the testnet that you tested this functionality on. Otherwise, it takes some time to deploy everything before checking the PR. |

What ❔
Creade additional tab called "Diamond Proxy" in the Contract view, and show all write functions of the DiamondProxy contract.
Why ❔
Add additional functionality to the contract
Checklist
This PR fixes #328