Objectives
By the end of this lesson you should be able to:- Deploy a contract to the Base Sepolia testnet and interact with it in BaseScan.
Prepare for Deployment
Testnets operate in a similar, but not exactly the same manner as the main networks they shadow. You need a wallet with the appropriate token to interact with them by deploying a new contract or calling functions in a deployed contract.Set Up a Wallet
If you already have a wallet set up exclusively for development, you can skip to the next section. Otherwise, now is the time to jump in!It is very dangerous to use a wallet with valuable assets for development. You could easily write code with a bug that transfers the wrong amount of the wrong token to the wrong address. Transactions cannot be reversed once sent!Be safe and use separate wallets for separate purposes.
Add Base Sepolia to your Wallet
Use the faucet to add Base Sepolia ETH to your wallet. You can also ask Base personnel on Discord or other social media for some!Get Testnet Ether
Testnet tokens have no real value, but the supply is not unlimited. You can use a faucet to get a small amount of Sepolia Ether to pay gas fees for testing. Most faucets allow you to ask for a small amount each day, and some won’t send you more if your balance is too high. You can find many faucets by searching, and it’s good to keep a few bookmarked because they have a tendency to go down from time to time. Faucet providers are constantly combating bad actors and sometimes need to disable their faucets while doing so. You can also access the faucets on the web. Once you have testnet Base Sepolia Ether, you can view your balance under the Testnets tab in the Coinbase wallet or by selecting the testnet from the network dropdown in Metamask. Sadly, it’s not actually worth the amount listed!
Deploying to Testnet
Once you have testnet Ether, you can deploy your BasicMath contract!Selecting the Environment
Open the Deploy & Run Transactions tab. Under Environment, select Injected Provider. It will list Coinbase, Metamask, or any other wallet you have activated here.
Customize this list...


Custom (84532) network
. The old network, Goerli, was 84531
. If you don’t see the correct network, change the active network in your wallet.
Deploy the Contract
Click the orange Deploy button. Because it costs gas to deploy a contract, you’ll be asked to review and confirm a transaction.
Always carefully review all transactions, confirming the transaction cost, assets transferred, and network. As a developer, you’ll get used to approving transactions regularly. Do the best you can to avoid getting into the habit of clicking Confirm without reviewing the transaction carefully. If you feel pressured to Confirm before you run out of time, it is almost certainly a scam.
sepolia.basescan.org
.