I'm testing a smart contract for an ERC721 token, that inherits from OpenZeppelin, using waffle and chai with NodeJS v14.18.0, but chai's reverted assertions don't seem to function as expected.
Dependencies:
"devDependencies": {
…
I'm trying to create a signed message off-chain using ethers.js and verify that message on-chain using ecrecover. I'm signing the correct message from my metamask wallet, and passing the r, s, and v from that signature into ecrecover, but not…
I am working on a dapp that needs to verify users' signatures. When testing with Metamask, everything is okay.
When trying to verify a signature from Ambire wallet, I get "Error: invalid signature string" from ethers.utils.verifyMessage
For example,…
I have followed this Hardhat tutorial and trying to test a demo smart contract on RSK regtest blockchain.
Here is the hardhat.config.js setup I am using:
require('@nomiclabs/hardhat-waffle');
module.exports = {
solidity: '0.7.3',
…
I have tried changing the values from 0.025 ether to 1 ether then also its showing the same error.
Also, I have tried with the rational number like 1/8 still not working.
LOOKED into some answers but they didn't resolve the error.
I have the same…
I'm writing unit tests using Hardhat's mainnet fork, and for a test I want to check the owner account's initial balance of an ERC20 token, in particular DAI. Here's my test so far:
const { ethers } = require("hardhat");
describe("Simple Test",…
I'm trying to link BSC chain with wallet connect in my react DAPP.
const walletConnectProvider = await new WalletConnectProvider({
rpc: {
56: "https://bsc-dataseed.binance.org",
},
});
await walletConnectProvider.enable();
…
I am currently learning Solidity language and I've noticed that when I'm trying to get the value of a Struct inside my JS code, Solidity returns every variable without arrays.
I have to create custom getter to access all the data inside my…
I'm trying to access the ethers provider like this in Nextjs 13.0.1:
import { ethers } from "ethers";
export const signMessage = () => {
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer =…
I know I can put console.logs in Chai tests and get them printed in console. However, I want to know how can I put a regular breakpoint (or debugger; statement) in Vscode, and hit it, and debug as usual with stepping, evaluation, viewing local…
Say I have an ERC20 smart contract which I'm developing and testing in Hardhat:
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import…
I have the following code:
const ethereumProvider = ethers.getDefaultProvider(ETHEREUM_RPC);
const contract = new ethers.Contract(
CONTRACT_ADDRESS,
abi,
ethereumProvider,
);
The ethers package gives me the following error:
Error: resolver…
Here is a very small repo to show the issue: https://github.com/adamdry/ethers-event-issue
But I'll explain it here too. This is my contract:
//SPDX-License-Identifier: UNLICENSED;
pragma solidity 0.8.4;
contract ContractA {
event…
I'm using web3-react@^5.0.5 to interact with web3 from my react app. I can connect to metamask just fine.
I set the library to ethers.js and connected to metmask. Connecting worked fine, but almost none of ethers.js's methods are there. For example,…
I am trying to add web3 wallet connect button onto my webpage but I am getting this error and I am not able to resolve it since a long time. It is a nextjs react application.
const InvitesPage: NextPage = () => {
let web3Modal: any;
useEffect(()…