Questions tagged [blockchain]

The Ethereum blockchain is a distributed database based on the Ethereum whitepaper specification and stores both the full transaction list and the most recent state.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Hardhat: Forking enabled=false not working

I want to toggle the forking in my Hardhat config file when running the hardhat network. This is because I want to run with forking locally, but without on Github actions. Defining my hardhat config ...
0 votes
0 answers
9 views

How are BeaconBlocks and BeaconStates interconnected?

After the Ethereum merge took place, the original blockchain merged into the Beacon chain and its data is referenced under the execution_payload field in the class BeaconBlock(...) and the Beacon ...
  • 11
0 votes
1 answer
12 views

How to get network name and chain Id to which metamask wallet is connected using Ether.js library?

Hey I am looking for a solution that I would use in my Dapp to get the network name and the chain Id of the network to which the wallet is connected using Ether.js library. For eg- If my wallet is ...
1 vote
1 answer
12 views

Weird issue with ERC1155

I have write a simple smart contract ERC1155 allow ppl to mint NFTs and everything was ok except for the mint function. The transaction was ok but when i checked the balanceOf it always returned 0 ...
  • 11
0 votes
0 answers
5 views

Cannot remove liquidity [closed]

I deployed a contract to a random guy and transfered the ownership to him, No the guy has been IMA for 2 months and he never transfered the ownership back to me! I have the ownership OG the LP andbi ...
0 votes
1 answer
11 views

I want to track how many times a person has waved to me. What do I need to add then?

Hi I am pretty new to coding and am sometimes getting confused in how to do certain things. In my code, I want to track how many times a person has waved to me. What do I need to add then? here is my ...
0 votes
1 answer
19 views

Hi guys I wrote the following code in solidity to implementing the single point crossover method

When implementing the singlePoint function the child's value is not returned ,I think there is an error in the method of calling the function getValue? can anyone help me? // SPDX-License-Identifier: ...
1 vote
1 answer
21 views

How Do I Find Matching Ethereum Transactions Based On The Amount Of Ethereum Sent?

I am trying to locate a specific transaction on the Ethereum blockchain. I know the approximate amount which was sent, and that it was sent in 2019. I do not know the from address, to address, hash, ...
  • 121
0 votes
1 answer
23 views

Is that true that blockchain can still be centralized?

Contracts can deploy contracts; and There are hidden variables in contracts; and Contract can restrict only the deployer can execute some functions. Thus, I can create a central contract like a ...
1 vote
1 answer
26 views

Is it possible to create a smart contract that recieve a specific BEP20 token from an address, and send it back same amount of an ERC20 token?

Is it possible to create a smart contract that receive a specific BEP20 token named X, from a wallet address, and send it back the same amount of a specific ERC20 token named Y ? of course the smart ...
  • 21
0 votes
2 answers
19 views

Reserves are not changed after swap tokens

I forked Fantom network. And I use UniswapV2Router02, WrappedFtm, Btc contracts deployed on Fantom network in my test scripts. This is test scripits. beforeEach(async () => { [owner, ...
1 vote
1 answer
10 views

Gas adjustment of the smart contract function

I have function which uses for loops on the calldata array as following: mapping (address => bool) public userRegistered; function registerUsers(address[] calldata users) external { for (uint256 ...
0 votes
0 answers
7 views

Get all Nfts of a collection owned by a wallet using alchemy sdk

I am using alchemy sdk , can u please tell me how I can use getNftsForOwner() to get all the nfts owned by a wallet of a particular contract adddress? I need the exact syntax. Thank u
1 vote
1 answer
12 views

How does tokenURI is set in the ERC721 implementation?

Recently, I was studying the ERC721 smart contract and came across something which I coult not understand. Look at the following code - function tokenURI(uint256 tokenId) public view virtual ...
0 votes
0 answers
9 views

cosmos vs ethereum [closed]

we are planning to build a social platform related to nfts so we are doing some research to choose between cosmwasm(cosmos) or ethereum,our concern is that as ethereum have a large user base we might ...
0 votes
0 answers
19 views

Fail with error ‘!Signer’; We were not able to estimate gas. There might be an error in the contract and this transaction may fail

Deployed my smart contract on rinkeby network, it a staking contract. I tried to stake some token I deployed too, it throwed this error: Fail with error '!Signer', Error link. So, I tried to add an ...
1 vote
0 answers
15 views

How to send array of structs using Foundry cast

Smart contract struct NewPrice{ address asset; uint256 timestamp; uint256 price; } function updatePrices(NewPrice[] memory _array) public onlyRole(FEEDER_ROLE) { ...
  • 111
0 votes
0 answers
14 views

Can we modify the state root of contract directly from solidity?

I was learning how optimistic rollup works. Referencing this blog I understand working of optimistic rollup works as: Represent smart contract states as Merkle tree Run all transactions only on the ...
0 votes
0 answers
13 views

Where should I start building optimistic rollup?

I am trying to learn how optimistic rollup works by building one simple sequencer and fraudproof contract for eg: that allows transfer of erc20 only but stuck where should I start. I tried reading the ...
0 votes
0 answers
24 views

web3 staking function in reactjs not displaying staked history

I created a simple dapp with react/truffle/web3 that allows users to enter a number of tokens and submit it to stake it, the problem that I got is that when clicked on submit button, Metamask popup to ...
0 votes
2 answers
25 views

Can I roll multiple transactions into one?

I wonder whether it is possible to roll multiple transactions into one transaction and post it on the chain, similar behavior to L2 chains. I will have a smart contract where there might be a high ...
0 votes
1 answer
15 views

what happens to subscribe event of web3 if something goes wrong?

If network gone, RPC is down, or something like that happen. then what would happen with the subscribe events of web3 js or python. do we need some additional codes to handle crash or subscribe event ...
0 votes
0 answers
18 views

Smart Contracts and BigchainDB

How can I access data stored in blockchain database like BigchainDB using a smart contract in Ethereum?
0 votes
1 answer
23 views

How to check who is the minter of and NFT in ERC1155

I am working on NFT Smart Contract using ERC-1155. So when i list the item for fixedPrice Selling , i have to provide the address of RoyaltyRecipient to whom the royalty would be transfered.This ...
0 votes
1 answer
22 views

How Linearization is possible in first block of code but not in the second block of code?

First block of code // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol"; ...
1 vote
1 answer
17 views

Node modules is not added in the folder after running yarn hardhat

Even after adding the hardhat packages by yarn multiple times, node modules are not showing in the folder. What am I doing wrong?
0 votes
0 answers
9 views

What modifications need to be made to build a public chain with ETH code?

like change mainnet bootnode and first block hash value var MainnetBootnodes = []string{ // Ethereum Foundation Go Bootnodes "enode://...
  • 1
0 votes
1 answer
17 views

Calling function from another contract for Recovery Ethernaut Soultion

I am doing ethernaut Recovery CTF. For that I have to call the '''destroy''' function in another contract. I am doing it will the help of '''call''' in solidity. But the transaction is getting ...
0 votes
0 answers
14 views

How to delegate call from one contract to another contract in different blockchain

My proxy contract and implementation contract are in different blockchains. Can i use delegate call?
  • 1
0 votes
0 answers
16 views

How to read solidity function with tuple data in ether-js

When I call the getLandById function in remix it gives the desired result as you can see in the screenshot Screeshot of remix IDE to get landIdbyId When I call the same function using ether js. it ...
0 votes
1 answer
12 views

how to clear Terminal of Remix IDE?

I want to clear Terminal of Remix IDE like Vs code. If I type clear in vs code terminal, it will clear all previous commands. How do that in Remix Ide? I tried - clear cls but nothing works got this ...
  • 11
3 votes
1 answer
57 views

Where are the blockchain transactions stored?

I'm studying the block structure in several blockchains like Bitcoin or Ethereum. When I started to read about blockchain, many sites and books said that transactions are stored in blocks. Ok, I got ...
  • 31
1 vote
1 answer
24 views

How to create Lazy Minting NFT MarketPlace

i am new to blockchain , trying to implement lazy minting. but still did not succeeded. i read many articles and watch youtube videos , but did not getting the concept of how the lazy-minting is ...
2 votes
0 answers
15 views

How Ethereum client can provide the state of contract variables with Merkle Trees

I'm struggling to understand the whole flow of how retrieving data from the Eth client db(LevelDb/RocksDb) works. So for example, I trigger contract to return value of some field -> what are the ...
  • 31
0 votes
0 answers
14 views

There's no trusted peers even I connected with over 500 peers?

I am running Geth Ethereum node on Linux. This is the command I used to start the node, and the synchronization is finished. nohup geth --http --http.api personal,eth,net,web3,txpool \ --ws --ws....
0 votes
0 answers
22 views

How to get pool id(pid) and smart contracts pool addresses

Hello i need to get list of pids and list of pool addresses from different exchanges like Pancakeswap, Sushiswap, Uniswap : Master Chef, Pancake Pool and than to withdraw reward from them.I know for ...
  • 137
1 vote
0 answers
9 views

Is there a blockchain QR-code model for product traceability? [closed]

I'm looking to make a product traceability application that uses QR-code with blockchain to increase security. I went online looking for a few models but couldn't find them. Does anyone have an idea? ...
1 vote
1 answer
18 views

Forwarding 2300 gas in send method in solidity 0.8.13

Quoting from here - In such a context, there is usually very little gas available to the function call (to be precise, 2300 gas), so it is important to make fallback functions as cheap as possible. ...
  • 11
1 vote
0 answers
13 views

Guidance in connecting multiple machines to a single blockchain

I'm seeking guidance with respect to the execution of a private blockchain. I have created a private blockchain using geth and deployed the contract using truffle. I am looking for a solution that ...
1 vote
0 answers
10 views

Convert FunctionMessage into ABI string using Nethereum

I want to convert FunctionMessage objects into ABI. Is there any function in Nethereum library to do this work or should I do it using reflection ? code example: [Function("balanceOf", "...
1 vote
0 answers
11 views

Js callback is ignored in metamask pay confirmed - if multiple payments in popup

When paying via MetaMask, a situation may arise when there are several unconfirmed payments. The problem is that in this case, when one of the transactions is confirmed, the js callback is ignored. ...
0 votes
0 answers
17 views

Sometime solidity event is not working in react js

useEffect(() => { if (props.blockchain.smartContract != null && props.blockchain.smartContract != undefined && props.users.length != 0) { props.blockchain.smartContract....
1 vote
1 answer
47 views

Function to store the strings from an api in an array and print the strings I want

I have this smart contract: *//SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import '@chainlink/contracts/src/v0.8/ChainlinkClient.sol'; import '@chainlink/contracts/src/v0.8/ConfirmedOwner.sol'...
0 votes
0 answers
5 views

How to call an external api to retrieve data in theGraph?

I have a rest api with mongoDB where store data and execute functionality required for a dApp. However It's very difficult to keep track of the events, especially when the user interacts directly with ...
0 votes
2 answers
16 views

how to import metamask pop-up in my solidity contract?

I am learning solidity and developing a contract. The contract will have the external blockchain wallet address of users (mapped with their username) and this wallet will store NFTs uploaded on my ...
1 vote
1 answer
16 views

Where created contract address come from?

when i creat smart contract i found to address in ganache first sender address,the address which deploy the contract in remix second the created contract address, where come from , what diffirent ...
1 vote
1 answer
17 views

in UniswapV2Pair contract I don't understand Maths behind price0Cummulative and price1Cummulative?

I know TWAP formula = priceDifference / timeElapsed; but still not able to get how uniswapv2 is doing that. https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2Pair.sol#L79
  • 486
1 vote
1 answer
27 views

What is the best way to divide BN by a decimal?

I am using ethers npm library to divide BN by a decimal. The account(0x..) has 10.99999 GLD. const {ethers} = require('ethers'); const token = myGoldContract.balanceOf('0x....').toString(); console....
0 votes
1 answer
12 views

Is it possible to connect 2 geth node using 2 VPS using Linux (Ubuntu)?

I've running my geth node in vps server using ubuntu, first node is mining now. Now I have a new VPS server which is the second vps. How can I connect the first node to the other VPS server? Or I just ...
1 vote
1 answer
40 views

Can we predict the blockhash of next block in Ethereum [duplicate]

After reading this SWC https://swcregistry.io/docs/SWC-120 I was curious how we can predict the blockhash of the next block. Because in the second example, it is saying the contract is vulnerable to ...

1
2 3 4 5
59