Interact with smart contracg

We have created a smart contract now I need to interact with smart contract using frontend I have deposit function with address, amount, addressref need to interact using web3 how to start…

Hi,
You’ll have to get user logged in with MetaMask and then you can use code like this:
For a call that is ‘free’ (as in you don’t have to pay gas):

    window.web3 = await Moralis.Web3.enable();
    let contractAbi = [{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}];
    let contract = new web3.eth.Contract(contractAbi, contract_address);
    let name = await contract.methods.name().call();

for send (it will require gas and to sign the transaction in MetaMask):

    window.web3 = await Moralis.Web3.enable();
    let contract_instance = new web3.eth.Contract(
        abi, contract_address);
    await contract_instance.methods.fundContract()
        .send({ value: amount, from: ethereum.selectedAddress });