Skill 1.3.1
Create a contract instance from an ABI and address
Key Concepts
new web3.eth.Contract(abi, address) creates an instance for a deployed contract. The ABI comes from the compiler output, such as a Hardhat artifact or the Remix compilation details, or from a verified contract on a block explorer. Each function in the ABI appears under contract.methods, for example contract.methods.balanceOf(owner).
An instance created without an address can deploy new contracts: contract.deploy({ data: bytecode, arguments: [...] }).send({ from }) sends a contract creation transaction and resolves to a new instance at the deployed address. Setting contract.options.from or passing from per call chooses the sending account.