Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Error thrown on Contract function call: "Error calling contract function: Error: essential-eth does not yet support "address[]"" #276

Closed
gfarrisi opened this issue Mar 30, 2024 · 3 comments · Fixed by #278

Comments

@gfarrisi
Copy link

gfarrisi commented Mar 30, 2024

When calling a function on this conract
const contractAddress = "0x5c11016ee4f8ad4ea2ab8b1b366f32d30d48a031";

I am able to easily fetch simple data as seen below

const provider = new JsonRpcProvider(providerUrl);
const contract = new Contract(contractAddress, contractABI, provider);
const name = await contract.name();
const contestDeadline = await contract.contestDeadline();

But when i attempt to run a function that is meant to return an array of strings like this
const voters = await contract.getAllAddressesThatHaveVoted();

I am seeing this error

Error calling contract function: Error: essential-eth does not yet support "address[]" outputs. Make a PR today!"
    at /workspace/node_modules/essential-eth/dist/cjs/classes/utils/encode-decode-transaction.js:170:23
    at Array.map (<anonymous>)
    at decodeRPCResponse (/workspace/node_modules/essential-eth/dist/cjs/classes/utils/encode-decode-transaction.js:154:44)
    at Contract.getAllProposalAuthors (/workspace/node_modules/essential-eth/dist/cjs/classes/Contract.js:64:78)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getJokeRaceContestData (/workspace/src/tests/jokerace.ts:32:26)
    at async localtest (/workspace/src/tests/test.ts:977:3)
    at async start (/workspace/src/index.ts:15:5)
    

Note that when running this with ethers the correct response returns an array of strings correctly

 voters: [
  '0x67243d6c3c3bDc2F59D2f74ba1949a02973a529d',
  '0x0b06ca5DcC8A10Be0951d4E140D4312702B8D0EC',
  '0x3FAD8Bcd2AEa732d02a203c156B19205253F2a06',
  '0x73186b2A81952C2340c4eB2e74e89869E1183dF0',
  '0x87ece9936Ad2254D03af83958fE3b202dC79793f',
  '0x68f272FcaaE074CB33E68D88a32c325ed0dF8379',
  '0xC9d20533c5b8a79526377e5d05dC79b87B28E92F',
  '0xE04885c3f1419C6E8495C33bDCf5F8387cd88846',
  '0x0c887420937d8F9305fF872eAa5aaf5e379a811A',
  '0x7234c36A71ec237c2Ae7698e8916e0735001E9Af',
  '0x1C9F765C579F94f6502aCd9fc356171d85a1F8D0',
  '0xCA85c622d4c61047f96e352CB919695486a193e6',
  '0xC11C6f47fe090a706bA82964B8A98F1682b244Ff',
  '0x020F64F264ab7e90Ef24a108C379a796a82175dF',
  '0xEb2ee1250DC8C954dA4efF4DF0E4467A1ca6af6c',
  '0x3B60e31CFC48a9074CD5bEbb26C9EAa77650a43F',
  '0x68d36DcBDD7Bbf206e27134F28103abE7cf972df',
  '0x1a9cEe6E1D21c3C09FB83A980EA54299f01920cd',
  '0x1d3bf13f8f7A83390d03Db5E23A950778e1d1309'
],

@dawsbot
Copy link
Owner

dawsbot commented Apr 7, 2024

What blockchain is the smart contract 0x5c11016ee4f8ad4ea2ab8b1b366f32d30d48a031 deployed on @gfarrisi ? I'm able to find it on OP but the source code is not verified: https://optimistic.etherscan.io/address/0x5c11016ee4f8ad4ea2ab8b1b366f32d30d48a031#code

@gfarrisi
Copy link
Author

gfarrisi commented Apr 7, 2024

Yes it's on OP. It's a JokeRace contest. I haven't seen many of their non eth chain contracts verified.
https://www.jokerace.io/contest/optimism/0x5c11016ee4f8ad4ea2ab8b1b366f32d30d48a031

@dawsbot
Copy link
Owner

dawsbot commented Apr 7, 2024

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 a pull request may close this issue.

2 participants