Error during deployment "invalid type (arg="type", value="function", version=4.0.47)"
See original GitHub issueThe 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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
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 thefunction()
withbytes4
, 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.