Error when deploying contract when MetaMask is not available
Opened this issue · 0 comments
filippsen commented
Environment/Browser
Superblocks 2.0
Description
Type error due to undefined object when trying to deploy contract on a browser which doesn't have Metamask installed.
Originally reported by @Spejbl: issue #401 (review)
Steps to reproduce
- Make sure MetaMask is not available or accessible
- Click Deploy
Expected result
No errors.
Actual result
Hints and possible solutions
We are probably using some functions from web3 which are not injected without Metamask.
the previous deployer version contained a runtime check-and-swap action that would choose between the internal web3 object and the externally provided one. Now, when the account is set to
external
(or'metamask'
?), the new deployer is probably assumingwindow.web3
is always valid.
./src/services/deployer/deployRunner.ts:37: this.currWeb3 = account.type === 'metamask' ? window.web3 : getWeb3(this.environment.endpoint);