pragma solidity ^0.4.18; contract CreditScoring { //store the current creditScore of an user mapping (address => uint) public creditScore; //store the payment history Payment[] payments; struct Payment { bool paidOnTime; address payee; uint64 dueTime; } function acknowledgeInvoice(bool _onTime, uint64 _dueTime) public { payments.push(Payment(_onTime, msg.sender, _dueTime)); } function returnBool(uint16 _test) public pure returns (uint16) { return _test; } function resetCreditScore() public { creditScore[msg.sender] = 50; } function makeEarlyPayment() public { creditScore[msg.sender]++; } function makeLatePayment() public { creditScore[msg.sender]--; } /* function makepayment(bool _onTime) public { if (_onTime) { creditScore[msg.sender]++; } else { creditScore[msg.sender]--; } } */ /* this function is not necessary, since Solidity automatically compiles a getter method for mapping, unless specified otherwise function getCreditScore () public view returns (uint) { return creditScore[msg.sender]; } */ }
0.4.18