I'm trying to compile my smart contract with the solidity version 0.5.0. with the code below:

function unbond(address wallet, bytes32 specifier, uint quantity) internal {

    bondage = BondageInterface(coord.getContract("BONDAGE")); 
    uint issued = bondage.getDotsIssued(address(this), specifier);

    currentCost = CurrentCostInterface(coord.getContract("CURRENT_COST")); 
    uint reserveCost = currentCost._costOfNDots(address(this), specifier, issued + 1 - quantity, quantity - 1);
    FactoryTokenInterface tok = FactoryTokenInterface(curves[specifier]);

    //unbond dots
    bondage.unbond(address(this), specifier, quantity);
    //burn dot backed token
    tok.burnFrom(wallet, quantity);
    //send wallet eth
    wallet.transfer(reserveCost * adapterRate);

The transfer function is this: function transfer(address _to, uint256 _value) public returns (bool);

The error I got is this

TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address". wallet.transfer(reserveCost * adapterRate);


You need to define the function as:

function unbond(address payable wallet, bytes32 specifier, uint quantity) internal

You can try this, function transfer(address _to, uint256 _value) public payable returns (bool);

Please let me know if it works.

Not the answer you're looking for? Browse other questions tagged or ask your own question.