i am kinda new to golang and i would appreciate any help.

My main purpose is offline signing EIP1559 transactions based on a json using go-ethereum. I have managed to sign legacy transactions following docs and got success on eth transfers but my erc20 transactions were reverted. I have used types.NewTransaction() method and saw that it was deprecated.

I have been digging around the web to find some examples of the new EIP1559 transaction creation using types.NewTx() but i have been unsuccessful.

1 Answer 1


I have managed to create and sign transactions:

tx := types.NewTx(&types.DynamicFeeTx{
    ChainID: chainID,
    Nonce: nonce,
    GasFeeCap: feeCap,
    GasTipCap: tip,
    Gas: gas,
    To: &toAddress,
    Value: value,
    Data: txData,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.