Closed mzanella closed 6 years ago
The query to get the duplicate addresses is the following:
SELECT DISTINCT lower(w1.Address)
FROM Wallet as w1, Wallet as w2
WHERE w1.Currency = 'ETH' AND w2.Currency = 'ETH'
AND w1.Address != w2.Address AND
(w1.Address = w2.Address COLLATE NOCASE)
From the command line one can simply write this:
DROP TABLE IF EXISTS _Variables;
CREATE TEMP TABLE _Variables(A text);
INSERT INTO _Variables ( A )
SELECT DISTINCT lower(w1.Address)
FROM Wallet as w1, Wallet as w2, AccountWallet as aw1, AccountWallet as aw2
WHERE w1.Currency = 'ETH' AND w2.Currency = 'ETH'
AND w1.Address = aw1.Wallet AND w1.Address != w2.Address AND aw1.RawUrl =
aw2.RawUrl AND w2.Address = aw2.Wallet AND (w1.Address = w2.Address COLLATE
NOCASE);
DELETE FROM AccountWallet WHERE Wallet in (SELECT * FROM _Variables);
DELETE FROM Wallet WHERE Address in (SELECT * FROM _Variables);
DROP TABLE _Variables;
To simplify the solution of this issue it is better to do before: #55 (Indeed there are some entries of this kind)
[x] Remove this address. 0x28b648017de25cfbc439ae9ca2b95dbcf43a9b7a . It is taken from https://github.com/andrewsun25/Cryptocurrency-Natural-Language-Processing-And-TimeSeries/blob/master/data/docs.txt that is a series of messages, from which we do not know the author :/
[x] "0xb205a4560bbc9840b80d36245333401e65d4f05e" "https://raw.githubusercontent.com/carbonsphere/iota-ipm/f1f6eadbfd1c588efedf60a7c83dff14052d9370/Dockerfile" "https://raw.githubusercontent.com/carbonsphere/iota-ipm/f1f6eadbfd1c588efedf60a7c83dff14052d9370/README.md" It is the same author in the same repo that specifies the donation address in different places. We should keep only one of them. I will tend to the README.md
[x] 0x1be116204bb55cb61c821a1c7866fa6f94b561a5 it is a smart-contract belonging to the repo author(?) What the fuck
SELECT a1.Address
FROM Wallet AS a1
WHERE UPPER(a1.Address) IN (
SELECT UPPER(a2.Address)
FROM Wallet AS a2
GROUP BY UPPER(a2.Address)
HAVING COUNT(*) > 1
)
ORDER BY a1.Address
Ethereum can have addresses of type 0x<20 bytes> or <20 bytes>