This PR resolves the issue of 'Out of Gas' error, which appears when:
you are on the /contracts page
the deployed contracts that the frontend is trying to instantiate are on a different network from the currently connected wallet.
Solution:
used the .getCode() function from web3.js on the deployed contract address to check if it is a valid contract on the network that the user is currently connected to, then display the necessary error messages to alert the user if they do not match.
Types of changes
Please put an x in the boxes related to your change.
[x] Bugfix
[ ] New feature or Enhancement
[ ] Others
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
[ ] Lint and unit tests pass locally with my changes
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules
Related issues
This PR resolve issue #8 , as well as point 3 in issue #9.
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you proposed and what alternatives you have considered, etc.
Proposed changes
This PR resolves the issue of 'Out of Gas' error, which appears when:
Solution: used the .getCode() function from web3.js on the deployed contract address to check if it is a valid contract on the network that the user is currently connected to, then display the necessary error messages to alert the user if they do not match.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
Related issues
This PR resolve issue #8 , as well as point 3 in issue #9.
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you proposed and what alternatives you have considered, etc.