0

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract.

The problem is, I can't generate java wrapper class (Child1Manager.java) which inherits wrapper class CompositeManager.java, it inherits only the Contract class.

pragma solidity >=0.5.0 <0.7.0;

contract CompositeManager {
    uint private conType;

     /** 
     * @notice This method returns the contract type 
     * @return _type - type of contract
     **/
    function getType() external view 
                       returns(uint)
    {
        return conType;
    }

    constructor(uint _type) public {
        conType = _type;
    }
}

The child contract

pragma solidity >=0.5.0 <0.7.0;
import "./CompositeManager.sol";
contract Child1Manager is CompositeManager(1) { 
....
....
...
}

I can create the bin and abi and wrapper using solc compiler, web3j, solidity, it creates 4 separate abi and bin for two types of contract and one java wrapper for Child1 contract.

solc Child1Manager.sol --bin --abi --optimize -o ./abi_bin

web3j solidity generate -b ./abi_bin/Child1Manager.bin -a ./abi_bin/Child1Manager.abi -o ./ -p package.name.of.my.project

Is there any way to generate this?

public class CompositeManager extends Contract {
.....
...
...
}

public class Child1Manager extends CompositeManager {
.....
...
...
}

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.