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
0 votes
0 answers
17 views

External function use cases [duplicate]

What is the main purpose / family of use-cases for the existence of external functions in solidity? Why would I want to restrict function accessibility so that it's impossible to call it from the ...
user avatar
0 votes
1 answer
17 views

Internal function use cases

What is the main purpose / family of use-cases for the existence of internal functions in solidity?
user avatar
1 vote
0 answers
37 views

What the this keyword means?

im doing the ethernaut course. what does this mean ? I know what for exemple address(this)means, it s the address of the smart contract but like what does it means when the this is alone like this?
user avatar
  • 13
1 vote
2 answers
186 views

How to send Ethereum to smart contract address without using keyword "payable"?

I have tried to send Ethereum from my wallet to the smart contract address by using the below code: pragma solidity >=0.6.10; contract NoUsePayable { function getBalance() public view returns (...
user avatar
1 vote
1 answer
2k views

What is the difference between the abstract and virtual keywords in Solidity?

Solidity has the keywords abstract and virtual. What is the difference?
user avatar
1 vote
1 answer
717 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?
user avatar
0 votes
1 answer
82 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 ...
user avatar
1 vote
1 answer
123 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?
user avatar
23 votes
3 answers
6k 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?
user avatar
18 votes
2 answers
10k views

What is the immutable keyword in Solidity?

What is the immutable keyword in Solidity and how do I use it?
user avatar
27 votes
1 answer
22k views

What is the receive keyword in solidity?

Solidity has a receive keyword. What is it and how do I use it?
user avatar
1 vote
1 answer
51 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 ...
user avatar
41 votes
1 answer
35k views

What are the virtual and override keywords in Solidity?

Solidity 0.6.0 introduced the keywords virtual and override. What do they do?
user avatar
17 votes
1 answer
11k 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?
user avatar
107 votes
2 answers
43k 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 that take dynamic types like 'structs' or 'arrays'. When ...
user avatar