diff --git a/src/Distillery.sol b/src/Distillery.sol index f37872381de25cacc93dca148483c6a71138234f..e7e890f6219488b0d3bd2e84abb19c79bfebb39b 100644 --- a/src/Distillery.sol +++ b/src/Distillery.sol @@ -1,10 +1,10 @@ // vim:filetype=javascript -pragma solidity ^0.4.24; +pragma solidity ^0.5; contract Distillery { - address owner; + address payable owner; struct Allowances { - address beneficiary; + address payable beneficiary; uint topuplimit; } Allowances[] thelist; @@ -42,7 +42,7 @@ contract Distillery { // Or returns 0 if the address is not found in thelist. // 0 : not found // 1 : first position - function _beneficiaryPosition( address beneficiary ) internal view returns ( uint ) { + function _beneficiaryPosition( address payable beneficiary ) internal view returns ( uint ) { uint pos = thelist.length; while ( pos-- > 0 ) if ( beneficiary == thelist[pos].beneficiary ) @@ -52,7 +52,7 @@ contract Distillery { // This function returns the "allowance" that a given address is set to. // Using this function, you don't have to cycle through atPosition() until // you find the address you want to know about. - function getEtherAllowance( address beneficiary ) public view returns (uint256) { + function getEtherAllowance( address payable beneficiary ) public view returns (uint256) { uint pos = _beneficiaryPosition( beneficiary ); if ( pos == 0 ) return 0; @@ -60,7 +60,7 @@ contract Distillery { } // This admin (ownerOnly) function allows the creator of the contract to // add/change/delete "allowances" per address. - function setEtherAllowance( address beneficiary, uint256 topuplimit ) public onlyOwner { + function setEtherAllowance( address payable beneficiary, uint256 topuplimit ) public onlyOwner { uint pos = _beneficiaryPosition( beneficiary ); // Not found and trying to delete beneficiary? Just return immediately. if ( pos == 0 && topuplimit == 0 )