No More Goerli Faucets! Using the New Infura Sepolia Faucet for Ethereum Smart Contract Testing
Tags: web3, testing, ethereum, webdev
Published: 2023-03-30 19:23:17


When you first start developing on Ethereum, you quickly discover how critical it is to test your dapps—even more so than in traditional development. 

But almost as quickly as learning you need to test is learning that it’s **very difficult to get the testnet ETH** you need to complete that testing! It’s a frustrating, and at times confounding, problem all Ethereum devs face.

But there are solutions. Let’s look at one of them: the new **Infura [Sepolia faucet](http://infura.io/faucet)**—which drips .5 testnet ETH per wallet per day. If you don’t know what testnet ETH is, or what drips means, or even what the Ethereum testnet is, we’ll cover all that here. 

And if you do already know all that—skip down to the bottom where we’ll walk through the details of how to get that Sepolia testnet ETH for free!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ah1kd81caer88dtqzd56.png)
_Sepolia Testnet Logo from Sepolia.dev_

## Testing smart contract requires testnet ETH
In web3, it’s critical to test your dapps. Not only do blockchain developers have the concerns of web2 developers, but added on is the weight of immutability—once a smart contract is deployed, it can’t be changed. And with massive economic risk undertaken by many smart contracts, testing to ensure your smart contract is secure, scalable, and free from vulnerabilities is crucial.

So it’s no wonder there is an entire industry dedicated to making sure smart contracts are tested well. From tools such as [Truffle](https://consensys.net/blog/truffle-suite/) and concepts such as F[uzzing](https://consensys.net/diligence/fuzzing/), to paid audits, to established best practices—there is plenty of source material to work from.

And one of those best practices is **testing your dapp on a testnet**—a blockchain that mimics the production version of a blockchain (the Ethereum mainnet). Just as it sounds and similar to traditional development, a blockchain _testnet_ is a _test environment_.

## Acquiring testnet ETH is difficult
But there’s a big problem in web3. You need **testnet ETH** to use the testnets. You need it to pay gas fees, fund your contracts …. Basically, you need to test your smart contract. And it is surprisingly difficult to obtain testnet ETH. Even though it’s meant to have zero value (and to be freely and easily accessible to developers), it’s notoriously difficult to get. And with the advent of L2s ([Polygon](https://polygon.technology/), [zkEVM](https://goerli.zkevm.consensys.net/), etc.) and testnet ETH bridging, getting your hands on these testnet tokens is even more important, and challenging, than ever.

In fact, it’s so challenging to get the testnet ETH, layer zero recently opened a pool to start selling Goerli testnet ETH. Yes, you read that right; the ETH that is supposed to be free and widely available is so difficult to get, there is now a market for buying and selling it. And while many developers fundamentally disagreed with this market (as they don’t want to commoditize the ability to test), that didn’t stop many of them from using the pool to quickly acquire the testnet ETH they needed.

So what can be done?

Many devs advocate switching to an alternate testnet where the ETH is easier to acquire. Namely, **Sepolia**—where the faucets drip freely :)

## What is Sepolia?
**Goerli** is the largest public Ethereum testnet and is often the default environment for devs. But as mentioned above, it is notoriously difficult to get testnet ETH on Goerli. And beyond that, Goerlie is in the process of being sunsetted.

**Sepolia** is a newer testnet (launched in late 2021), currently running PoS, that was created to mimic “harsher” network conditions. It has short block times and faster transaction confirmation times than other testnets. Is it meant to replace the Rinkeby and Kovan networks. And it has plenty of testnet ETH to go around!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kjxzo00lawtugpf1h24c.png)
_(from eth-clients/sepolia: the sepolia/bepolia testnet configurations)_

In short, the Ethereum Sepolia network is the perfect network to use for testing, and now is the perfect time to start using it. And of course to do that, you need that Sepolia testnet ETH.

## What is the purpose of a Sepolia faucet?

There is where a faucet comes in. A faucet is a free way to get tokens. It “drips” a certain amount of tokens to your crypto wallet address at a given rate. Typically, most faucets allow you to request tokens once per day (at a maximum).

You can get Sepolia ETH using the new ConsenSys Sepolia faucet.

## How to get Sepolia ETH using the new Infura Sepolia Faucet
Let’s walk through how to get that Sepolia testnet ETH using the Sepolia testnet faucet— a new faucet that drips **.5 free** testnet ETH per day.

## How to use the new Sepolia Faucet


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvez399f6zjfzk7d3d9u.png)


1 - Set up [MetaMask](https://metamask.io/) in your browser. MetaMask is a digital wallet that holds your tokens, including your Sepolia ETH.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wsm9eqoj6cx6n7rpwch.png)


2 - By default, MetaMask loads to the Ethereum mainnet. Follow these instructions to switch to the [Sepolia network](https://support.metamask.io/hc/en-us/articles/13946422437147). (It’s hidden by default.)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sck7lfxsst3scx08q2gu.png)



3 - Go to the Sepolia faucet at [infura.io/faucet](http://infura.io/faucet). Enter your wallet address. (if you have issues copying the wallet address, check this [note here](https://support.metamask.io/hc/en-us/articles/360015289512-How-to-copy-your-MetaMask-account-public-address-)).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gl946ypz5f5qxf1j4xm.png)




4 - Login with [your Infura account](https://www.infura.io/).

5 - Get your funds! 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72zwqe7cas2r0qd8gccn.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etpfg1wpg9z0ex01gksu.png)




6 - Enjoy testing with the test ETH!

## Conclusion
Testing is key to smart contract development on Ethereum. And for years, trying to get the necessary testnet ETH has been frustrating. But with the new Sepolia testnet and ConsenSys Sepolia faucet, life as an Ethereum dev is a little bit easier. Try it out and get that .5 testnet ETH!