We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [gas-refund]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

Deleting structure and gas refund

contract SomeContract { struct ImportantInformation { uint256 a; uint256 b; uint256 c; uint256 d; uint256 e; address f; } ...
0
votes
0answers
20 views

GasToken.io free transaction fails above certain 'threshold'

I've played around with the gastoken.io GST2 contract in remix (and on the mainnet) and immediately stumbled across the following problem: If I want to free previously minted token the execution of ...
0
votes
0answers
23 views

Which are the operations providing gas refund available immediatly for the current running transaction?

Most of gas refund operation aren’t available immediately, but instead increase the refund counter (which if I understand correctly is refunded not after the end of contract creation or call by ...
1
vote
1answer
24 views

Does the 10,000 refund apply to booleans too?

I understand from this thread that you're refunded up to 10,000 gas when setting a value to 0. Does this also apply to boolean values? That is, going from true to false?
0
votes
1answer
63 views

Is there a drawback of setting a too high gas limit for a transaction?

Say, I want to send a transaction that consumes around ~40,000 gas. Could I just set the gas limit of the transaction to 1 million or is there some disadvantage and I should set a more realistic gas ...
0
votes
1answer
39 views

Which `EVM` bytecode is actually used to “deposit” the transferred Ether?

A quick question. Which EVM opcode is actually used to "deposit" the transferred Ether into the contract? From the EVM opcode list, there are only two opcodes related to the fund transfer: balance and ...
2
votes
0answers
31 views

Is the refund gas paid up-front?

Excerpt from chapter 9 of the yellow paper, "Execution Model", describing the behaviour of the EMV when clearing storage: This refund is effectively paid up-front since the initial usage of a ...
0
votes
1answer
66 views

Gas usage higher when using the delete keyword

I'm currently working on a marketplace demo for the consensys bootcamp, you can find my entire code here. Stores inside the marketplace (which are structs) are stored inside a mapping and the keys ...
4
votes
2answers
82 views

Understanding the formal description of a transaction and its associated refunds

Excerpt from page 8 of the yellow paper: I fully understand that contracts can self-destruct and, when that happens, according to this thread, all the balance is refunded to the address specified as ...
1
vote
1answer
155 views

How to use ETH GAS refund in contracts?

How can we use refunded GAS from a transaction in subsequent ETH transfers? In general, how is refunded GAS used? How can we check the status of the amount of refunded GAS?
1
vote
1answer
57 views

How to use / see refunded gas in ETH blockchain?

I buy a GAStoken contract which requires say 21000 GAS at 1 Gwei and later when we delete/destroy the contract when the Gwei is around 50. I understand that we will get around 50% refund of GAS at the ...
1
vote
4answers
81 views

Is our smart contract required gas,every time it executes.

form my understandings, after the first execution of a smart contract, the network will return the remaining gas to the contract sender. if so, how will the contract obtain gas for future execution??...
1
vote
1answer
93 views

is there any way to have a permanent refund contract for ERC20 tokens?

Im a newbie when it comes to Ethereum but from what I gather, there is a type of crowdsale where if the goal is not met, the investors can send back their tokens and get a refund. However, this is ...
1
vote
0answers
263 views

Paying for gas on behalf of users?

I'm exploring ways to enable contracts/dApp owners to pay for gas on behalf of users. I know contact abstraction should enable this eventually, and the first step has been done with EIP208 which ...
0
votes
1answer
39 views

storage gas refund, is gas only refunded when storage is completely deleted? What if a key / value in a mapping is deleted?

I have a which tracks ids for some structs for different users. mapping (address => uint[]) usersStuff This mapping for each user can grow or shrink. If it happens to shrink to 0 for a single ...
1
vote
2answers
119 views

Refunding gas fomula in Ethereum yellow paper

After execution of the transaction by miner, the transactor is refunded a remaining gas. it is explained in section 6 of Ethereum's yellow paper. When calculating the amount to be refunded gas, the ...
1
vote
2answers
343 views

How can I claim a refund from a failed ICO (Watertech)

My questions is about claiming a refund from a failed ICO. The ICO in question is WaterTech and the token is WATR
2
votes
2answers
399 views

Resetting storage slot increases gas usage although should decrease it

I have a simple contract that deletes the last element of the array: pragma solidity^0.4.11; contract GasRefundTest { uint[] myArray = [1, 2]; function deleteLastElem() public returns(...
0
votes
2answers
5k views

ICO refund: “Insufficient funds…account you tried to send transaction from does not have enough funds” [duplicate]

EDIT: Please note that this concern revolves around the "Contracts" portion of MyEtherWallet. I'm not trying to send funds from my account, I'm trying to recover funds for a failed ICO using the ...
0
votes
2answers
734 views

Can't claim EOS tokens. Problem with GAS amount when claim EOS tokens

To make story short,I participated in 167 EOS distribution period, so i've sent ETH amount to their account 0xd0a6E6C54DbC68Db5db3A091B171A77407Ff7ccf. Then i've registered my public EOS key and right ...
1
vote
1answer
86 views

ClaimRefund Process

One of the PreICO is cancelled so they are providing me refund of my ETH. They are asking me to enter their ABI/JSON and ClaimRefund through myether wallet under my login. Can using the Claimrefund ...
0
votes
0answers
267 views

Obtaining Gas and Gas Price Solidity

I added the following two lines of code to my function: uint gas_remaining = msg.gas; //irrelevant code.... refund = refund + ((gas_remaining - msg.gas) * tx.gasprice); For some reason this is ...
4
votes
0answers
106 views

Autorefill isn't working on Improved Coin code

I've been trying to write a token contract with the autorefill function, but perhaps the code for the token example on the ethereum website is somewhat outdated, because it isn't working. Did anybody ...
8
votes
2answers
653 views

Why does delete increase overall gas cost?

My understanding is there is a gas refund for delete and the idea is to encourage developers to remove garbage from contract states. Consider this contract with a delete-enabled index of keys to ...
3
votes
0answers
217 views

How to send custom tokens without ether? [duplicate]

I would like my customers to send a custom token without thinking of a certain amount of ether for gas. So I've tried the standard-token at ethereum.org. There's a way described to auto refill the ...
6
votes
1answer
2k views

Is it possible to refund or cancel a contract based wallet transaction?

Is it possible to refund/cancel transactions? I have sent Ether to a merchant and the funds are away from my wallet, but the merchant said I used a wrong wallet... (I sent from my contract wallet ...
6
votes
2answers
2k views

How to know, inside the contract function, the amount of gas that will be refunded in the end

Consider the following situation: my function can be divided into 2 parts Always consumes constant gas; Always results in a refund of 0 < R < 1500000 gas. After the second part had happened, ...
17
votes
1answer
6k views

How to clear large arrays without blowing the gas limit?

As posted by redditor ethererik in the post GovernMental's 1100 ETH jackpot payout is stuck because it uses too much gas, 1,100 ethers are stuck in limbo because the payout of this GovernMental ...
14
votes
3answers
725 views

How come I need to specify a higher gasLimit than estimateGas?

If a contract call predictably requires 41043 of gas to be processed as estimated by estimateGas, how come I need to specify gasLimit of ~70000 to be processed?
5
votes
1answer
726 views

How can contracts be designed to use gas refunds?

A transaction may have some gas refunds, but such refunds can only be used within the transaction: the gas refund is not converted to ether and refunded to the sender's account. How can contracts be ...
17
votes
3answers
3k views

What are the limits to gas refunds?

Gas refunds are provided when clearing storage or calling SELFDESTRUCT on contracts. The Yellow Paper mentions that refunds are "being capped up to a maximum of half...". What exactly is this "half" ...
21
votes
2answers
1k views

What type of operations have negative gas costs?

I understand that some operations cost negative gas because they free up space on the blockchain, such as selfdestructs. What are all the operations that can have negative gas? Does this only occur ...