Skip to content

Lesson 9: Why is gas not added to the ending balance when comparing with assert #1408

Answered by alymurtazamemon
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

@woojiq In the fund me contract, the deployer account was calling a withdraw function and that's why gas was deducted from the deployer account. But in the raffle case, fulfillRandomWords was called by the Chainlink node and we already paid them a fee for it. That calling triggered the event and we select the winner, so the fee was never deducted from the winner's account that's why we did not calculate like the fund me contract.

Hope it clears your query.

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
9 replies
@krakxn
Comment options

@ghost
Comment options

@krakxn
Comment options

@ghost
Comment options

@krakxn
Comment options

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
1 reply
@ManuWeb3
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants