New answers tagged

0 votes

Why my code is showing error since the syntax is right near error keyword

Your compiler is using an old version that does not support Errors yet. change to 0.8.7 and it will work. Also, avoid using ^. //SPDX-License-Identifier:GPL-3.0 pragma solidity 0.8.7; contract ...
user avatar
  • 2,476
0 votes

How can the smart contract auto execute the function in the Public chain eterscan testnet?

Ethereum Alarm clock might be interesting for your use case, https://ethereum-alarm-clock.readthedocs.io/en/latest/
user avatar
  • 25
0 votes

Geth error: flag provided but not defined

Answer found! So each version of geth has some slightly different commands. For example rpc is now http. I strongly recommend using geth help, as it will provide you with the list of all the commands ...
user avatar
0 votes

How to approve or give permission to access your tokens? Solidity /Metamask?

I have used the approve function and on metamask it shows as "contract interaction". But on your screenshot it shows as "give permission to access.....". So, if you want the same ...
user avatar
0 votes

Claiming rewards in P2E game

You mentioned you tried Chainlink APIs - that should be possible. Not sure where exactly your problem was in sending msg.sender but it should be solvable. Another option would be to have a program ...
user avatar
0 votes

How to calculate gas cost of an ETH transaction in USD?

gasUsed * gasPrice should give you the cost in wei (10^18 wei = 1 ether). So you just need to get the ether price at timeStamp to get the price in whatever fiat you want.
user avatar
  • 29.1k
1 vote
Accepted

Same metamask account with different blockchains

Metamask is an interface to use your private keys. The algorithm used to create addresses by different ETH compatible blockchain is same for a given seed combination. So they all give the same address....
user avatar
  • 26
0 votes

Is there a Blockchain StackOverflow? As in an alternative to stack overflow which is blockchain-based

Peeranha claims to be a decentralised "Decentralized website with questions and answers that rewards users with crypto tokens for their contributions." However it is unclear how much of it ...
user avatar
2 votes

How to get raw binary data from ethereum blockchain?

Run the following commands (with Geth 1.10.18-stable): rm -fR /tmp/foo; geth --syncmode full --datadir /tmp/foo ... ... Imported new chain segment blocks=2 Press Ctrl-C when there are ...
user avatar
  • 21
0 votes

Is there a Blockchain StackOverflow? As in an alternative to stack overflow which is blockchain-based

www.Helix.im is trying to do that now. Basically, partnering with Web3 companies to recruit their existing community members for moderations, and rewarding them for their participation
user avatar
  • 101
1 vote

Facing problem while installing web3 for PyCharm

This question has been asked before and there seems to be a lot of success with the answers posted here: https://stackoverflow.com/questions/40018405/cannot-open-include-file-io-h-no-such-file-or-...
user avatar
  • 11
0 votes

What's the difference between `Trustlessness` and `Decentralized`?

The relationship between trustfulness and decentralized is in how to work a system. You can think about banks. They have a system based on database and it has a single point of failure. Thus, a hacker ...
user avatar
  • 1,528
0 votes

why i'm Showing this error when i fetch Market items?

The errors are due to the missing parentheses on _tokenIds.current vs. _tokenIds.current()
user avatar
  • 412
0 votes

Sign with metamask and send with backend

I have a e-commerce and I use Commerce.js. I never tried but they have a crypo payment chekout. https://commercejs.com/blog/cryptocurrency-payments-at-checkout-with-metamask/
user avatar
0 votes

Can We Transfer Token to The HighestBidder Automatically in NFT- MARKETPLACE Contract? i want this auto

Smart contracts can never execute by themselves. Some entity always has to call them and pay for the gas fees. That entity can either be a user of your marketplace or some backend service of yours. ...
user avatar
0 votes

ProviderError: Error: Transaction reverted: function selector was not recognized and there's no fallback function

I got this error when running this on the hardhat network. Once I switched to a real network like kovan it worked. If you're hitting this error try running against a real network.
user avatar
0 votes

Setup Ganache with Metamask. What and where is a Chain ID?

I think your Metamask already has a local network so delete that network first and then try it. it works for me.
user avatar
0 votes

Get ETH Wallet address list (holder list) given a smart contract address (erc20)

It's not possible to get the holders information directly from the ERC20 contract itself. However there are some services offering their API for querying such info. Covalent offers an API for free. ...
user avatar
0 votes

TypeError: Cannot read property 'length' of undefined - While deploying using hardhat

Thank you Patrick and Sharma. I struggled last few days with the above issue. Now it's resolved. By the way, the video course created by Partick is awesome. Thank you again @PatrickAlphaC.
user avatar
0 votes

Does IPFS require Internet access?

Yes, you can find the docs explaining how it works here: https://docs.ipfs.io/concepts/what-is-ipfs/#what-is-ipfs
user avatar
  • 184
-1 votes

How to get pegged testnet tokens?

Swap the testnet FTM for testnet USDC, or anything else.
user avatar
0 votes

Using "hardhat deploy" plugin, and it is not getting the deployed contracts

Are you sure, you ran your node bevor running this and deployed your contracts on the correct chain? so before getting the contract you need to run your node like yarn hardhat node depending on the ...
user avatar
0 votes

Can someone tell me best De-Fi learning resources

Here I'll list some: The Ethereum oficial documentation. Bankless. How to DeFi book. This article for beginners. Among many other resources, once you start learning join communities on discord focus ...
user avatar
  • 1,164
0 votes

passing array of struct as a function argument and onlyOwner (web3.py) web3.py

def estimateGas_arrayStructData(data,nonce): return web3.eth.estimate_gas(myContract.functions.arrayStructData(data).buildTransaction({ "from":_publicKey, 'chainId' : web3.eth....
user avatar
0 votes

Decode input data in bigquery on polygon

The BigQuery data leaves a lot to be desired, which is part of the reason I made Luabase. Luabase has direct SQL access and already full decodes any contract with verified ABI's. Let me know if you ...
user avatar
  • 101
1 vote

A few queries on Transactions from solidity documentation

If you try to send funds to a null address, Ethereum does not send it to burn address or a null address, instead it mints a new smart contract and send there. In your first question, you are using a ...
user avatar
1 vote

Is there any difference between block.timestamp and now?

There isn't any difference between block.timestamp and now. They're aliases. But note that in Solidity v0.7.0, the now keyword has been deprecated. Thus, from this version onwards, you should use ...
user avatar
  • 1,528
0 votes

What is address(this) in solidity?

'this' is very common construct in most of the programming languages. It basically refers to the object/instance itself which is under execution. So in solidity too it means same.
user avatar
  • 103
1 vote
Accepted

How I can retrieve event logs generated by a contract?

you can listen for events in frontend, I'm assuming you're using ethers for contract interaction, ethers provide helpers for that, e.g. ethers.provider.on(contract.filters.Approval(), (args) => { ...
user avatar
0 votes

How does a miner know when to start mining. Given the miners are geographically dispersed, how all of them start mining together?

miners mine blocks, not individual transactions. they start work on already built blocks. these blocks can include any transactions, as long they are valid and the resulting block is valid, so yes ...
user avatar
0 votes

How can I define USDT as value when sending a transaction

add 6 decimals after the amount of USDT.. if you want to send 10 usdt.. the number is 10000000
user avatar
0 votes

Error "Snapshot extension registration failed" when connecting nodes

I meet this error on the first node (bootnode) too. It seems to result from the private network's bootnode trying to connecting to the nodes in its default bootnode list. Nodes can be correctly ...
user avatar
  • 1
0 votes

Started to learning blockchain from free code camp. Showing this error while compiling

I have deployed a solidity code on blockchain too, exactly like you. I think this example can help you. https://github.com/amiralisahraei/Deploy_smart_contract_on_Rinkeby
user avatar
0 votes

How to change balances from another contract?

You can't directly access the functions of another contract. As you have defined the interface and functions of your second contract you have to instantiate an object or reference to that second ...
user avatar
0 votes

Solidity codes and there Theoretical information

If you don't have a coding background it's probably best just to follow the courses and let them introduce these things as it progresses, but if you need to look things up, the best place to start is ...
user avatar
  • 412
1 vote

Transferring weth from my contract to an other wallet address on polygon without using bridges

Each blockchain (Ethereum and Polygon for example) have their own storages, and cannot be accessed one with other. Its only possible to manage with 3rd party backends that could monitor both ...
user avatar
0 votes

Is it advisable to "wrapped" my tokens in order to use inside my Dapp to lessen gas cost?

Upto what I understand, you want that user's transaction would not be broadcasted to blockchain and would happen just in the server. This could be implemented but this would not make your app ...
user avatar
0 votes

Latest remix version is not detecting metamask

Try to clear cookies of your browser and then start remix. before that backup your all files of remix. Maybe this could help
user avatar
0 votes

Latest remix version is not detecting metamask

this is working on my end right now, but I had similar issues in the past and I was unblocked by using their alpha version : https://remix-alpha.ethereum.org/ . Maybe that can help ;)
user avatar
  • 49
0 votes

Variable declaration

the compiler has an expected layout for the order in which the code is laid out Layout contract elements in the following order: Pragma statements Import statements Interfaces Libraries Contracts ...
user avatar
1 vote

passing array of struct as a function argument and onlyOwner (web3.py) web3.py

Not familiar with web3.py, but have you tried passing them as dicts? data = [ {"data": "node1", "num1": 3123, "num2": 3321, "num3": 3456}, {&...
user avatar
  • 1,099
0 votes

how to identify device on the blockchain

I understand your goal, and it's interesting idea, but any of those "Hardware" data can somewhat easily be faked. And thus malicious actor could abuse your smartContract. Instead, ...
user avatar
  • 636
0 votes

how to identify device on the blockchain

No, this is not possible. The Ethereum protocol has no way of identifying what device was used to generate a transaction. As a matter of fact, a user can sign a transaction on a mobile device and send ...
user avatar
1 vote

Block header structure change under Proof of Stake?

Your question is a bit tricky because it depends on which types of block you speak of. After the merge, the beacon blocks will encapsulate all the info and thus can be considered as "the main ...
user avatar
  • 436
1 vote

Pick Winner Lottery test throws; Error: Transaction has been reverted by the EVM

The problem was that I never set the manager role before I tried picking the winner. It's failing because at the time of calling pickWinner() method, manager address is null, and this would fail from ...
user avatar
0 votes

How to add variable into the string in solidity?

version 0.8.12 or higher function concatA() external pure returns (string memory) { bytes memory extractedStr = '0xFFFF00'; return string.concat('<path d="', string(...
user avatar
  • 412
1 vote

How to add variable into the string in solidity?

Your problem is basically a string concatenation problem. Since Solidity v0.8.12, you concatenate strings easily using: string.concat(s1, s2) You can check solidity docs on strings and bytes for ...
user avatar
  • 77
0 votes
Accepted

publishing blocks with delay

Good question, what happens when blocks are published with a delay? First, you seem to think that delayed blocks aren't valid anymore which isn't the case. Late received blocks remain valid blocks. ...
user avatar
  • 436
0 votes

How to solve Unhandled Rejection (Error): invalid address error with web3 js

Tbh, I don't why it's happening but I found a solution. The problem is using state. At this line, don't use account let tetherBalance = await tether.methods.balanceOf(account).call(); Your code ...
user avatar
  • 1
-1 votes

Pick Winner Lottery test throws; Error: Transaction has been reverted by the EVM

The previous comment was a good observation, indeed. However, if you did not solve the issue, I might have a solution for you. I changed the pickWinner function as per the following: function ...
user avatar

Top 50 recent answers are included