Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
All right.
Now, you have deployed your first smart contract.
You know what is in the compile tab.
You have the right compiler, which is the same as in the primer line.
If auto compile on and we ran our transaction in the deploy and run transaction tab on the JavaScript
VM.
Now all of this is fine, but we didn't change anything.
We didn't do anything with our smart contract, which is deployed a smart contract.
And in this video I want to go and actually change that string to something we can input as a user after
the Smart contract is deployed, of course.
So I'm going to revert this to Helloworld and we are going to add an additional function over here.
We make this a little bit bigger
function.
Every function starts with a keyword function and then we say, update our string.
This one will get one argument that is another string.
And in this case, it's important to add the memory location.
More on that a little bit later.
And we are having an updated string.
I like to make this underscores there that you maybe have seen and some of the.
Code that is out there.
And the reason for that is if you are interacting with outside JavaScript, then it becomes a distinct
difference between getting writing a variable or reading a variable from solidity to the outside world
with the underscore, then directly inside JavaScript.
That is just my style.
I think there is that there is a style guide for this and I don't think it doesn't mention anything
about underscores or so anyway.
So you can name this variable you have of the type string, it's strictly typed and you even have to
give it a location, which in this case is a memory location, which just means that it is our working
horse cheap memory that this variable resides in.
Now we also have to give it a visibility.
More on that again later on when we are writing the first project.
In this case, it is public.
It is not going to return anything because inside solidity you cannot really return anything to the
outside world.
You need to events for that.
Also, we are going to talk about this more in-depth and then we are ready to update our string.
To update string.
Great.
You see, everything still compiles and when we hit deploy, then we can see.
And here in our instance, we have now two different buttons.
One is for the Helloworld and the other one is to update our string.
That actually requires us an input field.
So if you just hit update, it still does it, and then it will overwrite the string with an empty string.
And if we can also make this a little bit bigger so it's more clear what is going on here.
And then we can just say hello from earth and then hit transect and then our string is updated to hello
from Earth.
Now again, you can see everything here is with a call against a blockchain node.
The blockchain or in this case is the JavaScript environment.
So there is no real blockchain node.
You're directly interacting with your browser here, and you can also see that there is one thing with
a little check mark and the other one with a little call.
That's a major difference between a writing transaction, something that would actually cost you money
to get mined.
It's to be sent to the transaction pool.
Then a miner needs to pick it up and then it gets mined and it gets baked into the blockchain.
And the call I call is a reading transaction.
It is still a transaction, but it's virtually free because it's against your blockchain node.
And every blockchain node that is participating in the network has the same information.
It's basically the whole point of the decentralized part of this decentralized ledger.
So everyone has the same kind of information running on this machine, and in your case, you don't
need to query any other thing.
You basically have a copy of the whole ledger and you can directly look into it, but it's still a transaction,
it's just a free of charge, and that's called a call.
If you open it up, you can see that this is from address.
It goes to a specific address and has an execution cost.
Doesn't really matter because it's a call.
But over here with a transaction, you have an execution cost which is in gas, which is very much like
like very much like kilowatt hours for electricity, which you then pay with money.
The whole idea there is the same.
It's an abstraction.
More on that a little bit later.
And you have data that goes in, data that goes out logs and so on and so forth.
And that's the point of this this video here to tell you a little bit more about how you interact with
your smart contracts, how you read and write to smart contracts, what is the difference between a
reading and writing function?
And with this, we can, yeah, conclude our solidity basics and remix and environment section and we
are going into an actual project.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.