0

This question already has an answer here:

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);

marked as duplicate by Ismael, Richard Horrocks, shane, Rob Hitchens - B9lab solidity Jun 8 at 6:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

You need to define the function as:

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

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.