Web3j - Why does my contract's method have a BigInteger param generated by the Java Wrapper? What is it for?

121 views Asked by At

I'm using the Web3j cli to generate a Java Wrapper for my ethereum smart contract.

function withdraw() external payable {
        address _caller = msg.sender;
        uint256 _userBalance = recipientBalances[_caller];

        if (isExpired() && _userBalance > 0) {
            uint256 _contractBalance = address(this).balance;
            recipientBalances[_caller] = 0;
            address payable _recipient = payable(_caller);
            if (_contractBalance > _userBalance) {
                _recipient.transfer(etherToWei(_userBalance));
            }
        }
    }

Upon generation it generates a method that accepts a BigInteger param, but my solidity contract for that method does not accept any params.

public RemoteFunctionCall<TransactionReceipt> withdraw(BigInteger weiValue) {
        final Function function = new Function(
                FUNC_WITHDRAW,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
}

This does not occur for any of my other generated Void return type functions.

What is the BigInteger param used for?

0

There are 0 answers