Deploying smart contract metadata to the frontend
Before interacting with smart contracts, we need to make the smart contract metadata accessible to the frontend. Smart contract metadata is the required information for frontend code to access a smart contract on the blockchain. To be more specific, it refers to the smart contract ABI and the smart contract address that is deployed on the blockchain.
The smart contract ABI is a section of code for off-chain components to communicate and interact with the smart contract code deployed on the blockchain. It defines the interfaces that off-chain components can use to access the smart contract, including its functions, variables, and events. Usually, the ABI used by decentralized application frontend code is in the form of JavaScript Object Notation (JSON). Meanwhile, the DeFi application also requires you to know the smart contract address so the frontend code can locate the smart contract to interact with.
The example project of...