Skip to content

Fix function calls using proper decode fn#153

Open
yashh wants to merge 4 commits into
hswick:masterfrom
yashh:master
Open

Fix function calls using proper decode fn#153
yashh wants to merge 4 commits into
hswick:masterfrom
yashh:master

Conversation

@yashh

@yashh yashh commented Nov 9, 2022

Copy link
Copy Markdown

ex_abi library converts function signature back to ABI function selector to decode the output. Since we already have the abi we can call the decode function directly.

iex(7)> ExW3.Contract.call(:Contract, :symbol)
{:ok, "BAYC"}
iex(8)> ExW3.Contract.call(:Contract, :tokenURI, [1])
{:ok, "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1"}
iex(9)> ExW3.Contract.call(:Contract, :getApproved, [1])       
{:ok, <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant