Skip to content

Instantly share code, notes, and snippets.

@tzumby
Last active July 11, 2018 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzumby/592df7c32d752667ebac0a3914e10848 to your computer and use it in GitHub Desktop.
Save tzumby/592df7c32d752667ebac0a3914e10848 to your computer and use it in GitHub Desktop.
{:ok, address } =
"0x456196dfa8eb4534669a01c5933c3bba2ba0d018"
|> String.slice(2..-1)
|> Base.decode16(case: :mixed)
data = ABI.encode("balanceOf(address)", [address])
|> Base.encode16(case: :lower)
# 70a08231000000000000000000000000456196dfa8eb4534669a01c5933c3bba2ba0d018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment