Skip to content

Commit

Permalink
Create policy.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 6, 2024
1 parent 25bf657 commit f980b2a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions blockchain_integration/PiSure/contracts/policy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pragma solidity ^0.8.0;

contract Policy {
address public policyHolder;
uint public amount;
uint public premium;

constructor(address _policyHolder, uint _amount) {
policyHolder = _policyHolder;
amount = _amount;
premium = calculatePremium(_amount);
}

function calculatePremium(uint _amount) internal pure returns (uint) {
// Premium calculation logic goes here
return _amount * 0.05;
}
}

0 comments on commit f980b2a

Please sign in to comment.