1/5
## HTML Fund Me Completed! We've just finished a quick lesson on how websites interact with wallets. While it's short, this lesson is important for understanding how websites work when interacting with smart contracts. We learned a very basic way of checking something called the "function selector" or "function signature" to make sure that a website isn't malicious and doesn't send a bad transaction. We can connect to a wallet by injecting a browser extension into the browser. This can be achieved by checking the existence of `window.ethereum` in the browser. If we hit the "connect" button, we can see in the wallet that we've successfully connected. When a website sends a transaction, it first needs to obtain the provider or the RPC URL from MetaMask. This is often achieved by using the following code: ```python const provider = new ethers.providers.Web3Provider(window.ethereum) ``` The above code essentially tells MetaMask that the website needs access to the network's RPC URL. After connecting, a website can send transactions to our wallet. The code for a simple transaction might look like this: ```python const transactionResponse = await contract.fund({ value: ethers.utils.parseEther(ethAmount), }) ``` The above code sends a transaction to the wallet, which will then prompt us to sign the transaction by confirming. This lesson was a brief overview of the basics of front-end and wallet interactions. As we go further in the course, we'll learn more about function selectors and function signatures and how we can ensure that we protect ourselves against malicious transactions.
A brief recap of the HTML Fund Me project. This lesson explains how front-end websites interact with blockchains, particularly how they send transactions to user wallets via browser extensions, specifically MetaMask.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on January 14, 2025
Duration: 2h 20min
Duration: 1h 51min
Duration: 58min
Duration: 2h 23min
Duration: 53min
Duration: 2h 24min
Duration: 28min
Duration: 1h 54min
Duration: 11min
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on January 14, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar