6 Posts
CODING/SOLIDITY
Setter and Getter Functions Writing Transactions : Transactions Reading Transactions: Call Calls are against a local blockchain node Remember: Everyone has a copy of the blockchain If you don't need to change anything, you don't need to inform other participants Reading is virtually free View/Pure Function Earlier called a "constant" function View Function: Reading from the State and from other ..
In this project, you are going to implement a simple messenger functionality in a Smart Contract. Through the constructor make sure you write the address that deployed the contract to a variable Create a message-variable of the type string, that only the deployer-address can update Create a counter, to see how many times the variable was updated. Sample Solution¶ Of course, you're not left in th..
The Solidity Constructor¶ One thing we haven't really talked about yet is the constructor. It's something you need to understand before we proceed! The constructor is a special function. It is automatically called during Smart Contract deployment. And it can never be called again after that. It also has a special name! It's simply called constructor() { ... }. Let's see how that works to our adv..
Writing And Reading Functions - View vs Pure - Become Ethereum Blockchain Developer Writing, View and Pure Functions So far, we have mostly interacted and modified state variables from our Smart Contract. For example, when we write the address, we modify a state variable. When we update an uint variable, we also modify the state. For this ethereum-blockchain-developer.com Writing, View and Pure ..
One type, which is very specific to Ethereum and Solidity, is the type "address". Ethereum supports transfer of Ether and communication between Smart Contracts. Those reside on an address. Addresses can be stored in Smart Contracts and can be used to transfer Ether from the Smart Contract to to an address stored in a variable. That's where variables of the type address come in. In general, a var..
Strings are actually Arrays, very similar to a bytes-array. If that sounds too complicated, let me break down some quirks for you that are somewhat unique to Solidity: Natively, there are no String manipulation functions. No even string comparison is natively possible There are libraries to work with Strings Strings are expensive to store and work with in Solidity (Gas costs, we talk about them ..