1
vote
Accepted
Using ecrecover returns incorrect signer only for specific data (approx 0.3% of cases)
In your signMessage function, to get the bytes (Uint8Array) representation of the messageHash, you need to use the ethers.getBytes function instead of ethers.toBeArray, like:
const signMessage = async ...
1
vote
Mint function is failing with Status: "Unfinalized (Safe)"everytime, i am trying to mint the contract
You've added the minting logic twice: once in the mint function and again in the generatePokeMon function. As a result, the _nextTokenId and newItemId are both being incremented twice, causing a ...
1
vote
How do i fix the issue of Invalid Bytecode, code: invalid argument when deploying?
Have a look at your constructor. It takes no arguments.
Now if you look at your deployment script, it specifies args: [deployer]. Remove this argument and this error should disappear.
You can't give ...
1
vote
Accepted
Create/set "subId" by createSubscription() and get "subId" vrfCoordinatorV2_5Mock calling by javascript in hardhat environment
Instead of events, it should be the logs array, inside the createSubIdReceipt object.
So, replace this line:
subscriptionId = createSubIdReceipt.events[0].args.subId
with:
subscriptionId = ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hardhat × 1440solidity × 669
ethers.js × 360
hardhat-deploy × 223
testing × 163
javascript × 108
contract-deployment × 84
chai × 74
blockchain × 67
contract-development × 63
ether × 52
openzeppelin × 49
web3js × 46
unittesting × 46
test × 43
erc-20 × 42
typescript × 41
uniswap × 40
chainlink × 39
etherscan × 37
metamask × 35
nft × 35
ethereumjs × 33
mocha × 33
polygon × 30