Error HH8: There’s one or more errors in your config file: Invalid account: #0 for network: mumbai – Expected string, received undefined Invalid account: #0 for network: mainnet – Expected string, received undefined To learn more about Hardhat’s configuration, please go to https://hardhat.org/config/ Neither two previous answers worked for me: * Invalid account: #0 for network: mumbai – Expected string,
Tag: ethereum
Can I generate a transaction on the server and send it to the client for payment
I have built a smart contract method to which I pass some sensitive data that needs to be stored on the blockchain and alter the state of the contract. I, the creator of the contract don’t want to be the one paying for the fees of that transaction. I want the user on the browser to approve and pay for
Decode constructor arguments in solidity
I playing Ethernaut Level 8. The goal is to get access to the private password state variable and unlock the contract. I know one could use await contract.unlock(await web3.eth.getStorageAt(contract.address, 1));, but I want to find the password decoding the input data of the contract creation. Here is the contract. I tried await contract.unlock(“f94b476063b6379a3c8b6c836efb8b3e10ede188”) but that didn’t work. Answer If the
Test an onlyOwner function in Javascript
I have this situation in my smart contract: I’m using truffle and his test suite and then I wrote this case, that fails maybe because I’m not using the only owner method in the right way: Can someone help me? Answer Assuming that you properly set the owner in the contract, write a getter for the owner in the contract:
Cannot destructure property ‘interface’ of ‘require(…)’ as it is undefined
I’m receiving this console error: Cannot destructure property ‘interface’ of ‘require(…)’ as it is undefined. Can somebody spot what is wrong? Inbox.test.js file: inbox.sol file: pragma solidity ^0.4.17; compile.js file: Answer I would suggest you verify your project structure. Your compile.js must be in a parent folder of Inbox.test.js.
Error when attempting to call smart contract with javascript
I am trying to write a piece of javascript that calls a smart contract. The smart contract has been deployed to a local test net with truffle and ganache and the javascript is producing the following error: Javascript code: Solidity code: I am not sure if the issue is coming from me not handling the async request properly, the JSON
How to speed up token balance on multiple contracts
I’m using ethers to call balanceOf method on all contracts to check if user has any balance there, if not, the token will not show up in his dashboard, but it takes a lot of time, is there a more finesse way to achieve the same goal? my code: Answer You can use Multicall contract for small wins. A proper
Provided Address is invalid, the capitalization checksum test failed
I am trying to send a method on a contract using web3. I’m creating an account using the privateKeyToAccount method but when sending the method on the contract I get the following error: Provided address [object Object] is invalid, the capitalization checksum test failed, or it’s an indirect IBAN address which can’t be converted. Am I missing a step? I
Supply ETH to Aave through solidity
I’m trying deposit into Aave V2 Contract Aave’s Code Examples I have code which consumes this like so: When attempting to supply, Metamask displays an error: ALERT: Transaction Error. Exception thrown in contract code. And just a simple button to call it in html: I’m running ganache ganache-cli –fork https://mainnet.infura.io/v3/{{MyProjectId}} The only error I see in the console is: Transaction:
Not including ‘gas’ or ‘gasPrice’ attributes in the ‘options’ object inside of a send() call
Does anyone know what the send() function call to a smart contract method defaults to when you don’t specify gas or gasPrice? Does it automatically allocate sufficient gas and calculate the current average gasPrice? And are those attributes always optional or are there situations where including either one is mandatory? Answer From the documentation, both gas and gas seem to