-
Notifications
You must be signed in to change notification settings - Fork 82
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
Can not use plugin with openzeppelin contract imports #52
Comments
@rw026 Hi! did you found solution for this issue? I have the same problem |
Hi all, I have the same issue with the latest maven plugin. Any luck in solving it? @bakulinav @rw026 ? |
@vanderheijden86 no luck. Just used the command line tool to generate my Java Files |
also have this issue. BTW can some one tell me if the webj3 maven plugin can just take abi files that I already generated from my truffle project and use these as input to create the Java proxies ? or must I compile the .sol files all over again with web3j ? |
i just got a little further by referencing openzepplin absolutely in my contracts:
i got past the import errors but now I get this:
:( |
@walshe did you get it fixed? I fixed it is by adding
|
oh nice I will try.. In the end I went the long long way around and created a separate web3j project with the cli command |
@walshe thanks. still facing some other issues here and might have to resort to using that. |
But when you specify path like that then it complains |
Do you see your ERC721.sol file in your file explorer at path |
maven-build-plugins <plugin>
<groupId>org.web3j</groupId>
<artifactId>web3j-maven-plugin</artifactId>
<version>4.10.0</version>
<configuration>
<packageName>com.github.fantasy.web3j.contract</packageName>
<nativeJavaType>true</nativeJavaType>
<soliditySourceFiles>
<directory>src/main/solidity</directory>
<includes>
<include>contract/*.sol</include>
</includes>
</soliditySourceFiles>
<outputDirectory>
<java>src/main/java/</java>
<bin>src/main/bin</bin>
<abi>src/main/abi</abi>
</outputDirectory>
<pathPrefixes>
<pathPrefix>@openzeppelin=@openzeppelin</pathPrefix>
</pathPrefixes>
</configuration>
</plugin> @OpenZeppelin
and go to your node_modules get it, windows like
your sol file // SPDX-License-Identifier: MIT
pragma solidity > 0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Erc20T is ERC20 {
constructor(uint _totalSuperNum) ERC20("T test","T") {
_mint(msg.sender,_totalSuperNum);
}
} |
I am not able to generate the Java Wrapper of my solidity token contract because of importing openzeppelin contracts into my contract.
The installation and version of openzeppelin I use:
npm install [email protected]
The openzeppelin import in my contract file:
import "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol";
The error I get when executing the plugin:
The text was updated successfully, but these errors were encountered: