I'm wondering if it's possible to call the smart contract, only knowing its address? For instance, if we take the contract, how to call it, if I have a completed transaction as an example. Can i repeat it with another wallet?
1 Answer
Of course you can do that. There are different ways to do. If the contract has implemented ERC20 standard then you can just compile an IERC20 interface in remix and import your contract so that you can interact with the contract with functions like transfer, transferFrom, name, symbol, totalSupply, decimals etc.
If you do not know anything, you can see the function signatures in every transaction and call the contract using web3js using some code.
Eg.
let data = await provider.call({
// address of the contract to interact with
to: address,
// `function name() view returns (string)` that gives you name of contract
data: "0x313ce567",
});
console.log("data", data)