Are you new to blockchains, smart contracts, and Ethereum? Want to understand and engage with the exciting world of Web3? Then you're in the right place. This beginner tutorial will show you how to deploy your first smart contract and run it in your browser. No prior experience necessary.
Wallet with gas token & ERC-677 LINK
This beginner-friendly tutorial will guide you through two key Web3 skills:
Deploying smart contracts on-chain requires a wallet and ETH. The ETH pays for the work required by the Ethereum network to add the contract to the blockchain and store the variables. The wallet holds the ETH that you need to pay for the transaction. Install MetaMask, configure it to use the Sepolia testnet, and fund your wallet with free testnet ETH.
Now that you configured your wallet and funded it with testnet ETH, you can write, compile, and deploy your contract.
Your first contract is a simple HelloWorld.sol example. This example shows you how to set and retrieve variables in a smart contract on-chain.
The contract has an address just like your wallet address. If you save this address, you can return to your deployed contract at any time to retrieve variables or execute functions. To see details about your deployed contract, copy the contract address from the list in Remix and search for it in the Etherscan Sepolia Testnet Explorer.
Because you deployed the contract to an actual blockchain, several nodes on the test network confirmed your payment for the smart contract. The contract, its variables, and its functions remain in the blockchain permanently. To change the message variable that is stored with your contract, run the updateMessage function.
Congratulations! Now you know how to deploy example contracts to a test network and run the functions in those contracts. You can write your own contracts and test them using this same process.
Next, learn how to connect your smart contracts to Chainlink Data Feeds and retrieve on-chain data that your smart contracts can act on.
Let’s learn how to pull the price of ether. Before we begin, let’s example the sample contract. This example contract obtains the latest price answer from the BTC / USD feed on the Sepolia testnet, but you can modify it to read any of the different Types of Data Feeds.
The contract has the following components:
Deploy the DataConsumerV3 smart contract on the Sepolia testnet.
Please fill this form to continue to next step