Skip to content

Commit

Permalink
optionally take contract address from window.location.search - fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinweb committed Feb 28, 2024
1 parent b2da269 commit c075951
Show file tree
Hide file tree
Showing 4 changed files with 5,165 additions and 5,162 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contract-storage-viewer",
"version": "0.1.0",
"version": "0.1.1",
"description": "Smart Contract Storage Hex Viewer",
"license": "GPLv3",
"author": {
Expand Down
7 changes: 5 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ class HexViewWithForm extends React.Component {
window.tools = {
Web3: Web3,
web3: this.state.web3,
customRpcClient: this.state.api
customRpcClient: this.state.api,
}
try {
this.state.target = window.location.search.match(/(\b0x[a-fA-F0-9]{40}\b)/g).pop()
} catch (e) {}

this.componentDidUpdate();
}

componentDidUpdate() {

if (!this.shouldUpdateView()) {
console.log("no update")
return;
Expand Down
Loading

0 comments on commit c075951

Please sign in to comment.