Я пытаюсь зарегистрировать пользовательские токены ERC20 для локального тестирования через MetaMask, следуя этому официальному руководству . Тем не менее, я вижу ошибку RPC, выданную расширением MetaMask, без дальнейшего объяснения ошибки.
Я убедился, что адрес токена действителен и правильно развернут. Кроме того, нет проблем с добавлением пользовательских токенов через MetaMask UI.
- версия MetaMask: 6.6.2
- RPC-сервер: Ganache 2.0.0
- Браузер: FireFox 68.0b7
Вот код на стороне клиента для регистрации моего пользовательского токена:
ethereum.sendAsync(
{
method: 'wallet_watchAsset',
params: {
type: 'ERC20',
options: {
address: '0x837eD53CaA281D6D3ac663405D113d89711B34ba',
symbol: 'ETH',
decimals: 18,
image: 'http://placekitten.com/200/300',
},
},
id: Math.round(Math.random() * 100000),
},
(err, added) => {
if (err) {
console.log(err);
} else if (added.error) {
console.log(added.error);
} else {
console.log(added);
}
},
);
Я получил следующую ошибку в моей консоли:
MetaMask - RPC Error: value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:46203
e/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:45321
_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230341
[1261]</w/o._invoke@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230129
[1261]</S/</e[t]@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230520
n@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623952
[251]</r.default/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:624093
E@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:953415
[251]</r.default/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623887
[19]</</_</<.value</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:45763
e/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:38599
_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230341
[1261]</w/o._invoke@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230129
[1261]</S/</e[t]@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230520
n@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623952
[251]</r.default/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:624093
E@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:953415
[251]</r.default/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623887
[19]</</_</<.value</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:38883
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406
[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664
c@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189
s@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097
[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899
[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689
[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434
[596]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1211853
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406
[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664
c@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189
s@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097
[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899
[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689
[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434
[596]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1211853
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406
[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664
c@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189
s@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097
[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899
[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689
[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434
[40]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:104000
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406
[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664
c@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189
s@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097
[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899
[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689
[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434
[41]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:104245
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406
[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664
c@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189
[205]</</</Ee/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592213
Me@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592634
[205]</</</Ne/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592788
[205]</</</Ae/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592302
value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904349
[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903870
n@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:607233
Vr@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:607329
value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903838
value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903657
value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903546
write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1906682
v@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2218108
[1252]</</g.prototype.write/a<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221220
[1252]</</g.prototype.write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221247
m@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2210485
[315]</a.prototype.emit/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:843960
[315]</a.prototype.emit@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:844030
_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205324
w@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205139
[1250]</</v.prototype.push@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205950
_write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2073581
v@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2218108
[1252]</</g.prototype.write/a<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221220
[1252]</</g.prototype.write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221247
m@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1467990
[315]</a.prototype.emit/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:843960
[315]</a.prototype.emit@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:844030
_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1462793
w@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1462608
[698]</</v.prototype.push@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1463419
[694]</</o.prototype._onMessage@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1457368
Object { code: -32603, message: "value@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:46203\ne/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:45321\n_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230341\n[1261]</w/o._invoke@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230129\n[1261]</S/</e[t]@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230520\nn@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623952\n[251]</r.default/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:624093\nE@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:953415\n[251]</r.default/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623887\n[19]</</_</<.value</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:45763\ne/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:38599\n_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230341\n[1261]</w/o._invoke@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230129\n[1261]</S/</e[t]@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2230520\nn@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623952\n[251]</r.default/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:624093\nE@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:953415\n[251]</r.default/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:623887\n[19]</</_</<.value</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:38883\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406\n[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664\nc@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189\ns@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097\n[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899\n[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689\n[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434\n[596]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1211853\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406\n[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664\nc@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189\ns@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097\n[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899\n[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689\n[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434\n[596]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1211853\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406\n[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664\nc@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189\ns@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097\n[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899\n[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689\n[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434\n[40]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:104000\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406\n[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664\nc@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189\ns@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592097\n[205]</</</ke/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:591899\n[205]</</</Me/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592689\n[807]</value/</<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904434\n[41]</t.exports/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:104245\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904406\n[205]</</</Me/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592664\nc@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592189\n[205]</</</Ee/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592213\nMe@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592634\n[205]</</</Ne/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592788\n[205]</</</Ae/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:592302\nvalue@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1904349\n[807]</value/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903870\nn@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:607233\nVr@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:607329\nvalue@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903838\nvalue@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903657\nvalue@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1903546\nwrite@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1906682\nv@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2218108\n[1252]</</g.prototype.write/a<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221220\n[1252]</</g.prototype.write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221247\nm@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2210485\n[315]</a.prototype.emit/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:843960\n[315]</a.prototype.emit@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:844030\n_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205324\nw@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205139\n[1250]</</v.prototype.push@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2205950\n_write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2073581\nv@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2218108\n[1252]</</g.prototype.write/a<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221220\n[1252]</</g.prototype.write@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:2221247\nm@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1467990\n[315]</a.prototype.emit/<@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:843960\n[315]</a.prototype.emit@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:844030\n_@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1462793\nw@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1462608\n[698]</</v.prototype.push@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1463419\n[694]</</o.prototype._onMessage@moz-extension://49932d42-d657-4747-9f69-85a7533c4b5d/background.js:1:1457368\n" }
inpage.js:1:105478