You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Solidity, the events may have same names, but with different parameters.
Such as Compound's controller contract
There are 2 ActionPaused events with different parameters.
/// @notice Emitted when an action is paused globally
event ActionPaused(string action, bool pauseState);
/// @notice Emitted when an action is paused on a market
event ActionPaused(CToken cToken, string action, bool pauseState);
If we generate the Java file with web3jgen for it, there will be 2 global parameters with name ACTIONPAUSED_EVENT in the generated JAVA file.
This is not allowed in Java.
public static final Event ACTIONPAUSED_EVENT = new Event("ActionPaused",
Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
;
public static final Event ACTIONPAUSED_EVENT = new Event("ActionPaused",
Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
;
How would you like to have the name of duplicated event @CJ42? I'm currently working on it.
It is possible to create in the wrapper a 'numbered list', e.g. :
public static final Event ACTIONPAUSED_EVENT = new Event("ActionPaused",
Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
;
public static final Event ACTIONPAUSED_EVENT_1 = new Event("ActionPaused",
Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bool>() {}));
;
Bug_title
In Solidity, the events may have same names, but with different parameters.
Such as Compound's controller contract
There are 2 ActionPaused events with different parameters.
If we generate the Java file with web3jgen for it, there will be 2 global parameters with name ACTIONPAUSED_EVENT in the generated JAVA file.
This is not allowed in Java.
Steps To Reproduce
web3j generate solidity -a abc.abi -b abc.bin -o ./ -p abi
Expected behavior
The generated java file should has no ERROR.
Actual behavior
The generated java file built failed with ERROR.
Environment
Additional context
The text was updated successfully, but these errors were encountered: