oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
35 stars 26 forks source link

sapphire-viem-v2: Brave browser default wallet selection unable to override `window.ethereum` #386

Open aefhm opened 1 week ago

aefhm commented 1 week ago
SUMMARY

Our Viem integration package has usability issue with selection of default Brave wallet.

ISSUE TYPE
STEPS TO REPRODUCE

Select Brave wallet as default Brave browser. Navigate to application using sapphire-viem-v2.

ACTUAL RESULTS
Uncaught TypeError: Cannot assign to read only property 'ethereum' of object '#<Window>'
    at o (inpage.js:1:31269)
    at r.initializeProvider (inpage.js:1:31747)
    at Object.<anonymous> (inpage.js:1:1116)
    at Object.<anonymous> (inpage.js:1:5585)
    at 1.../../shared/modules/provider-injection (inpage.js:1:5598)
    at i (inpage.js:1:254)
    at e (inpage.js:1:414)
    at inpage.js:1:431

Note this is similar to this old bug, but this Brave wallet issue explains that Brave does not want their window.ethereum provider to be overriden.

EXPECTED RESULTS

Brave user should not be blocked.

CedarMist commented 1 week ago

Where are we overriding window.ethereum ?