Majd TL
  • Member for 3 years, 11 months
  • Last seen this week
  • Stuttgart, Deutschland
reason: 'too many arguments: in Contract constructor', This is the last step before i deploy the contract, so any advice would be great
0 votes

You are giving a string argument -> “Hallo, Hardhat” when you are deploying the contract but your contract does not expect any arguments. So remove it and it will be -> const nicola = await ...

View answer
How to run hardhat tests on a testnet?
Accepted answer
1 votes

Make sure your accounts have balances. And you can config the timeout depends on each network by adding a timeout property in milliseconds (https://hardhat.org/config/#json-rpc-based-networks) example:...

View answer
Function warning for 'view' and code 'not reacheable'
Accepted answer
2 votes

It is unreachable code it is not a warning it is a bug in your code? you are only checking the first element in the registered array and return directly false or true without looking at the rest of ...

View answer
Error : transaction underpriced
0 votes

"Error: transaction underpriced" usually happens when the "gasPrice" you are willing to pay is very low and not accepted by the network. In your code, you are not setting the "...

View answer
Member "slice" not found or not visible after argument-dependent lookup in struct Ballot.Proposal storage ref[ ] storage ref
1 votes

According to the documentation here As of now, array slices are only implemented for calldata arrays. Your proposals array is stored in the storage and it is not calldata. check these for more ...

View answer
My remix.eth page does not connect with my metamask account
1 votes

First, try to disconnect your metamask from everything by clicking on that green "Connected" on the left side from metamask and then disconnect all accounts. After that lockout from Metamask ...

View answer
What's the interfaceID for ERC-20?
0 votes

Short Answer probably 0x36372b07 I think you can add the interfaces like this in your ERC20 Contract constructor, you need to import IERC20 and ERC20 and ERC165 (or ERC165Storage) from OpenZeppelin ...

View answer
Solidity: How to inherit a struct to create a new struct?
Accepted answer
0 votes

It works a little bit differently in solidity, you need to use a struct inside a struct. Example: // SPDX-License-Identifier: MIT pragma solidity 0.8.9; contract Example { struct Person { ...

View answer
Verify contract not working (not match bytecode)
0 votes

Try this Run npm init -y then npm install --save-dev hardhat after that open the folder in vsc and in the terminal run npx hradhat and choose Create an advanced sample project Install Openzepplien $ ...

View answer
Difference between smart contract and wallet address
Accepted answer
1 votes

A smart contract address is an ethereum address that has code/data behind it. so to check if the given address is "currently" a contract you can use the getCode method from Web3js web3.eth....

View answer
Is there a way to detect if a token was already approved?
1 votes

You can use the allowance method to check if the spender is approved to transfer tokens on behalf of the owner. the method will return you the approved amount to spend https://docs.openzeppelin.com/...

View answer
how to convert "0.5" number knowing decimals to a valid bignumber
1 votes

That is usually how I calculate half of a token. but I don't guarantee that it works correctly :) so please check the code and make sure it works and is correct and use it only on your own ...

View answer
What is this function do internally of Time Lock Controller of Solidity?
2 votes

I found this information in the doc of OpenZeppelin for v.4.x here First, what is an operation? it is a transaction (or a set of transactions) that is the subject of the timelock. It has to be ...

View answer
how to store the gasprice as integer rather than object?
Accepted answer
1 votes

As KonyTech sais "web3.eth.getGasPrice() returns a Promise so you must treat it as such. In your example a is the Promise, not the gas price" (so you need to understand what are promises in ...

View answer
I am trying to call the other contract which is already deployed on the blockchain. But when I try compiling it with remix , it doesn't compile
0 votes

You need to import the contract. Contracts name start always with capital letter // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; // or your solidity version import "./...

View answer
Testing arguments of contract events with hardhat + chai
Accepted answer
2 votes

This is how I do that for the Transfer event of the ERC20 tokens: usually : await expect(tokenInstance.connect(<signer-account>).transfer(<addr-of-receipent>, <amount-BigNumber>)) ....

View answer
Types in storage containing (nested) mappings cannot be assigned to
0 votes

// SPDX-License-Identifier: MIT pragma solidity 0.8.0; contract NFT { uint256 public fauouRiteNum; mapping(address => address) private wallet; function setNumber(uint256 _fav) ...

View answer
Get mapping value in hardhat
Accepted answer
2 votes

I think it should be public. Therefore add the public modifier before the variable mapping (uint256 => uint256) public totalBoostedPercent;

View answer
First Smart Contract: How to emit exact string data?
1 votes

I think those are: memory or data slot starts at byte 20 data length in your case 12 bytes then what is inside the memory/data bytes="48 65 6c 6c 6f 20 77 6f 72 6c 64 21" which is your &...

View answer
How to call a fallback function in remix
Accepted answer
0 votes

When I deploy the contract I get it on the left side down. it called ‘low level interaction’ and depends on the input there the receiver or fallback function is called. My contract don’t have them ...

View answer
How can i read symbol and name of the token in transaction?
1 votes

In the Transaction Input there is usally(ERC20) nothing about the name or symbol of the Token, however you can get the address of smartcontract from the Transaction (not Input), and then you can get ...

View answer
Testing Error thrown with hardhat
Accepted answer
4 votes

When I test a function for revert I do the following in my javascript test file (e.g. myContractTest.js): const { expect } = require('chai'); const { ethers } = require('hardhat'); const { BigNumber } ...

View answer
How can I do an internal transfer using OpenZeppelin code?
Accepted answer
1 votes

I think you need to call your contract by your contract so try "this.transfer"... simplified -> the keyword "this" will call the transfer function as an external function and ...

View answer
Openzeppelin test helper with hardhat config and tests
0 votes

Not The answer but a workaround: I was not able to find a solution so I got rid of the openzeppelin's test helpers and used the answer of this question Time-dependent tests with Hardhat? to write my ...

View answer
Offline transaction signing with web3j?
Accepted answer
3 votes

I think something like this should work // Create the Transaction RawTransaction rawTransaction = RawTransaction.createEtherTransaction(<nonce>, <gasPrice>, <gasLimit>, <...

View answer
Are these two equal: web3.eth.getCode(<contract-address>) === type(Contract).creationCode
Accepted answer
1 votes

No, the getCode method gives back the runtime code which is stored on the Blockchain. you can see that in this article: Runtime Bytecode: This is the code that is stored on-chain that describes a ...

View answer
Can a payable function be internal?
Accepted answer
3 votes

No internal and private function can't be declared as payable you will get a compiler error TypeError: "internal" and "private" functions cannot be payable The idea of having ...

View answer
web3 - get contract from transaction object
1 votes

What you are trying to do will never work, find another way :) see the graph protocol or other resources that work to index the blockchain. Back to the Question: There is a difference between from, to,...

View answer
OpenZeppelin test helper: expectEvent.inTransaction error
0 votes

Try this it('expected event is emitted', async function() { const receipt = await this.mycontract.function1(); expectEvent(receipt, 'THIS_EVENT', { message: 'This event has happened.', ...

View answer
Request “eth_sign” result promise never end
Accepted answer
0 votes

I tried it on the console of my browser look like this Connect to metamask and get accounts: let accs; ethereum.request({ method: 'eth_requestAccounts' }).then(res => accs = res); you should take ...

View answer