I created a simple contract that allows for token initialization during deployment and enables transfers to other addresses using MetaMask. When sending the token, there is a 10% tax - 5% goes to the marketing wallet, 2% covers development costs, and 3% is burned. #solidity#ETH
Payable Function
In the function have to pay ether to the transaction.
To update name using function payable have to give value for every update.
#solidity#ether#ethereum
Write,View and Pure Functions
view - can access storage variable outside of the scope. it can read only.
pure - can't access storage variable outside of the scope. it has write access.
#solidity#ethereum#ether
Message
msg.sender is a address of the person who interact with the contract.
msg is a public object, it has many property and one of the property is sender.
#solidity#ethereum#ether
Signed Integer
it can have negative values and default value 0.
limit (-2^128 to (+2^128)-1).
Unsigned Integer
it have only positive values. it has default value 0.
limit (0 to + (2^256)-1).
Below image have increment and decrement of both signed and unsigned integer
#solidity
Boolean
In the Solidity language, assigning the value 0 to a bool variable results in the variable being set to true. Assigning the value false to the variable sets it to false. If no value is assigned to the variable, it defaults to false. #solidity#ether
To Run Solidity Program we are going to use Remix.ide.
it an online integrated development environment (IDE).
It similar to vscode. And it really meant for solidity development. #finstien#solidity#ether
Array and mapping
1. Arrays in Solidity has operations such as push, pop, delete, and remove.
2. Mappings in Solidity are a way to create a data structure that maps unique keys to specific values.
It is also possible to create nested mappings in Solidity
#finstein#solidity
Topic that i have learned in CryptoZombies Lesson 2.
1.Mapping.
2.Address.
3.Require.
4.msg.sender.
5.Inheritance.
6.import.
And Struck chapter 7 with some error and few more chapters to complete in lesson 2 .
#finstein#solidity#Ether
Today learn about solidity global variables and function modifier.
global variables like
1. block.gaslimit .
2. msg.sender.
3.msg.value.
4.block.number.
5.block.chainid.
6.block.timestamp.
And yet to start #CryptoZombies Lesson 2.
#finstein#solidity#ether#coins
I have completed the Cryptozombies exercises in Solidity up until the 12th exercise. I am currently stuck on the 13th exercise, and I still have two more exercises to complete. #Solidity#blockchain#finstein