question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error during deployment "invalid type (arg="type", value="function", version=4.0.47)"

See original GitHub issue

The contract:

pragma solidity >= 0.7.0;
contract C {
    event Test(function() external);
}

when deployed produces the error

creation of C errored: Error: invalid type (arg=“type”, value=“function”, version=4.0.47)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ricmoocommented, Oct 7, 2020

Actually. Poking around with Solidity and the generated assembly, it looks like it uses the hash of Test(function) for the topic hash.

I’ve added this issue to track it: https://github.com/ethers-io/ethers.js/issues/1089

0reactions
ricmoocommented, Oct 7, 2020

The function() syntax is not currently available in the human-readable ABI parser. Can you provide the topic for that event? My guess is you could probably replace the function() with bytes4, but I’m not sure whether they do that conversion when computing the topic hash.

Please feel free to open an issue on ethers GitHub to track this. If changing it to a bytes4 fixes this, I would probably recommend this as the solution for now, since adding parenthesis to the parser would complicate a lot of the LL(1) states, as the parser was hand-written.

I may switch to a Jison-based parser in the future which would make these changes much easier, but does add quite a bit of overhead to the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

apex - Deploy Failure: Invalid type From Trigger
I have tried deploying the apex class and test class first and then the trigger but it still fails with the same error....
Read more >
Deploy Error: INVALID TYPE test class - Salesforce Developers
Hi, I have written custom component and test class, i'm tried to deploy the code(Custom component and Test class) sandbox to production, ...
Read more >
When I "deploy this source to org" and the deploy fails it no ...
Deploy an apex class to a salesforce org using VS code with an error in the class ... Invalid type: handlerClassName (9:47) ERROR...
Read more >
Salesforce -Moving metadata showing error at the time of deploy
triggers/BeforeInsertOnTierInfo.trigger -- Error: Invalid type: Schema.Tier_Info__c (line 1, column 9). triggers/BeforeInsertOnAggregateRates.
Read more >
Deployment errors tips - Sfdx-Hardis - GitHub Pages
Go to target org, in Setup -> Deployment Settings -> Activate option "Allow deployments of components when corresponding Apex jobs are pending or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found