Questions tagged [keyword]

Keywords are special words used as identifiers by a language. They are reserved words accepted by a compiler or interpreter, and thus should not (or cannot) be used as a variable or function name.

Filter by
Sorted by
Tagged with
12
votes
1answer
2k views

When should I use calldata and when should I use memory?

I have seen people use both memory and calldata keywords when writing Solidity. Specifically, they are used when declaring function parameters. When should I use memory and when should I use calldata?...
9
votes
1answer
3k views

What are the virtual and override keywords in Solidity?

Solidity 0.6.0 introduced the keywords virtual and override. What do they do?
6
votes
1answer
890 views

Is it possible to perform a try-catch in Solidity?

Does Solidity support try-catch functionality? If so, how does it work? What are the limitations?
3
votes
1answer
1k views

What is the receive keyword in solidity?

Solidity has a receive keyword. What is it and how do I use it?
2
votes
1answer
458 views

What is the immutable keyword in Solidity?

What is the immutable keyword in Solidity and how do I use it?
1
vote
1answer
141 views

What is the difference between the constant and immutable keywords in Solidity?

What is the difference between the constant and immutable keywords in Solidity and how do I use them?
1
vote
1answer
16 views

How to set time based function in solidity? [duplicate]

I want to run a function after every 365 days in Solidity. I have tried to use the now keyword, but it is not working (I tried in Remix). How can I get the time?
1
vote
1answer
27 views

Why does Solidity not use the years keyword?

Solidity has keywords like seconds, minutes, hours, days and weeks that are used to specify units of time. Why do they not have years?
1
vote
1answer
27 views

How keccak hashing and for loop happening in pure function?

I put a keccak hashing inside pure function, it works and return me the result.It also works in a for loop. I studied that hashing the data and loop consumes consider amount of gas. Do we need to ...
0
votes
1answer
34 views

Is there an “in” keyword in Solidity similar to Python? [duplicate]

I understand that "in" is a reserved keyword in the Solidity language (for now) but can it be used like the "in" keyword is used in the Python language? That is can it be used to find a specific value ...