Skip to content

Instantly share code, notes, and snippets.

@MariusVanDerWijden
Created July 8, 2020 09:21
Show Gist options
  • Save MariusVanDerWijden/71f6ea5883b60e672f3752e6fd4b773d to your computer and use it in GitHub Desktop.
Save MariusVanDerWijden/71f6ea5883b60e672f3752e6fd4b773d to your computer and use it in GitHub Desktop.
// Call a pure/view function
callOpts := &bind.CallOpts{Context: ctx, Pending: false}
bal, err := ctr.SeeBalance(callOpts)
// Call a normal function
tx, err := ctr.Deposit(transactOpts)
receipt, err := bind.WaitMined(ctx, backend, tx)
if receipt.Status != types.ReceiptStatusSuccessful {
panic("Call failed")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment