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
Generate Java proxies from external Truffle project
Issue_description
I have a truffle project that has a contract that extends OpenZeppelin's ERC1155. (Which I deploy to Ganache)
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
contract Items is ERC1155, Ownable {
mapping(uint256 => bool) tokenIdMinted;
constructor() ERC1155("http://localhost:8080/api/token-metadata/{id}") {
}
function mintCoupon(address owner, uint256 tokenId, uint256 amount)
public onlyOwner
{
require(!tokenIdMinted[tokenId], "This token id was already minted");
tokenIdMinted[tokenId] = true;
_mint(owner, tokenId, amount, "");
}
}
Meanwhile I have a Java maven project where I want to interact with Ganache and the smart contract. So far I have connected to Ganache using web3j and am able to read account balances etc.
Next I need to lookup the contract on the Java side with web3j and call my custom mintCoupon function. To so this I believe I need to generate Java proxies from the .sol files. I was hoping I could do this by referencing them in the web3j plugin (unless I can point them to json abi files instead?):
I also faced the same issue and found the issue. Issue is from 0.8.0 . I mean if you try this using say 0.7.6 then it will work. I guess the community has fixed the issue in web3j maven plugin snapshot version 4.8.8.SNAPSHOT version but since it is not released.
Issue_title
Generate Java proxies from external Truffle project
Issue_description
I have a truffle project that has a contract that extends OpenZeppelin's ERC1155. (Which I deploy to Ganache)
Meanwhile I have a Java maven project where I want to interact with Ganache and the smart contract. So far I have connected to Ganache using web3j and am able to read account balances etc.
Next I need to lookup the contract on the Java side with web3j and call my custom
mintCoupon
function. To so this I believe I need to generate Java proxies from the .sol files. I was hoping I could do this by referencing them in the web3j plugin (unless I can point them to json abi files instead?):Anyway, when I run the maven plugin I get the following issues:
Can anyone advise ?
Issue_context
Please provide additional information that might be helpful
The text was updated successfully, but these errors were encountered: