ethereum Questions

2

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 cust...
Luci asked 28/5, 2021 at 14:29

4

Solved

If I only get an Ethereum address from the input, is there a way to find out whether it matches the ERC20 token standard?
Finedrawn asked 28/7, 2017 at 3:6

4

This is my first time on this i hope somebody can understand my grammar and question. I have created 2 nodes using puppeth and choosing Clique for my private Ethereum. Both nodes are sealer (verify...
Bicameral asked 1/5, 2018 at 7:30

4

I created a basic contract. But don't know the withdrawal function. I tried creating a basic function but it doesn't work function withdraw() public { msg.sender.transfer(address(this).balance); }...
Lipoprotein asked 27/7, 2021 at 13:37

6

Solved

My dApp have to connect to MetaMask. There are two rude solutions in the docs: make user to click connect btn every time manually or just pop up connection confirmation after page load. I want to i...
Glassworks asked 19/2, 2022 at 10:29

4

Solved

I am having problems with importing web3 into reactjs. To replicate my problem, initiallize a new react app as so npx create-react-app my-app cd my-app then open terminal in this location. Write: ...
Consistence asked 11/2, 2022 at 18:50

3

Solved

Google has failed to give me an concrete answer, does using the require() function in Solidity use up any gas? Even if the statement in the function is evaluated as true?
Oulu asked 3/1, 2018 at 12:49

3

Solved

What is the use of the new keyword for creating new smart contracts? Why not just omit this keyword?
Teide asked 21/3, 2017 at 12:10

14

Solved

How do I concatenate strings in solidity? var str = 'asdf' var b = str + 'sdf' seems not to work. I looked up the documentation and there is not much mentioned about string concatenation. But it i...
Warden asked 22/8, 2015 at 15:12

2

I have only seen that the mapping variables are declared as storage variables. I'd like to know if I can declare a mapping variable inside the function in Solidity.
Eleen asked 9/6, 2022 at 23:12

5

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 b...
Mihrab asked 20/2, 2022 at 7:31

6

I was trying to follow a tutorial from devto.io and to send transactions to the smart contract, I would need to connect my MetaMask wallet using one of the accounts created when I ran npx hardhat n...
Musette asked 31/10, 2021 at 8:28

5

I want to use web3.js to show revert reason to user, for example in the case of user trying to mint erc721 token that has already been minted. I am using try catch block and see the error message b...
Campanulate asked 30/3, 2021 at 20:27

3

Solved

I have this solidity mapping mapping (string => Ticket) public myMapping; I want to check if myMapping[key] exists or not. How can I check?
Yehudi asked 22/12, 2019 at 22:1

4

Solved

I am new in solidity language. Have seen their documentation. Is there any floating point data type ?
Keys asked 7/10, 2019 at 21:13

3

I want to interact with a smart contract using web3js. Every example will start with following var Web3 = require('web3'); var web3 = new Web3('http://localhost:8545'); // or var web3 = new Web3(ne...
Ruggles asked 15/3, 2018 at 4:10

3

I created a contract instance in hardhat console like so: const contract_fac = await ethers.getContractFactory("ContractName"); const contract = await contract_fac.attach("CONTRACTAD...
Dressmaker asked 7/7, 2021 at 16:29

5

Solved

Trying to work around the blockchain using Ethereum, I'm facing problems when trying to interface with a deployed contract. What I would try to achieve is to call a method to display information ad...
Thumping asked 10/1, 2018 at 10:12

11

I'm learning solidity on remix. I was following some tutorial video on youtube and I've got stuck trying to build 2 contracts. contract ERC20Token has function which increases balances. And Mycontr...
Bibby asked 23/4, 2020 at 13:42

2

Solved

I am trying to create a WalletConnect provider. I am using the @walletconnect/web3-provider package along with Web3Modal for UI. I am instantiating the WalletConnectProvider using my Infura client...
Boykins asked 8/10, 2021 at 10:57

2

I am trying to install "truffle" with npm, but I am not familiar with NodeJS and cant figure out why npm wont install it. I try npm install -g truffle in Powershell with Admin rights and after a fe...
Loy asked 6/9, 2016 at 21:28

2

Solved

I have the following code: const ethereumProvider = ethers.getDefaultProvider(ETHEREUM_RPC); const contract = new ethers.Contract( CONTRACT_ADDRESS, abi, ethereumProvider, ); The ethers packag...

8

I am getting this error message when trying to interact with my smart contract on my react front end. I am running localhost3000 and which requires metamask to sign in. Unhandled Rejection (Error):...
Serendipity asked 22/11, 2020 at 6:25

4

Solved

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 ...
Overriding asked 17/8, 2021 at 20:6

3

Solved

How can I interact with smart contracts and send transactions with Web3.js by having a local private key? The private key is either hardcoded or comes from an environment (.env) file? This is neede...
Selfeducated asked 28/5, 2021 at 9:58

© 2022 - 2024 — McMap. All rights reserved.