Network
Launch Date
Consensus
Note
Sepolia
Oct 2021
PoW
Like-for-like representation of Ethereum
Görli
Jan 2019
PoA
Proof-of-Authority
Kiln
Mar 2022
PoS
Post-Merge (for ETH2), shadow fork of the mainnet
Kintsugi
Dec 2021
PoS
DEPRECATED, use Kiln; post-Merge (for ETH2)
Ropsten
Nov 2016
PoW
DEPRECATED, use Sepolia; the Merge to happen on Jun 8, 2022
Rinkeby
Apr 2017
PoA
DEPRECATED, use Görli and Görli Faucet
Kovan
Mar 2017
PoA
DEPRECATED, use Sepolia or Görli
List of active and deprecated Ethereum testnets, including Kintsugi.
Features
Optimistic rollup 
ZK-rollup 
Proof
Uses fraud proofs to prove transaction validity. 
Uses validity (zero-knowledge) proofs to prove transaction validity. 
Capital efficiency
Requires waiting through a 1-week delay (dispute period) before withdrawing funds. 
Users can withdraw funds immediately because validity proofs provide incontrovertible evidence of the authenticity of off-chain transactions. 
Data compression
Publishes full transaction data as calldata to Ethereum Mainnet, which increases rollup costs. 
Doesn't need to publish transaction data on Ethereum because ZK-SNARKs and ZK-STARKs already guarantee the accuracy of the rollup state. 
EVM compatibility
Uses a simulation of the Ethereum Virtual Machine (EVM), which allows it to run arbitrary logic and support smart contracts. 
Doesn't widely support EVM computation, although a few EVM-compatible ZK-rollups have appeared. 
Rollup costs
Reduces costs since it publishes minimal data on Ethereum and doesn't have to post proofs for transactions, except in special circumstances. 
Faces higher overhead from costs involved in generating and verifying proofs for every transaction block. ZK proofs require specialized, expensive hardware to create and have high on-chain verification costs. 
Trust assumptions
Doesn't require a trusted setup. 
Requires a trusted setup to work. 
Liveness requirements
Verifiers are needed to keep tabs on the actual rollup state and the one referenced in the state root to detect fraud. 
Users don't need someone to watch the L2 chain to detect fraud. 
Security properties 
Relies on cryptoeconomic incentives to assure users of rollup security. 
Relies on cryptographic guarantees for security. 
Start building
on Alchemy.
Sign up for free
Start building on Optimism.
Sign up for free
Start building on Arbitrum.
Sign up for free
Start building on Ethereum.
Sign up for free
Start building on Polygon.
Sign up for free
Start building on Starknet.
Sign up for free
Start building on Flow.
Sign up for free
kiln faucet
Get free Kiln ETH.
Start building today
Goerli faucet
Get free Goerli ETH.
Start building today
mumbai faucet
Get free Mumbai Matic.
Start building today
rinkeby faucet
Get free Rinkeby
ETH.
Start building today
Start building on Ethereum.
Get started for free
Start building on Ethereum.
Get started for free
Start building on Flow.
Get started for free
Start building on Polygon.
Get started for free
Start building on Starknet.
Get started for free
Start building on Optimism.
Get started for free
Start building on Solana.
Get started for free
Start building on Solana.
Sign up for beta access
Start building on Solana.
Join the waitlist
Arbitrum logo
Start building on Arbitrum.
Get started for free
Learn
Solidity at
Alchemy
University
Get started today
curl 
https://release.solana.com/v1.10.32/solana-install-init-x86_64-pc-windows-msvc.exe 
--output 
C:\solana-install-tmp\solana-install-init.exe 
--create-dirs
Learn Solidity
CALL FUNCTION OVERVIEW

What is the Solidity call function?

Learn How Solidity Call Functions Work
Last Updated:
October 4, 2022
Table of Contents
Table of Contents
Table of Contents

{{learn-solidity}}

The Solidity programming language is primarily used to create smart contracts on the Ethereum blockchain. This article will cover all the details you need to know about what a Solidity call function is.

What is the Solidity call function?

The call function in Solidity is a low level function developers use to interact with other contracts.

When building a Solidity smart contract, the call method should be used anytime you want to interact with another contract from your own contract.

Calls can also be used to execute other functions in the recipient smart contract, using Ether provided by the caller to pay for the transaction. The call function also has the advantage of returning the transaction status as a boolean with the return value sent as a variable.

What is calldata?

Calldata is a type of temporary storage, containing the data specified in a function’s arguments. The difference between it and memory, another type of temporary storage, is that calldata’s immutability—whatever is stored inside calldata cannot be changed.

How does the Solidity call function work?

The Solidity call function works by taking calldata, which can be zero in the case of a native ETH transfer, and executing that calldata on the intended recipient based on the low-level EVM opcode CALL.

When data (i.e. the function to be called in recipient smart contract) and gas are provided, the call method is able to use these two to execute functions inside smart contracts.

How do you use the call method to send Ether?

As one of your Solidity functions, you can use the following code into your Solidity IDE of choice and replace the address payable _to with the recipient address.



contract SendEther {
	function sendViaCall(address payable _to) public payable {
  	// Call returns a boolean value indicating success or failure.
    (bool sent, bytes memory data) = _to.call{value: msg.value}("");
    require(sent, "Failed to send Ether");
   }
  }
  

Below is code which creates a contract that is capable of receiving Ether from calls.



contract ReceiveEther {
	// Function to receive Ether. msg.data must be empty
  receive() external payable {}‍
  
  // Fallback function is called when msg.data is not empty
  fallback() external payable {}‍
  
  function getBalance() public view returns (uint) {
  	return address(this).balance;
   }
  }

What's the difference between call and delegatecall?

The difference between call and delegatecall is that delegatecall will execute the called function as if its code was entirely part of the smart contract that is doing the calling. In contrast, the call method will call the function as it is, as a part of another smart contract. In practice, this means the called function will use the caller's storage, msg.sender, and msg.value.

What's the difference between call and transfer?

Transfers have an unchangeable gas limit and will cancel on failure. Calls have a customizable gas limit by using someAddress.call.value(ethAmount).gas(gasAmount)() in place of the usual call will return false if the transaction fails.

The transfer method is no longer a recommended to use. However, historically, transfer was preferred because it uses a built-in limit on gas, which helped prevent reentrancy exploits. The immutable gas limit on the transfer method also made it a better choice for computations where you wished to set an upper limit of 2300 gas.

How to Learn More About the Solidity Call Method

To continue learning about Solidity calls, secure your spot in Alchemy University's free, online Solidity developer crash course. This 7-week, asynchronous Ethereum bootcamp has been redesigned after Alchemy's acquisition of the leading Ethereum education company, ChainShot.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

ALCHEMY SUPERNODE - ETHEREUM NODE API

Scale to any size, without any errors

Alchemy Supernode finally makes it possible to scale blockchain applications without all the headaches. Plus, our legendary support will guide you every step of the way.

Get started for free
Supernode footer
Learn Solidity
CALL FUNCTION OVERVIEW

What is the Solidity call function?

Learn How Solidity Call Functions Work
Last Updated:
October 4, 2022
Don't miss an update
Sign up for our newsletter to get alpha, key insights, and killer resources.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Table of Contents

The Solidity programming language is primarily used to create smart contracts on the Ethereum blockchain. This article will cover all the details you need to know about what a Solidity call function is.

What is the Solidity call function?

The call function in Solidity is a low level function developers use to interact with other contracts.

When building a Solidity smart contract, the call method should be used anytime you want to interact with another contract from your own contract.

Calls can also be used to execute other functions in the recipient smart contract, using Ether provided by the caller to pay for the transaction. The call function also has the advantage of returning the transaction status as a boolean with the return value sent as a variable.

What is calldata?

Calldata is a type of temporary storage, containing the data specified in a function’s arguments. The difference between it and memory, another type of temporary storage, is that calldata’s immutability—whatever is stored inside calldata cannot be changed.

How does the Solidity call function work?

The Solidity call function works by taking calldata, which can be zero in the case of a native ETH transfer, and executing that calldata on the intended recipient based on the low-level EVM opcode CALL.

When data (i.e. the function to be called in recipient smart contract) and gas are provided, the call method is able to use these two to execute functions inside smart contracts.

How do you use the call method to send Ether?

As one of your Solidity functions, you can use the following code into your Solidity IDE of choice and replace the address payable _to with the recipient address.



contract SendEther {
	function sendViaCall(address payable _to) public payable {
  	// Call returns a boolean value indicating success or failure.
    (bool sent, bytes memory data) = _to.call{value: msg.value}("");
    require(sent, "Failed to send Ether");
   }
  }
  

Below is code which creates a contract that is capable of receiving Ether from calls.



contract ReceiveEther {
	// Function to receive Ether. msg.data must be empty
  receive() external payable {}‍
  
  // Fallback function is called when msg.data is not empty
  fallback() external payable {}‍
  
  function getBalance() public view returns (uint) {
  	return address(this).balance;
   }
  }

What's the difference between call and delegatecall?

The difference between call and delegatecall is that delegatecall will execute the called function as if its code was entirely part of the smart contract that is doing the calling. In contrast, the call method will call the function as it is, as a part of another smart contract. In practice, this means the called function will use the caller's storage, msg.sender, and msg.value.

What's the difference between call and transfer?

Transfers have an unchangeable gas limit and will cancel on failure. Calls have a customizable gas limit by using someAddress.call.value(ethAmount).gas(gasAmount)() in place of the usual call will return false if the transaction fails.

The transfer method is no longer a recommended to use. However, historically, transfer was preferred because it uses a built-in limit on gas, which helped prevent reentrancy exploits. The immutable gas limit on the transfer method also made it a better choice for computations where you wished to set an upper limit of 2300 gas.

How to Learn More About the Solidity Call Method

To continue learning about Solidity calls, secure your spot in Alchemy University's free, online Solidity developer crash course. This 7-week, asynchronous Ethereum bootcamp has been redesigned after Alchemy's acquisition of the leading Ethereum education company, ChainShot.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

The Solidity programming language is primarily used to create smart contracts on the Ethereum blockchain. This article will cover all the details you need to know about what a Solidity call function is.

What is the Solidity call function?

The call function in Solidity is a low level function developers use to interact with other contracts.

When building a Solidity smart contract, the call method should be used anytime you want to interact with another contract from your own contract.

Calls can also be used to execute other functions in the recipient smart contract, using Ether provided by the caller to pay for the transaction. The call function also has the advantage of returning the transaction status as a boolean with the return value sent as a variable.

What is calldata?

Calldata is a type of temporary storage, containing the data specified in a function’s arguments. The difference between it and memory, another type of temporary storage, is that calldata’s immutability—whatever is stored inside calldata cannot be changed.

How does the Solidity call function work?

The Solidity call function works by taking calldata, which can be zero in the case of a native ETH transfer, and executing that calldata on the intended recipient based on the low-level EVM opcode CALL.

When data (i.e. the function to be called in recipient smart contract) and gas are provided, the call method is able to use these two to execute functions inside smart contracts.

How do you use the call method to send Ether?

As one of your Solidity functions, you can use the following code into your Solidity IDE of choice and replace the address payable _to with the recipient address.



contract SendEther {
	function sendViaCall(address payable _to) public payable {
  	// Call returns a boolean value indicating success or failure.
    (bool sent, bytes memory data) = _to.call{value: msg.value}("");
    require(sent, "Failed to send Ether");
   }
  }
  

Below is code which creates a contract that is capable of receiving Ether from calls.



contract ReceiveEther {
	// Function to receive Ether. msg.data must be empty
  receive() external payable {}‍
  
  // Fallback function is called when msg.data is not empty
  fallback() external payable {}‍
  
  function getBalance() public view returns (uint) {
  	return address(this).balance;
   }
  }

What's the difference between call and delegatecall?

The difference between call and delegatecall is that delegatecall will execute the called function as if its code was entirely part of the smart contract that is doing the calling. In contrast, the call method will call the function as it is, as a part of another smart contract. In practice, this means the called function will use the caller's storage, msg.sender, and msg.value.

What's the difference between call and transfer?

Transfers have an unchangeable gas limit and will cancel on failure. Calls have a customizable gas limit by using someAddress.call.value(ethAmount).gas(gasAmount)() in place of the usual call will return false if the transaction fails.

The transfer method is no longer a recommended to use. However, historically, transfer was preferred because it uses a built-in limit on gas, which helped prevent reentrancy exploits. The immutable gas limit on the transfer method also made it a better choice for computations where you wished to set an upper limit of 2300 gas.

How to Learn More About the Solidity Call Method

To continue learning about Solidity calls, secure your spot in Alchemy University's free, online Solidity developer crash course. This 7-week, asynchronous Ethereum bootcamp has been redesigned after Alchemy's acquisition of the leading Ethereum education company, ChainShot.

If developers are new to development in general, Alchemy University's 3-week JavaScript crash course is a great prerequisite before starting an Ethereum bootcamp.

Build web3 with Alchemy

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get started for free