Hi,
I am trying to compile the following contract:
pragma solidity ^0.5.1;
contract Governmental{
uint constant TWELVE_HOURS = 12;
//address[] payable creditorAddresses;
function lendGovernmentMoney ( address buddy ) public returns ( bool ) {
address owner;
uint[ ] memory creditorAddresses;
uint lastTimeOfNewCredit =0;
uint amount = msg. value ;
uint creditorAmounts = 0;
uint profitFromCrash = 0;
uint round = 0;
uint lastCreditorPayedOut = 0;
address[] memory creditorAddresses;
// check the condition to end the game
if ( lastTimeOfNewCredit + TWELVE_HOURS > block . timestamp ) {
msg.sender.send ( amount );
// Sends jacpot to the last creditor
creditorAddresses[creditorAddresses.length - 1].send ( profitFromCrash );
owner.send (this.balance);
// Reset contract state
lastCreditorPayedOut = 0;
lastTimeOfNewCredit = block . timestamp ;
profitFromCrash = 0;
creditorAddresses = new address [](0);
creditorAmounts = new uint [](0);
round += 1;
return false ;
}
}
I am getting the error:
Error: Member âsendâ not found or not visible after argument-dependent lookup in uint256.
creditorAddresses[creditorAddresses.length - 1].send ( profitFromCrash );
I changed:
uint[ ] memory creditorAddresses;
to
address[ ] payable creditorAddresses;
but I m getting the error:
prg17.sol:16:17: Error: Expected â;â but got âpayableâ
address payable creditorAddresses;
Somebody please guide me.
Zulfi.