0

我收到错误:返回的值无效,它是否用尽了 Gas?

当我连接 MetaMask 时,我的代码在 Google Chrome 上运行良好,但当我通过 walletConnect 连接钱包时拒绝在 Safari 或 Microsoft Edge 上运行。

代码:

  const providerOptions = {
    walletconnect: {
      package: WalletConnectProvider,
      options: {
        infuraId: "eb5582ce132a4718bef4d1a6305e9051",
      }
    },

    fortmatic: {
      package: Fortmatic,
      options: {
        key: "pk_test_391E26A3B43A3350"
      }
    }
  };

  web3Modal = new Web3Modal({
    cacheProvider: true,
    providerOptions,
    disableInjectedProvider: false,
    theme: "dark"
  });

const web3 = new Web3(provider);
const accounts = await web3.eth.getAccounts();
const selectedAccount = accounts[0];

const contract = new web3.eth.Contract(getContractABI(), '0xa6c648d65DD018679Ed966276ac5e605D0a8a34F');
let result = contract.methods.getPresaleRate().call();

谷歌浏览器结果:10000

Safari/Edge - Wallet Connect:错误:返回的值无效,是否耗尽了 Gas?

4

0 回答 0