I'm using this e-book to learn about using go-ethereum, but it's pretty outdated. I'm on the part about transferring tokens and I'm getting an invalid opcode when estimating gas. I have a private key to a wallet that has a few thousand testing tokens on Rinkeby, and I'm trying to send it to another wallet as the guide shows. Pretty much everything is the same in my code as in the guide save for the private key and addresses. The output looks like this:
0x4b40e901 (method ID) 0x000000000000000000000000546e6ad2e7aa8c047ae5d022d183c5918d7b158b (padded address) 0x00000000000000000000000000000000000000000000000011200c7644d4fff2 (padded amount) 2021/08/19 16:17:34 invalid opcode: opcode 0x4b not defined (when doing EstimateGas())
I'm guessing this might be happening due to the guide being outdated in terms of how contracts are handled, maybe the hashing method has changed? I am very interested also if anyone has a more updated guide for go-ethereum that covers sending ERC-20 tokens. I'm working on the Rinkeby test net.