Hot answers tagged

2

What is the limit gas for my function? estimateGas will return a reasonably accurate value for your tokenURI method. (If your tokenURI method is very contrived/variable, be aware of What are the limitations to estimateGas and when would its estimate be considerably wrong?) tokenURI method is a bit complex. I don't understand if this is a problem. Users ...


2

The transactions was reverted, which means that everything is rolled back and it's like the transactions never happened. Your account has received the Eth back (or, in fact, it never even left the account). If your wallet still shows the old balance, your wallet is not synchronized properly, or there's some problem with it. The blockchain has the right data, ...


1

no you don't pay any fees when an auction expires. listing an nft as auction is a Gas-Free Action on OpenSea For more info on OS fees see here


1

It's often hard to answer why questions, but I try. A1. Mining difficulty depends on the amount of computational power invested into verifying transactions on the blockchain needed to keep it decentralized and "unhackable". No. The difficulty depends on an algorithm that aims to keep the block production to the frequency defined by design (...


1

This sounds like an effort to revise the business rules after the contract has been deployed. You'll find that difficult or impossible. It would be possible to send a signed txn to a server, but it won't be possible to ensure that users do so when they can go directly to the contract. You can't rely on users using a certain UI or backend to enforce business ...


1

It really depends on the way you implement it. EVM allocates you new memory slots in 256 bit chunks and in order that the state variables are declared. So if you declare them like that: uint32 time; uint256 money; uint32 anotherTime; these variables will take up 3 slots of 256 bit: time will create a first 256 bit slot and take 32 bit in it, money will not ...


1

I think there's two concepts that are relevant here: gasLimit and gasUsed. When you send a transaction, you specify a gasLimit. This is 21,000 by default, but can be modified either manually or by the wallet. GasLimit is the total amount you (the sender) is willing to spend on the trasnaction. GasUsed is the actual amount of gas spent to process the ...


1

This kind of things are simply easiest to try out in something like Remix. I tried all three variants: as-is, explicitly setting i and explicitly setting result . The first two cost the same (25315), and the last one costs 25323. Honestly, I'm really not sure why it's like this.


1

This kind of questions are easiest to just test. So I created a contract in Remix and ran both of the functions. The first a costs 25201 gas and b costs 25260 gas. Therefore it's cheaper to to declare the variable outside the loop. This is most likely because of what you said: the variable gets reallocated. Used contract: contract A { function a() public ...


1

The Ethereum Virtual Machine executes the bytecode that is present on the Ethereum blockchain. Each bytecode has a specific gas price that is defined in the consesus specification and can be looked up in the Ethereum yellow paper (at page 27). When you write Solidity code then solc (the Solidity compiler) will convert this code into YUL, an intermediate ...


1

The array is HUGE This is a problem. Given a json file with pairs containing address: value, i need to update the state of the addresses in my contract This is an implementation idea expressed as a requirement. Since the implementation is impractical, it's time to dig in and find out what the actually requirement actually is. WHY? I would expect to hear ...


Only top voted, non community-wiki answers of a minimum length are eligible