I have transferred money to an ethereum address that belongs to the smart contracts.
const priv = "0x" + crypto.randomBytes(32).toString("hex"); const pub = "0x" + util.generateAddress(util.toBuffer(priv), util.toBuffer(parseInt(req.params.nonce))).toString("hex");
This is how I generated the private key and public address. I have a track of the nonce but when I try to import this private key in trust wallet, I cannot see any funds there.
Crazy thing is that I found out now that the
generateAddress expects the first parameter to be a smart contract address, whereas I provided a private key and it still accepted it. An error here would have saved me from losing 2000$.
Is there any way to recover this?
Thank you very much.