Bug Description
I am trying to understand better the uniswap logic for development.
I have a problem like this,
I deploy new instances of contracts and change the UniswapV2Router02
and UniswapV2Factory.sol
addresses in the uniswap-interface
After that, part of the interface does not work. In particular, when adding liquidity, Metamask issues such an error
MetaMask - RPC Error: execution reverted {code: -32000, message: "execution reverted"}
Nothing has changed in the code, only the addresses of contracts with the same code as the original contracts.
I am developing in ropsten.
Expected Behavior
I expect metamask to handle the contract access without any problems, since only the contract address has been changed.
-
#1
Добрый день! решил воспользоваться кошельком метамаск. в процессе перевода на сайте debank weth в matic. выводит ошибку [ethjs-query] while formatting outputs from RPC ‘{«value»:{«code»:-32603,»data»:{«code»:-32000,»message»:»invalid sender»}}}’
кто сталкивался с таким? и как решили проблему?
-
#2
Добрый день! решил воспользоваться кошельком метамаск. в процессе перевода на сайте debank weth в matic. выводит ошибку [ethjs-query] while formatting outputs from RPC ‘{«value»:{«code»:-32603,»data»:{«code»:-32000,»message»:»invalid sender»}}}’
кто сталкивался с таким? и как решили проблему?
Все вопросы к тем кто разработал эту надстройку
Как известно кроилово ведет к попадалову
-
#3
Привет я сталкивался. Решил вопрос перейдя на метамаск телефона.
-
#4
Добрый день! решил воспользоваться кошельком метамаск. в процессе перевода на сайте debank weth в matic. выводит ошибку [ethjs-query] while formatting outputs from RPC ‘{«value»:{«code»:-32603,»data»:{«code»:-32000,»message»:»invalid sender»}}}’
кто сталкивался с таким? и как решили проблему?
Свапал Weth на матики прям в самом метамаске,не нужны никакие дебанки,и прочее,комса вышла на уровне десятков центов,или даже ниже.
-
#5
вопрос решился reset кошелька метмаск)
-
#6
Привет я сталкивался. Решил вопрос перейдя на метамаск телефона.
у меня почему то не хотят синхронизироваться((
Свапал Weth на матики прям в самом метамаске,не нужны никакие дебанки,и прочее,комса вышла на уровне десятков центов,или даже ниже.
комса ниже получилась чем на дебанке?
-
#7
у меня почему то не хотят синхронизироваться((
комса ниже получилась чем на дебанке?
Transaction Fee:
0.016543878 MATIC ($0.03),не знаю сколько комса в дебанке,вот что у меня вышло.
Loading
I have deployed a smart contract on a public testnet and now I am trying to connect to it from the front end using ethers js. But when I try to fetch the value it gives the following errors in the console:
I am using Angular for the front end and here’s the code I wrote:
declare let window: any;
import { Component, OnInit } from '@angular/core';
import { ethers } from 'ethers';
import addresses from '../../environment/contract-address.json'
import Election from '../../blockchain/artifacts/blockchain/contracts/Election.sol/Election.json'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'angvote';
public signer: any;
public electionContract: any;
public candidate : any;
public candidatesList:string[] | undefined;
constructor(){}
async ngOnInit(){
const provider = new ethers.providers.Web3Provider(window.ethereum);
window.ethereum.enable()
provider.on("network",(newNetwork: any, oldNetwork: any)=>{
if (oldNetwork){
window.location.reload();
}
});
this.signer = provider.getSigner();
if(await this.signer.getChainId() !== 4){
alert("Please change your network to Rinkeby!")
}
this.electionContract = new ethers.Contract(addresses.electioncontract,Election.abi,this.signer);
this.candidate = await this.electionContract.candidatesCount();
}
}
asked Dec 7, 2021 at 9:41
3
I have encountered the same error. I had not changed the contract address once I deployed it to the testnet(Previously I deployed to localhost).
Just check if the contract address you are using is of the contract you deployed to the testnet.
answered Jan 4, 2022 at 15:24
I met the same problem, check that:
- the contract address is correct
- the method you call is correct
- the parameter is correct
in my case, I called an non-exist method.
answered Jan 8, 2022 at 8:38
SiweiSiwei
19.3k6 gold badges73 silver badges94 bronze badges
4
I came across this problem and tried this solution and more but it didn’t work. What solve it for me was making sure my contract address and abi file had the same version.
answered Jul 18, 2022 at 18:57
#ethereum #solidity #ethers.js
#эфириум #прочность #ethers.js
Вопрос:
Я развернул смарт-контракт в общедоступной тестовой сети, и теперь я пытаюсь подключиться к нему с внешнего интерфейса, используя ethers js. Но когда я пытаюсь извлечь значение, оно выдает следующие ошибки в консоли:
Я использую Angular для интерфейса, и вот код, который я написал:
declare let window: any; import { Component, OnInit } from '@angular/core'; import { ethers } from 'ethers'; import addresses from '../../environment/contract-address.json' import Election from '../../blockchain/artifacts/blockchain/contracts/Election.sol/Election.json' @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit { title = 'angvote'; public signer: any; public electionContract: any; public candidate : any; public candidatesList:string[] | undefined; constructor(){} async ngOnInit(){ const provider = new ethers.providers.Web3Provider(window.ethereum); window.ethereum.enable() provider.on("network",(newNetwork: any, oldNetwork: any)=gt;{ if (oldNetwork){ window.location.reload(); } }); this.signer = provider.getSigner(); if(await this.signer.getChainId() !== 4){ alert("Please change your network to Rinkeby!") } this.electionContract = new ethers.Contract(addresses.electioncontract,Election.abi,this.signer); this.candidate = await this.electionContract.candidatesCount(); } }
Комментарии:
1. Пожалуйста, отредактируйте вопрос и поделитесь значениями
addresses.electioncontract
иElection.abi
. Возможно, вы либо обращаетесь к неправильному контракту (например, в другой сети или по другому адресу), либо используете ABI, который не соответствует функции, вызванной из кода JS.2. Да, вы правы, что-то было не так с смарт-контрактом, который я развернул. Заметил это, когда попытался развернуть
3. Здесь вы получаете ошибку «непредсказуемый предел расхода газа». Это может произойти, если ваш код солидности запускается в бесконечный цикл или рекурсивный вызов функции… возможно, вы также сможете обойти это, явно указав ограничение по газу.