can somebody check my understanding on DApps and smart contracts in general? (Please excuse the long winded-ness I’ve only been reading about DApp’s for 3 days now so I’m very new and I’m kind of walking myself through how it works as I’m talking about)
My current understanding of smart contracts says that when any processing takes place on the EVM, there’s a certain amount of gas required for the work done. That gas is paid in a certain amount of ETH, determined by whomever initiated the transaction.
This makes sense to me in regular ETH transactions and smart contracts. In order to run your code or send your ETH you pay a small fee for the work done to make that transaction happen. Cool. That’s not much different from bitcoin.
But then when you add DApps and, by extension, tokens into the mix, it gets a little more complicated.
Let’s say I have a DApp that runs a decentralized version of Runescape or something. Let’s say the DApp uses RUNE as it’s token.
In the RuneScape DApp’s ico, I set some arbitrary amount to be what RUNE is worth in ETH. People buy a bunch of RUNE using ETH and all of this ETH is stored in the contract itself, which is then itself used as gas to fuel the DApp on the platform.
The RUNE token allows certain utility on the RuneScape DApp, such as allowing the use of certain spells or dungeons or whatever. This utility can be converted into real-world value (entertainment value in this case), and thus the RUNE token is worth something. The token can be mintable or non-mintable depending on the architecture of the DApp.
Once people have access to the token and circulation becomes regulated, the market will begin to determine the value of these tokens. At this point you have your fully fledged erc20 token and DApp.
Is this correct? Or do I have something mixed up somewhere?
Also, how does one ensure that their DApp doesn’t have the gas in the contract expended if no more ETH is being added to the contract in the case of a non-mintable token?