I am trying to compile the following smart contract:
pragma solidity ^0.5.1;
contract Governmental{
uint constant TWELVE_HOURS = 12;
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;
// 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:
prg17.sol:20:10: Error: Member "send" not found or not visible after argument-dependent lookup in uint256. creditorAddresses[creditorAddresses.length - 1].send ( profitFromCrash ); ^--------------------------------------------------^
Somebody please guide me.
Zulfi.