I am using Hardhat hackathon boilerplate and calling my smart contract's (address 1c0, addresses shortened for clarity) function MyContract#addProduct from the UI via ethers.js.
The problem: I see bunch of weird function calls before and after I call my addProduct function. An account (266) doing these weird calls is a first address generated by HH upon starting. MyContract is deployed at 1c0.
Below is the log from Hardhat node terminal with my comments after //
What are these calls and where do they originate?
UPDATE: A suggestion from my friend that it can be MetaMask querying a smart contract for whatever purposes. Still gonna investigate it.
// I don't know who's calling it
eth_call
Contract call: MyContract#<unrecognized-selector>
From: 266
To: 1c0
// My fallback is logging
console.log:
MyContract: Fallback called
// I don't know who's calling it
eth_call
Contract call: MyContract#symbol
From: 266
To: 1c0
// I don't know who's calling it
eth_blockNumber
eth_getBalance (3)
eth_call
WARNING: Calling an account which is not a contract
From: 266
To: e86
// This is what I call from UI
eth_getTransactionCount
eth_blockNumber
eth_sendRawTransaction
Contract call: MyContract#addProduct
Transaction: 740
From: 5ab
To: 1c0
Value: 0 ETH
Gas used: 414218 of 414218
Block #23: 925
console.log:
MyContract:addProduct()
eth_getTransactionReceipt
eth_blockNumber
eth_getTransactionReceipt
eth_blockNumber
eth_getBlockByHash
// I don't know who's calling it
eth_call
Contract call: MyContract#<unrecognized-selector>
From: 266
To: 1c0
console.log:
MyContract: Fallback called
// I don't know who's calling it
eth_call
Contract call: MyContract#<unrecognized-selector>
From: 266
To: 1c0
console.log:
MyContract: Fallback called