I am a beginner to solidity and I came across this concept called "Low-Level Calls". What exactly is a Low-level function? and How is it different from others?
[Ethereum] Low Level Calls in Solidity
remixsolidity
remixsolidity
I am a beginner to solidity and I came across this concept called "Low-Level Calls". What exactly is a Low-level function? and How is it different from others?
Best Answer
In Solidity, the
address
object has a method namedcall()
through which you can call every function you want, and if the address implements it, it will be triggered.For example:
You can also use this syntax:
Here, you forward some ETH and gas. The variable
data
is something like this:The first 4 bytes after the
0x
symbol represent the function signature - the first 4 bytes of the function signature after encoding it with the keccak256 hash function. In this case, it is the first 4 bytes ofEverything after that is the representation of the calldata which will be parsed as the function arguments.