What are Smart Contracts?
“Wei” is the smallest unit of Ether, where 10¹⁸ Wei represents 1 Ether. One gwei is 10⁹ wei, and there are 10⁹ gwei per Ether.
By multiplying the gas price by the gas limit, you'll get the maximum amount of Ether you're willing to spend on gas fees for any particular transaction.
Learn about gas execution
When a smart contract call is made, the call (or transaction) will attempt to use the gas provided while the program is executed.
- If the call succeeds, the unused gas will be returned to the sender.
- If the call fails because it ran out of gas, the entire transaction will revert, undoing all changes to the blockchain. None of the gas will be returned, since it will all have been used up during the computation process.
A portion of gas fees from a successful transaction will be burned (or removed from the total supply) according to the new EIP-1559 spec, and the rest will be sent to the miner that added your transaction to the blockchain.
Where To Next?
If you've made it to this point, it's time for a self-congratulatory pat on the back! This might be the end of our introductory web3 course, but it's just the beginning of your blockchain development journey. From DeFi to DAOs to novel blockchains with new technologies, there's so much still to build it's staggering.
There's plenty more useful content out there, both on this website and across the entire internet that will guide you towards the highest-quality curated tools in the entire ecosystem!