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

Java wrapper class generator silently ignored error and successfully completed without certain class generation #755

Closed
kelheor opened this issue Oct 25, 2018 · 8 comments

Comments

@kelheor
Copy link
Contributor

kelheor commented Oct 25, 2018

So I have a contract with the following declaration:
contract EtherPetToken is ERC721, ERC721Enumerable, ERC721Metadata

I'm using web3j-maven-plugin to generate java wrapper classes.
For a contract with such declaration wrapper class won't be generated and no errors will be generated in output (main problem - hard to figure out what's wrong).

The issue can be fixed by adding this constructor to the contract:
constructor(string name, string symbol) ERC721Metadata(name, symbol)
public
{
}

I think it's bad that I didn't receive any errors if wrapper classes can't be generated.

@iikirilov
Copy link
Contributor

Cannot reproduce.

Can you please provide more information so I can replicate this. A simple version of your EtherPetToken will be fine. I also need you ERC721, ERC721Enumerable and ERC721Metadata.

@iikirilov iikirilov added the awaiting-user-input Require more info or input from user label Nov 8, 2018
@kelheor
Copy link
Contributor Author

kelheor commented Nov 8, 2018

ERC721, ERC721Enumerable and ERC721Metadata can be found here: https://github.com/OpenZeppelin/openzeppelin-solidity/tree/master/contracts/token/ERC721

A simple version of EtherPetToken:

contract EtherPetToken is ERC721, ERC721Enumerable, ERC721Metadata {

    string public constant name = "EtherPet";
    string public constant symbol = "EP";
    uint8 public constant decimals = 0;

}

@iikirilov
Copy link
Contributor

I cannot reproduce with web3j 3.6.0 or web3j 4.0.0-alpha - checkout the attached zip which is generated with 3.6.0.
erc721.zip

@kelheor
Copy link
Contributor Author

kelheor commented Nov 8, 2018

Try to remove the constructor from your SampleERC721 contract. I wrote that with constructor there is no issue if you will add ERC721Metadata. But if you will miss constructor, the described issue will happen.

@iikirilov
Copy link
Contributor

Cannot reproduce - generator works fine on 3.6.0 - this may potentially be a deeper issue with the maven plugin itself.

erc721-nocons.zip

@kelheor
Copy link
Contributor Author

kelheor commented Nov 8, 2018

Because I tested now your SampleERC721 and be able to reproduce an issue, I guess you may be right - there might be an issue with maven plugin itself. I attached a sample Idea project to demonstrate an issue.
ERC721Test.zip

@iikirilov iikirilov added downstream-issue issue with project dependent on web3j and removed awaiting-user-input Require more info or input from user labels Nov 9, 2018
@stale
Copy link

stale bot commented Aug 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale no activity for 21 days label Aug 19, 2019
@iikirilov
Copy link
Contributor

closing as not related to web3j - please open a new issue in the web3j maven plugin repo

@iikirilov iikirilov removed downstream-issue issue with project dependent on web3j stale no activity for 21 days labels Aug 20, 2019
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

No branches or pull requests

2 participants