From dcad5b79df5b41aa8ba84fd4889ff17d3797b25d Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 21 Feb 2023 10:53:56 +0100 Subject: [PATCH 01/16] Ignore DELEGATECALL in EVM call trace Geth v1.11 changed the tracer and are now returning the delegated value. See https://github.com/ethereum/go-ethereum/issues/26726 --- bchain/coins/eth/ethrpc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index c4210fb9..61173b05 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -620,6 +620,9 @@ func (b *EthereumRPC) processCallTrace(call *rpcCallTrace, d *bchain.EthereumInt To: call.To, }) contracts = append(contracts, bchain.ContractInfo{Contract: call.From, DestructedInBlock: blockHeight}) + } else if call.Type == "DELEGATECALL" { + // ignore DELEGATECALL (geth v1.11 the changed tracer behavior) + // https://github.com/ethereum/go-ethereum/issues/26726 } else if err == nil && (value.BitLen() > 0 || b.ChainConfig.ProcessZeroInternalTransactions) { d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{ Value: *value, From a80ea655fa0f8fbe981d9f1475197026ccf8753f Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 20 Feb 2023 15:02:50 +0000 Subject: [PATCH 02/16] =?UTF-8?q?zec=20(+testnet)=205.3.2=20=E2=86=92=205.?= =?UTF-8?q?4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/zcash.json | 6 +++--- configs/coins/zcash_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/zcash.json b/configs/coins/zcash.json index 21ad17b2..b080239f 100644 --- a/configs/coins/zcash.json +++ b/configs/coins/zcash.json @@ -22,10 +22,10 @@ "package_name": "backend-zcash", "package_revision": "satoshilabs-1", "system_user": "zcash", - "version": "5.3.2", - "binary_url": "https://z.cash/downloads/zcash-5.3.2-linux64-debian-bullseye.tar.gz", + "version": "5.4.1", + "binary_url": "https://z.cash/downloads/zcash-5.4.1-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "20b0aa39b72826fe5c2d967151ce8cccbd11c1cf1b6c2adf8ddad0c596e241fc", + "verification_source": "237e35ae9c6751f66dfd0d0d93f2844664609cc32580077d5f055c8497568313", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/zcash_testnet.json b/configs/coins/zcash_testnet.json index 1a924e7b..9fd36501 100644 --- a/configs/coins/zcash_testnet.json +++ b/configs/coins/zcash_testnet.json @@ -21,10 +21,10 @@ "backend": { "package_name": "backend-zcash-testnet", "package_revision": "satoshilabs-1", - "version": "5.3.2", - "binary_url": "https://z.cash/downloads/zcash-5.3.2-linux64-debian-bullseye.tar.gz", + "version": "5.4.1", + "binary_url": "https://z.cash/downloads/zcash-5.4.1-linux64-debian-bullseye.tar.gz", "verification_type": "sha256", - "verification_source": "20b0aa39b72826fe5c2d967151ce8cccbd11c1cf1b6c2adf8ddad0c596e241fc", + "verification_source": "237e35ae9c6751f66dfd0d0d93f2844664609cc32580077d5f055c8497568313", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/zcashd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", From 7dac974ba227b8b35d5bab25fbf9742d0ab02ec3 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Wed, 22 Feb 2023 10:58:51 +0100 Subject: [PATCH 03/16] Fix visual overflow in display of block in explorer --- server/public_test.go | 6 +++--- static/templates/block.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/public_test.go b/server/public_test.go index c1892060..4189d8c6 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -314,7 +314,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -334,7 +334,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -343,7 +343,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { diff --git a/static/templates/block.html b/static/templates/block.html index 600175b9..fe9b7d2b 100644 --- a/static/templates/block.html +++ b/static/templates/block.html @@ -50,7 +50,7 @@
{{$b.Nonce}} + {{$b.Nonce}} Bits From 211aeff22d6f9ce59b26895883aa85905bba566b Mon Sep 17 00:00:00 2001 From: JoHnY Date: Mon, 27 Feb 2023 10:03:44 +0000 Subject: [PATCH 04/16] =?UTF-8?q?eth=20(+testnets)=201.11.1=20=E2=86=92=20?= =?UTF-8?q?1.11.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/coins/ethereum.json | 6 +++--- configs/coins/ethereum_archive.json | 6 +++--- configs/coins/ethereum_testnet_goerli.json | 6 +++--- configs/coins/ethereum_testnet_goerli_archive.json | 6 +++--- configs/coins/ethereum_testnet_sepolia.json | 6 +++--- configs/coins/ethereum_testnet_sepolia_archive.json | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configs/coins/ethereum.json b/configs/coins/ethereum.json index dfa21244..e3258765 100644 --- a/configs/coins/ethereum.json +++ b/configs/coins/ethereum.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --syncmode full --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_archive.json b/configs/coins/ethereum_archive.json index abfd86b0..4ba2ac43 100644 --- a/configs/coins/ethereum_archive.json +++ b/configs/coins/ethereum_archive.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --syncmode full --gcmode archive --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} --http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_testnet_goerli.json b/configs/coins/ethereum_testnet_goerli.json index fdc96a9c..b4bc2a5f 100644 --- a/configs/coins/ethereum_testnet_goerli.json +++ b/configs/coins/ethereum_testnet_goerli.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-goerli", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --goerli --syncmode full --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} -http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_testnet_goerli_archive.json b/configs/coins/ethereum_testnet_goerli_archive.json index f56216f3..b444b335 100644 --- a/configs/coins/ethereum_testnet_goerli_archive.json +++ b/configs/coins/ethereum_testnet_goerli_archive.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-goerli-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --goerli --syncmode full --gcmode archive --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} -http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_testnet_sepolia.json b/configs/coins/ethereum_testnet_sepolia.json index 06d3ee7b..268fac2e 100644 --- a/configs/coins/ethereum_testnet_sepolia.json +++ b/configs/coins/ethereum_testnet_sepolia.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-sepolia", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --sepolia --syncmode full --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} -http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", diff --git a/configs/coins/ethereum_testnet_sepolia_archive.json b/configs/coins/ethereum_testnet_sepolia_archive.json index 62015207..8eb272bf 100644 --- a/configs/coins/ethereum_testnet_sepolia_archive.json +++ b/configs/coins/ethereum_testnet_sepolia_archive.json @@ -22,10 +22,10 @@ "package_name": "backend-ethereum-testnet-sepolia-archive", "package_revision": "satoshilabs-1", "system_user": "ethereum", - "version": "1.11.1-76961066", - "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz", + "version": "1.11.2-73b01f40", + "binary_url": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz", "verification_type": "gpg", - "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.1-76961066.tar.gz.asc", + "verification_source": "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.2-73b01f40.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [], "exec_command_template": "/bin/sh -c '{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/geth --sepolia --syncmode full --gcmode archive --txlookuplimit 0 --ipcdisable --cache 1024 --nat none --datadir {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend --port {{.Ports.BackendP2P}} --ws --ws.addr 127.0.0.1 --ws.port {{.Ports.BackendRPC}} --ws.origins \"*\" --ws.api \"eth,net,web3,debug,txpool\" --http --http.port {{.Ports.BackendHttp}} -http.addr 127.0.0.1 --http.corsdomain \"*\" --http.vhosts \"*\" --http.api \"eth,net,web3,debug,txpool\" --authrpc.port {{.Ports.BackendAuthRpc}} 2>>{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/{{.Coin.Alias}}.log'", From 0f23f10fe0d70534d669bef639ed06cc08284e8b Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Fri, 24 Feb 2023 01:05:14 +0100 Subject: [PATCH 05/16] Handle raw display of huge transactions in explorer --- server/public.go | 2 +- server/public_ethereumtype_test.go | 8 ++--- server/public_test.go | 32 +++++++++---------- static/css/{main.min.1.css => main.min.2.css} | 0 static/js/main.js | 3 ++ static/js/main.min.1.js | 1 - static/js/main.min.2.js | 1 + 7 files changed, 25 insertions(+), 22 deletions(-) rename static/css/{main.min.1.css => main.min.2.css} (100%) delete mode 100644 static/js/main.min.1.js create mode 100644 static/js/main.min.2.js diff --git a/server/public.go b/server/public.go index 4b561959..cd57179c 100644 --- a/server/public.go +++ b/server/public.go @@ -344,7 +344,7 @@ func (s *PublicServer) newTemplateData(r *http.Request) *TemplateData { TOSLink: api.Text.TOSLink, } if !s.debug { - t.Minified = ".min.1" + t.Minified = ".min.2" } if s.is.HasFiatRates { // get the secondary coin and if it should be shown either from query parameters "secondary" and "use_secondary" diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index efca8c13..9094ca17 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -24,7 +24,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE

Confirmed
Balance0.000000000123450123 FAKE
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S131
Contract 740.001000123074 S741
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
`, + `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE

Confirmed
Balance0.000000000123450123 FAKE
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S131
Contract 740.001000123074 S741
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
`, }, }, { @@ -33,7 +33,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE

Confirmed
Balance0.000000000123450093 FAKE
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, + `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE

Confirmed
Balance0.000000000123450093 FAKE
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, }, }, { @@ -42,14 +42,14 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE (40 Gwei)
Fees0.002081 FAKE
RBFON
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE (40 Gwei)
Fees0.002081 FAKE
RBFON
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, }, }, { name: "explorerTokenDetail " + dbtestdata.EthAddr7b, r: newGetRequest(ts.URL + "/nft/" + dbtestdata.EthAddrContractCd + "/" + "1"), status: http.StatusOK, contentType: "text/html; charset=utf-8", - body: []string{`Trezor Fake Coin Explorer

NFT Token Detail

Token ID1
Contract0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9
Contract 205
Contract typeERC20
`}, + body: []string{`Trezor Fake Coin Explorer

NFT Token Detail

Token ID1
Contract0xcdA9FC258358EcaA88845f19Af595e908bb7EfE9
Contract 205
Contract typeERC20
`}, }, { name: "apiIndex", diff --git a/server/public_test.go b/server/public_test.go index 4189d8c6..7957f5d5 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -269,7 +269,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, }, }, { @@ -278,7 +278,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.0002469 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, + `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.0002469 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, }, }, { @@ -287,7 +287,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input3172.83951062 FAKE
Total Output3172.83951 FAKE
Fees0.00000062 FAKE
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

3d90d15ed026dc45e19ffb52875ed18fa9e8012ad123d7f7212176e2b0ebdb71
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input3172.83951062 FAKE
Total Output3172.83951 FAKE
Fees0.00000062 FAKE
Raw Transaction
`, }, }, { @@ -296,7 +296,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Error

Transaction not found

`, + `Trezor Fake Coin Explorer

Error

Transaction not found

`, }, }, { @@ -305,7 +305,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Blocks

HeightHashTimestampTransactionsSize
22549400000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b61639 days 11 hours ago42345678
2254930000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e29971640 days 9 hours ago21234567
`, + `Trezor Fake Coin Explorer

Blocks

HeightHashTimestampTransactionsSize
22549400000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b61639 days 11 hours ago42345678
2254930000000076fbbed90fd75b0e18856aa35baa984e9c9d444cf746ad85e94e29971640 days 9 hours ago21234567
`, }, }, { @@ -314,7 +314,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -323,7 +323,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Application status

Synchronization with backend is disabled, the state of index is not up to date.

OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6

Blockbook

CoinFakecoin
Host
Version / Commit / Buildunknown / unknown / unknown
Synchronized
true
Last Block225494
Last Block Update`, + `Trezor Fake Coin Explorer

Application status

Synchronization with backend is disabled, the state of index is not up to date.

`, `

Blockbook

CoinFakecoin
Host
Version / Commit / Buildunknown / unknown / unknown
Synchronized
true
Last Block225494
Last Block Update`, `
Mempool in Sync
false
Last Mempool Update
Transactions in Mempool0
Size On Disk

Backend

Chainfakecoin
Version001001
Subversion/Fakecoin:0.0.1/
Last Block2
Difficulty
Blockbook - blockchain indexer for Trezor Suite https://trezor.io/trezor-suite. Do not use for any other purpose.
`, }, @@ -334,7 +334,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -343,7 +343,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Trezor Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -352,7 +352,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

fdd824a780cbb718eeb766eb05d83fdefc793a27082cd5e67f856d69798cf7db
Mined Time1639 days 11 hours ago
In Block00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
In Block Height225494
Total Input0 FAKE
Total Output13.60030331 FAKE
Fees0 FAKE
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
Raw Transaction
`, }, }, { @@ -361,7 +361,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.0002469 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, + `Trezor Fake Coin Explorer

Address

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz

0.00012345 FAKE

Confirmed
Total Received0.0002469 FAKE
Total Sent0.00012345 FAKE
Final Balance0.00012345 FAKE
No. Transactions2

Transactions

mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs
 
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE
mtGXQvBowMkBpnhLckhxhbwYK44Gs9eEtz0.00012345 FAKE×
`, }, }, { @@ -370,7 +370,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

XPUB

upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q

1186.419755 FAKE

Confirmed
Total Received1186.41975501 FAKE
Total Sent0.00000001 FAKE
Final Balance1186.419755 FAKE
No. Transactions2
Used XPUB Addresses2
XPUB Addresses with Balance
AddressBalanceTxsPath
2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu1186.419755 FAKE1m/49'/1'/33'/1/3

Transactions

`, + `Trezor Fake Coin Explorer

XPUB

upub5E1xjDmZ7Hhej6LPpS8duATdKXnRYui7bDYj6ehfFGzWDZtmCmQkZhc3Zb7kgRLtHWd16QFxyP86JKL3ShZEBFX88aciJ3xyocuyhZZ8g6q

1186.419755 FAKE

Confirmed
Total Received1186.41975501 FAKE
Total Sent0.00000001 FAKE
Final Balance1186.419755 FAKE
No. Transactions2
Used XPUB Addresses2
XPUB Addresses with Balance
AddressBalanceTxsPath
2N6utyMZfPNUb1Bk8oz7p2JqJrXkq83gegu1186.419755 FAKE1m/49'/1'/33'/1/3

Transactions

`, }, }, { @@ -379,7 +379,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

XPUB

tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej

0 FAKE

Confirmed
Total Received0 FAKE
Total Sent0 FAKE
Final Balance0 FAKE
No. Transactions0
Used XPUB Addresses0
XPUB Addresses with Balance
No addresses
`, + `Trezor Fake Coin Explorer

XPUB

tr([5c9e228d/86'/1'/0']tpubDC88gkaZi5HvJGxGDNLADkvtdpni3mLmx6vr2KnXmWMG8zfkBRggsxHVBkUpgcwPe2KKpkyvTJCdXHb1UHEWE64vczyyPQfHr1skBcsRedN/{0,1}/*)#4rqwxvej

0 FAKE

Confirmed
Total Received0 FAKE
Total Sent0 FAKE
Final Balance0 FAKE
No. Transactions0
Used XPUB Addresses0
XPUB Addresses with Balance
No addresses
`, }, }, { @@ -388,7 +388,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Error

No matching records found for '1234'

`, + `Trezor Fake Coin Explorer

Error

No matching records found for '1234'

`, }, }, { @@ -397,7 +397,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Send Raw Transaction

`, + `Trezor Fake Coin Explorer

Send Raw Transaction

`, }, }, { @@ -406,7 +406,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Send Raw Transaction

Invalid data
`, + `Trezor Fake Coin Explorer

Send Raw Transaction

Invalid data
`, }, }, { diff --git a/static/css/main.min.1.css b/static/css/main.min.2.css similarity index 100% rename from static/css/main.min.1.css rename to static/css/main.min.2.css diff --git a/static/js/main.js b/static/js/main.js index 3b8eb37e..3efffd47 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -4,6 +4,9 @@ function syntaxHighlight(json) { .replace(/&/g, "&") .replace(//g, ">"); + if (json.length > 1000000) { + return `${json}`; + } return json.replace( /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, (match) => { diff --git a/static/js/main.min.1.js b/static/js/main.min.1.js deleted file mode 100644 index ed2ffb6f..00000000 --- a/static/js/main.min.1.js +++ /dev/null @@ -1 +0,0 @@ -function syntaxHighlight(t){return(t=(t=JSON.stringify(t,void 0,2)).replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),`${t}`})}function getCoinCookie(){return document.cookie.split("; ").find(t=>t.startsWith("secondary_coin="))?.split("=")}function changeCSSStyle(t,e,l){let a=document.all?"rules":"cssRules";for(i=0,len=document.styleSheets[1][a].length;i`;if(a){let n=a.getAttribute("tm");n||(n="now"),s+=`${n}${a.outerHTML}
`}if(r&&(s+=`now${r.outerHTML}
`),e){let o=e.getAttribute("tm");o||(o="now"),s+=`${o}${e.outerHTML}
`}return l&&(s+=`now${l.outerHTML}
`),`${s}`}function addressAliasTooltip(){let t=this.getAttribute("alias-type"),e=this.getAttribute("cc");return`${t}
${e}
`}window.addEventListener("DOMContentLoaded",()=>{let t=getCoinCookie();t?.length===3&&("true"===t[2]&&(changeCSSStyle(".prim-amt","display","none"),changeCSSStyle(".sec-amt","display","initial")),document.querySelectorAll(".amt").forEach(t=>new bootstrap.Tooltip(t,{title:amountTooltip,html:!0}))),document.querySelectorAll("[alias-type]").forEach(t=>new bootstrap.Tooltip(t,{title:addressAliasTooltip,html:!0})),document.querySelectorAll("[tt]").forEach(t=>new bootstrap.Tooltip(t,{title:t.getAttribute("tt")})),document.querySelectorAll("#header .bb-group>.btn-check").forEach(t=>t.addEventListener("click",t=>{let e=getCoinCookie(),l="secondary-coin"===t.target.id;e?.length===3&&"true"===e[2]!==l&&(document.cookie=`${e[0]}=${e[1]}=${l}; Path=/`,changeCSSStyle(".prim-amt","display",l?"none":"initial"),changeCSSStyle(".sec-amt","display",l?"initial":"none"))})),document.querySelectorAll(".copyable").forEach(t=>t.addEventListener("click",t=>{if(t.clientXt.target.className=t.target.className.replace("copied","copyable"),1e3),t.preventDefault()}}))}); \ No newline at end of file diff --git a/static/js/main.min.2.js b/static/js/main.min.2.js new file mode 100644 index 00000000..271d4598 --- /dev/null +++ b/static/js/main.min.2.js @@ -0,0 +1 @@ +function syntaxHighlight(t){return(t=(t=JSON.stringify(t,void 0,2)).replace(/&/g,"&").replace(//g,">")).length>1e6?`${t}`:t.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,t=>{let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),`${t}`})}function getCoinCookie(){return document.cookie.split("; ").find(t=>t.startsWith("secondary_coin="))?.split("=")}function changeCSSStyle(t,e,l){let a=document.all?"rules":"cssRules";for(i=0,len=document.styleSheets[1][a].length;i`;if(a){let n=a.getAttribute("tm");n||(n="now"),r+=`${n}${a.outerHTML}
`}if(s&&(r+=`now${s.outerHTML}
`),e){let o=e.getAttribute("tm");o||(o="now"),r+=`${o}${e.outerHTML}
`}return l&&(r+=`now${l.outerHTML}
`),`${r}`}function addressAliasTooltip(){let t=this.getAttribute("alias-type"),e=this.getAttribute("cc");return`${t}
${e}
`}window.addEventListener("DOMContentLoaded",()=>{let t=getCoinCookie();t?.length===3&&("true"===t[2]&&(changeCSSStyle(".prim-amt","display","none"),changeCSSStyle(".sec-amt","display","initial")),document.querySelectorAll(".amt").forEach(t=>new bootstrap.Tooltip(t,{title:amountTooltip,html:!0}))),document.querySelectorAll("[alias-type]").forEach(t=>new bootstrap.Tooltip(t,{title:addressAliasTooltip,html:!0})),document.querySelectorAll("[tt]").forEach(t=>new bootstrap.Tooltip(t,{title:t.getAttribute("tt")})),document.querySelectorAll("#header .bb-group>.btn-check").forEach(t=>t.addEventListener("click",t=>{let e=getCoinCookie(),l="secondary-coin"===t.target.id;e?.length===3&&"true"===e[2]!==l&&(document.cookie=`${e[0]}=${e[1]}=${l}; Path=/`,changeCSSStyle(".prim-amt","display",l?"none":"initial"),changeCSSStyle(".sec-amt","display",l?"initial":"none"))})),document.querySelectorAll(".copyable").forEach(t=>t.addEventListener("click",t=>{if(t.clientXt.target.className=t.target.className.replace("copied","copyable"),1e3),t.preventDefault()}}))}); \ No newline at end of file From fed5fb3dac3e83d62fab57dcbfa67bf4b2276e37 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Mon, 27 Feb 2023 19:50:05 +0100 Subject: [PATCH 06/16] Store new contract info including the type of contract --- api/worker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/worker.go b/api/worker.go index 3024a5e3..c07d9f8a 100644 --- a/api/worker.go +++ b/api/worker.go @@ -609,6 +609,9 @@ func (w *Worker) getContractDescriptorInfo(cd bchain.AddressDescriptor, typeFrom validContract = false } else { + if typeFromContext != bchain.UnknownTokenType && contractInfo.Type == bchain.UnknownTokenType { + contractInfo.Type = typeFromContext + } if err = w.db.StoreContractInfo(contractInfo); err != nil { glog.Errorf("StoreContractInfo error %v, contract %v", err, cd) } From 4b3c82162956fb1f4114f2c457e5ddeb6f144280 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 28 Feb 2023 18:25:38 +0100 Subject: [PATCH 07/16] Compute values of internal transactions in balance history --- api/worker.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/api/worker.go b/api/worker.go index c07d9f8a..5f0873a3 100644 --- a/api/worker.go +++ b/api/worker.go @@ -1465,6 +1465,35 @@ func (w *Worker) balanceHistoryForTxid(addrDesc bchain.AddressDescriptor, txid s } } } + // process internal transactions + if eth.ProcessInternalTransactions { + internalData, err := w.db.GetEthereumInternalData(txid) + if err != nil { + return nil, err + } + if internalData != nil { + for i := range internalData.Transfers { + f := &internalData.Transfers[i] + txAddrDesc, err := w.chainParser.GetAddrDescFromAddress(f.From) + if err != nil { + return nil, err + } + if bytes.Equal(addrDesc, txAddrDesc) { + (*big.Int)(bh.SentSat).Add((*big.Int)(bh.SentSat), &f.Value) + if f.From == f.To { + (*big.Int)(bh.SentToSelfSat).Add((*big.Int)(bh.SentToSelfSat), &f.Value) + } + } + txAddrDesc, err = w.chainParser.GetAddrDescFromAddress(f.To) + if err != nil { + return nil, err + } + if bytes.Equal(addrDesc, txAddrDesc) { + (*big.Int)(bh.ReceivedSat).Add((*big.Int)(bh.ReceivedSat), &f.Value) + } + } + } + } } for i := range bchainTx.Vin { bchainVin := &bchainTx.Vin[i] From f237b82761d082d08a2be8c5549c24ec6485c24b Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 28 Feb 2023 19:04:58 +0100 Subject: [PATCH 08/16] Set Ethereum Goerli testnet symbol to tETH --- configs/coins/ethereum_testnet_goerli.json | 2 +- configs/coins/ethereum_testnet_goerli_archive.json | 2 +- configs/coins/ethereum_testnet_goerli_archive_consensus.json | 2 +- configs/coins/ethereum_testnet_goerli_consensus.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/ethereum_testnet_goerli.json b/configs/coins/ethereum_testnet_goerli.json index b4bc2a5f..5335e63b 100644 --- a/configs/coins/ethereum_testnet_goerli.json +++ b/configs/coins/ethereum_testnet_goerli.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli", - "shortcut": "tGOR", + "shortcut": "tETH", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli" }, diff --git a/configs/coins/ethereum_testnet_goerli_archive.json b/configs/coins/ethereum_testnet_goerli_archive.json index b444b335..ff73353c 100644 --- a/configs/coins/ethereum_testnet_goerli_archive.json +++ b/configs/coins/ethereum_testnet_goerli_archive.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli Archive", - "shortcut": "tGOR", + "shortcut": "tETH", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_archive" }, diff --git a/configs/coins/ethereum_testnet_goerli_archive_consensus.json b/configs/coins/ethereum_testnet_goerli_archive_consensus.json index 72ac9807..f93d016d 100644 --- a/configs/coins/ethereum_testnet_goerli_archive_consensus.json +++ b/configs/coins/ethereum_testnet_goerli_archive_consensus.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli Archive", - "shortcut": "tGOR", + "shortcut": "tETH", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_archive_consensus", "execution_alias": "ethereum_testnet_goerli_archive" diff --git a/configs/coins/ethereum_testnet_goerli_consensus.json b/configs/coins/ethereum_testnet_goerli_consensus.json index 49d0fc82..585cf2d2 100644 --- a/configs/coins/ethereum_testnet_goerli_consensus.json +++ b/configs/coins/ethereum_testnet_goerli_consensus.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli", - "shortcut": "tGOR", + "shortcut": "tETH", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_consensus", "execution_alias": "ethereum_testnet_goerli" From d75680b3690f28b03b759414adbc1c606ffee65a Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 28 Feb 2023 19:23:38 +0100 Subject: [PATCH 09/16] Security: Bump golang.org/x/net from 0.1.0 to 0.7.0 --- go.mod | 8 ++++---- go.sum | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index cf1a81bb..aa12c96f 100644 --- a/go.mod +++ b/go.mod @@ -97,11 +97,11 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 // indirect - golang.org/x/net v0.1.0 // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect gonum.org/v1/gonum v0.11.0 // indirect google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect diff --git a/go.sum b/go.sum index 83959809..548d00ef 100644 --- a/go.sum +++ b/go.sum @@ -542,6 +542,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -617,10 +619,14 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -631,6 +637,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 5652ca6b2ed862108f5e989e2c091a6ff93a4012 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Wed, 1 Mar 2023 17:29:03 +0100 Subject: [PATCH 10/16] Set Ethereum Goerli testnet symbol to tGOR for backward compatibility --- configs/coins/ethereum_testnet_goerli.json | 2 +- configs/coins/ethereum_testnet_goerli_archive.json | 2 +- configs/coins/ethereum_testnet_goerli_archive_consensus.json | 2 +- configs/coins/ethereum_testnet_goerli_consensus.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/coins/ethereum_testnet_goerli.json b/configs/coins/ethereum_testnet_goerli.json index 5335e63b..b4bc2a5f 100644 --- a/configs/coins/ethereum_testnet_goerli.json +++ b/configs/coins/ethereum_testnet_goerli.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli", - "shortcut": "tETH", + "shortcut": "tGOR", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli" }, diff --git a/configs/coins/ethereum_testnet_goerli_archive.json b/configs/coins/ethereum_testnet_goerli_archive.json index ff73353c..b444b335 100644 --- a/configs/coins/ethereum_testnet_goerli_archive.json +++ b/configs/coins/ethereum_testnet_goerli_archive.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli Archive", - "shortcut": "tETH", + "shortcut": "tGOR", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_archive" }, diff --git a/configs/coins/ethereum_testnet_goerli_archive_consensus.json b/configs/coins/ethereum_testnet_goerli_archive_consensus.json index f93d016d..72ac9807 100644 --- a/configs/coins/ethereum_testnet_goerli_archive_consensus.json +++ b/configs/coins/ethereum_testnet_goerli_archive_consensus.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli Archive", - "shortcut": "tETH", + "shortcut": "tGOR", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_archive_consensus", "execution_alias": "ethereum_testnet_goerli_archive" diff --git a/configs/coins/ethereum_testnet_goerli_consensus.json b/configs/coins/ethereum_testnet_goerli_consensus.json index 585cf2d2..49d0fc82 100644 --- a/configs/coins/ethereum_testnet_goerli_consensus.json +++ b/configs/coins/ethereum_testnet_goerli_consensus.json @@ -1,7 +1,7 @@ { "coin": { "name": "Ethereum Testnet Goerli", - "shortcut": "tETH", + "shortcut": "tGOR", "label": "Ethereum Goerli", "alias": "ethereum_testnet_goerli_consensus", "execution_alias": "ethereum_testnet_goerli" From a81420fc945aaea3e154dc049177f69d4c0826a0 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Thu, 2 Mar 2023 00:37:33 +0100 Subject: [PATCH 11/16] Improve parsing of ETH input data --- bchain/coins/eth/dataparser.go | 16 ++++--- bchain/coins/eth/dataparser_test.go | 67 ++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 13 deletions(-) diff --git a/bchain/coins/eth/dataparser.go b/bchain/coins/eth/dataparser.go index 060fcfca..81826926 100644 --- a/bchain/coins/eth/dataparser.go +++ b/bchain/coins/eth/dataparser.go @@ -76,7 +76,8 @@ func decamel(s string) string { b.WriteByte(' ') } b.WriteRune(v) - splittable = unicode.IsLower(v) || unicode.IsNumber(v) + // special handling of ETH to be able to convert "addETHToContract" to "Add ETH To Contract" + splittable = unicode.IsLower(v) || unicode.IsNumber(v) || (i >= 2 && s[i-2:i+1] == "ETH") } } return b.String() @@ -98,7 +99,7 @@ func GetSignatureFromData(data string) uint32 { const ErrorTy byte = 255 -func processParam(data string, index int, t *abi.Type, processed []bool) ([]string, int, bool) { +func processParam(data string, index int, dataOffset int, t *abi.Type, processed []bool) ([]string, int, bool) { var retval []string d := index << 6 if d+64 > len(data) { @@ -140,7 +141,7 @@ func processParam(data string, index int, t *abi.Type, processed []bool) ([]stri for i := 0; i < t.Size; i++ { var r []string var ok bool - r, index, ok = processParam(data, index, t.Elem, processed) + r, index, ok = processParam(data, index, dataOffset, t.Elem, processed) if !ok { return nil, 0, false } @@ -156,7 +157,7 @@ func processParam(data string, index int, t *abi.Type, processed []bool) ([]stri processed[index] = true index++ offset <<= 1 - d = int(offset) + d = int(offset) + dataOffset dynIndex := d >> 6 if d+64 > len(data) || d < 0 { return nil, 0, false @@ -195,10 +196,11 @@ func processParam(data string, index int, t *abi.Type, processed []bool) ([]stri } } } else { + newOffset := dataOffset + dynIndex<<6 for i := 0; i < count; i++ { var r []string var ok bool - r, dynIndex, ok = processParam(data, dynIndex, t.Elem, processed) + r, dynIndex, ok = processParam(data, dynIndex, newOffset, t.Elem, processed) if !ok { return nil, 0, false } @@ -222,7 +224,7 @@ func tryParseParams(data string, params []string, parsedParams []abi.Type) []bch var ok bool for i := range params { t := &parsedParams[i] - values, index, ok = processParam(data, index, t, processed) + values, index, ok = processParam(data, index, 0, t, processed) if !ok { return nil } @@ -244,7 +246,7 @@ func ParseInputData(signatures *[]bchain.FourByteSignature, data string) *bchain if len(data) <= 2 { // data is empty or 0x return &bchain.EthereumParsedInputData{Name: "Transfer"} } - if len(data) < 10 || (len(data)-10)%64 != 0 { + if len(data) < 10 { return nil } parsed := bchain.EthereumParsedInputData{ diff --git a/bchain/coins/eth/dataparser_test.go b/bchain/coins/eth/dataparser_test.go index 745e6b62..b13ecd16 100644 --- a/bchain/coins/eth/dataparser_test.go +++ b/bchain/coins/eth/dataparser_test.go @@ -112,7 +112,7 @@ func TestParseInputData(t *testing.T) { Parameters: []string{"address"}, }, { - Name: "addLiquidityETH", + Name: "addLiquidityETHToContract", Parameters: []string{"address", "uint256", "uint256", "uint256", "address", "uint256"}, }, { @@ -131,6 +131,10 @@ func TestParseInputData(t *testing.T) { Name: "transmitAndSellTokenForEth", Parameters: []string{"address", "uint256", "uint256", "uint256", "address", "(uint8,bytes32,bytes32)", "bytes"}, }, + { + Name: "execute", + Parameters: []string{"bytes", "bytes[]", "uint256"}, + }, } tests := []struct { name string @@ -191,13 +195,13 @@ func TestParseInputData(t *testing.T) { }, }, { - name: "addLiquidityETH", + name: "addLiquidityETHToContract", signatures: &signatures, data: "0xf305d719000000000000000000000000b80e5aaa2131c07568128f68b8538ed3c8951234000000000000000000000000000000000000007e37be2022c0914b2680000000000000000000000000000000000000000000007e37be2022c0914b26800000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000009f64b014ca26f2def573246543dd1115b229e4f400000000000000000000000000000000000000000000000000000000623f56f8", want: &bchain.EthereumParsedInputData{ MethodId: "0xf305d719", - Name: "Add Liquidity ETH", - Function: "addLiquidityETH(address, uint256, uint256, uint256, address, uint256)", + Name: "Add Liquidity ETH To Contract", + Function: "addLiquidityETHToContract(address, uint256, uint256, uint256, address, uint256)", Params: []bchain.EthereumParsedInputParam{ { Type: "address", @@ -227,7 +231,7 @@ func TestParseInputData(t *testing.T) { }, }, { - name: "addLiquidityETH data don't match - too long", + name: "addLiquidityETHToContract data don't match - too long", signatures: &signatures, data: "0xf305d719000000000000000000000000b80e5aaa2131c07568128f68b8538ed3c8951234000000000000000000000000000000000000007e37be2022c0914b2680000000000000000000000000000000000000000000007e37be2022c0914b26800000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000009f64b014ca26f2def573246543dd1115b229e4f400000000000000000000000000000000000000000000000000000000623f56f800000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff", want: &bchain.EthereumParsedInputData{ @@ -235,7 +239,7 @@ func TestParseInputData(t *testing.T) { }, }, { - name: "addLiquidityETH data don't match - too short", + name: "addLiquidityETHToContract data don't match - too short", signatures: &signatures, data: "0xf305d719000000000000000000000000b80e5aaa2131c07568128f68b8538ed3c8951234000000000000000000000000000000000000007e37be2022c0914b2680000000000000000000000000000000000000000000007e37be2022c0914b26800000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000009f64b014ca26f2def573246543dd1115b229e4f4", want: &bchain.EthereumParsedInputData{ @@ -362,6 +366,57 @@ func TestParseInputData(t *testing.T) { }, }, }, + { + name: "execute", + signatures: &signatures, + data: "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000063fd167b00000000000000000000000000000000000000000000000000000000000000010800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000002fa5e9a300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cda4e840411c00a614ad9205caec807c7458a0e3000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + want: &bchain.EthereumParsedInputData{ + MethodId: "0x3593564c", + Name: "Execute", + Function: "execute(bytes, bytes[], uint256)", + Params: []bchain.EthereumParsedInputParam{ + { + Type: "bytes", + Values: []string{"0x08"}, + }, + { + Type: "bytes[]", + Values: []string{"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000000000000000002fa5e9a300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cda4e840411c00a614ad9205caec807c7458a0e3000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, + }, + { + Type: "uint256", + Values: []string{"1677530747"}, + }, + }, + }, + }, + { + name: "execute2", + signatures: &signatures, + data: "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000063ffd82300000000000000000000000000000000000000000000000000000000000000020b080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000491478480c282e75df8b5700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f0f9d895aca5c8678f706fb8216fa22957685a13", + want: &bchain.EthereumParsedInputData{ + MethodId: "0x3593564c", + Name: "Execute", + Function: "execute(bytes, bytes[], uint256)", + Params: []bchain.EthereumParsedInputParam{ + { + Type: "bytes", + Values: []string{"0x0b08"}, + }, + { + Type: "bytes[]", + Values: []string{ + "0x000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000006f05b59d3b20000", + "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000006f05b59d3b20000000000000000000000000000000000000000000000491478480c282e75df8b5700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000f0f9d895aca5c8678f706fb8216fa22957685a13", + }, + }, + { + Type: "uint256", + Values: []string{"1677711395"}, + }, + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 86168f4c5e9357152572506eb46df0dec667114c Mon Sep 17 00:00:00 2001 From: blondfrogs <8285518+blondfrogs@users.noreply.github.com> Date: Wed, 1 Mar 2023 08:20:10 -0700 Subject: [PATCH 12/16] Update flux binary to latest release --- configs/coins/flux.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/coins/flux.json b/configs/coins/flux.json index 887f8fa8..e9f2d925 100644 --- a/configs/coins/flux.json +++ b/configs/coins/flux.json @@ -23,9 +23,9 @@ "package_revision": "satoshilabs-1", "system_user": "flux", "version": "6.0.0", - "binary_url": "https://github.com/RunOnFlux/fluxd/releases/download/v6.0.0/Flux-amd64-v6.0.0.tar.gz", + "binary_url": "https://github.com/RunOnFlux/fluxd/releases/download/v6.1.0/Flux-amd64-v6.1.0.tar.gz", "verification_type": "sha256", - "verification_source": "28717246a383018de8f6099a26afc3a4877da32f2d9531a3253b1664c22145e7", + "verification_source": "39461407a1b85b9dafc181e88dbd5274002ca36fcd976a8eeb735a900df6ad9a", "extract_command": "tar -C backend -xf", "exclude_files": [], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/fluxd -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", From 10da32b24953004d175161cfc092b0595556180c Mon Sep 17 00:00:00 2001 From: justanwar <42809091+justanwar@users.noreply.github.com> Date: Fri, 3 Mar 2023 20:22:12 +0800 Subject: [PATCH 13/16] =?UTF-8?q?firo=200.14.11.1=20=E2=86=92=200.14.12.0?= =?UTF-8?q?=20(#855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ara --- bchain/coins/firo/firoparser.go | 46 +++++++++++++++++++++++++-------- configs/coins/firo.json | 6 ++--- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/bchain/coins/firo/firoparser.go b/bchain/coins/firo/firoparser.go index 4bb800e2..d2b9e1f0 100644 --- a/bchain/coins/firo/firoparser.go +++ b/bchain/coins/firo/firoparser.go @@ -21,6 +21,7 @@ const ( OpLelantusMint = 0xc5 OpLelantusJMint = 0xc6 OpLelantusJoinSplit = 0xc7 + OpLelantusJoinSplitPayload = 0xc9 MainnetMagic wire.BitcoinNet = 0xe3d9fef1 TestnetMagic wire.BitcoinNet = 0xcffcbeea @@ -122,6 +123,8 @@ func (p *FiroParser) GetAddressesFromAddrDesc(addrDesc bchain.AddressDescriptor) return []string{"LelantusJMint"}, false, nil case OpLelantusJoinSplit: return []string{"LelantusJoinSplit"}, false, nil + case OpLelantusJoinSplitPayload: + return []string{"LelantusJoinSplit"}, false, nil } } @@ -170,7 +173,7 @@ func (p *FiroParser) ParseBlock(b []byte) (*bchain.Block, error) { } else { if isMTP(header) { mtpHeader := MTPBlockHeader{} - mtpHashData := MTPHashData{} + mtpHashDataRoot := MTPHashDataRoot{} // header err = binary.Read(reader, binary.LittleEndian, &mtpHeader) @@ -178,28 +181,46 @@ func (p *FiroParser) ParseBlock(b []byte) (*bchain.Block, error) { return nil, err } - // hash data - err = binary.Read(reader, binary.LittleEndian, &mtpHashData) + // hash data root + err = binary.Read(reader, binary.LittleEndian, &mtpHashDataRoot) if err != nil { return nil, err } - // proof - for i := 0; i < MTPL*3; i++ { - var numberProofBlocks uint8 + isAllZero := true + for i := 0; i < 16; i++ { + if mtpHashDataRoot.HashRootMTP[i] != 0 { + isAllZero = false + break + } + } + - err = binary.Read(reader, binary.LittleEndian, &numberProofBlocks) + if !isAllZero { + // hash data + mtpHashData := MTPHashData{} + err = binary.Read(reader, binary.LittleEndian, &mtpHashData) if err != nil { return nil, err } - for j := uint8(0); j < numberProofBlocks; j++ { - var mtpData [16]uint8 + // proof + for i := 0; i < MTPL*3; i++ { + var numberProofBlocks uint8 - err = binary.Read(reader, binary.LittleEndian, mtpData[:]) + err = binary.Read(reader, binary.LittleEndian, &numberProofBlocks) if err != nil { return nil, err } + + for j := uint8(0); j < numberProofBlocks; j++ { + var mtpData [16]uint8 + + err = binary.Read(reader, binary.LittleEndian, mtpData[:]) + if err != nil { + return nil, err + } + } } } } @@ -318,8 +339,11 @@ func isProgPow(h *wire.BlockHeader, isTestNet bool) bool { return isTestNet && epoch >= SwitchToProgPowBlockHeaderTestnet || !isTestNet && epoch >= SwitchToProgPowBlockHeaderMainnet } -type MTPHashData struct { +type MTPHashDataRoot struct { HashRootMTP [16]uint8 +} + +type MTPHashData struct { BlockMTP [128][128]uint64 } diff --git a/configs/coins/firo.json b/configs/coins/firo.json index 1e294469..02b7d562 100644 --- a/configs/coins/firo.json +++ b/configs/coins/firo.json @@ -22,10 +22,10 @@ "package_name": "backend-firo", "package_revision": "satoshilabs-1", "system_user": "firo", - "version": "0.14.11.1", - "binary_url": "https://github.com/firoorg/firo/releases/download/v0.14.11.1/firo-0.14.11.1-linux64.tar.gz", + "version": "0.14.12.0", + "binary_url": "https://github.com/firoorg/firo/releases/download/v0.14.12.0/firo-0.14.12.0-linux64.tar.gz", "verification_type": "sha256", - "verification_source": "8669ae8ce3356deee2512a4da133eab347c704cf47c865caf9ea10b46ba8b477", + "verification_source": "47c7ae07f85189b6b11068848a5c8f930528e6edfff14fd3c6e6305a01e8da77", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/firo-qt", From 78cf3c264782e60a147031c6ae80b3ab1f704783 Mon Sep 17 00:00:00 2001 From: JoHnY Date: Thu, 2 Mar 2023 14:04:10 +0000 Subject: [PATCH 14/16] ltc (+testnet) 0.21.2.1 -> 0.21.2.2 --- configs/coins/litecoin.json | 6 +++--- configs/coins/litecoin_testnet.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/coins/litecoin.json b/configs/coins/litecoin.json index f965e4e8..2c785528 100644 --- a/configs/coins/litecoin.json +++ b/configs/coins/litecoin.json @@ -22,10 +22,10 @@ "package_name": "backend-litecoin", "package_revision": "satoshilabs-1", "system_user": "litecoin", - "version": "0.21.2.1", - "binary_url": "https://download.litecoin.org/litecoin-0.21.2.1/linux/litecoin-0.21.2.1-x86_64-linux-gnu.tar.gz", + "version": "0.21.2.2", + "binary_url": "https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz", "verification_type": "gpg", - "verification_source": "https://download.litecoin.org/litecoin-0.21.2.1/linux/litecoin-0.21.2.1-x86_64-linux-gnu.tar.gz.asc", + "verification_source": "https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": ["bin/litecoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/litecoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", diff --git a/configs/coins/litecoin_testnet.json b/configs/coins/litecoin_testnet.json index fb23dbde..b239c9dd 100644 --- a/configs/coins/litecoin_testnet.json +++ b/configs/coins/litecoin_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-litecoin-testnet", "package_revision": "satoshilabs-1", "system_user": "litecoin", - "version": "0.21.2.1", - "binary_url": "https://download.litecoin.org/litecoin-0.21.2.1/linux/litecoin-0.21.2.1-x86_64-linux-gnu.tar.gz", + "version": "0.21.2.2", + "binary_url": "https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz", "verification_type": "gpg", - "verification_source": "https://download.litecoin.org/litecoin-0.21.2.1/linux/litecoin-0.21.2.1-x86_64-linux-gnu.tar.gz.asc", + "verification_source": "https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz.asc", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/litecoin-qt" From 62865eea10a63527176821452c47b87652fdd528 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 21 Feb 2023 10:53:56 +0100 Subject: [PATCH 15/16] Ignore DELEGATECALL in EVM call trace Geth v1.11 changed the tracer and are now returning the delegated value. See https://github.com/ethereum/go-ethereum/issues/26726 --- bchain/coins/eth/ethrpc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index c4210fb9..61173b05 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -620,6 +620,9 @@ func (b *EthereumRPC) processCallTrace(call *rpcCallTrace, d *bchain.EthereumInt To: call.To, }) contracts = append(contracts, bchain.ContractInfo{Contract: call.From, DestructedInBlock: blockHeight}) + } else if call.Type == "DELEGATECALL" { + // ignore DELEGATECALL (geth v1.11 the changed tracer behavior) + // https://github.com/ethereum/go-ethereum/issues/26726 } else if err == nil && (value.BitLen() > 0 || b.ChainConfig.ProcessZeroInternalTransactions) { d.Transfers = append(d.Transfers, bchain.EthereumInternalTransfer{ Value: *value, From 17853a4e4a2bb64a9c93384742a08596202d077e Mon Sep 17 00:00:00 2001 From: Mohsen Mottaghi Date: Sun, 5 Mar 2023 22:09:53 +0330 Subject: [PATCH 16/16] [Fix] tests confilict Signed-off-by: Mohsen Mottaghi --- server/public_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/public_test.go b/server/public_test.go index bcf3a786..31bd9b7c 100644 --- a/server/public_test.go +++ b/server/public_test.go @@ -314,7 +314,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -334,7 +334,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, { @@ -343,7 +343,7 @@ func httpTestsBitcoinType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, + `Ping Fake Coin Explorer

Block

225494
00000000eb0443fd7dc4a1ed5c686a8e995057805f9a161d9a5a77a95e72b7b6
Transactions4
Height225494
Confirmations1
Timestamp1639 days 11 hours ago
Size (bytes)2345678
Version
Merkle Root
Nonce
Bits
Difficulty

Transactions

 
OP_RETURN 2020f1686f6a200 FAKE×
No Inputs (Newly Generated Coins)
 
Unparsed address0 FAKE×
`, }, }, {