Insurance Policy

# Insurance Policy

init:["CUSTOMER"] = 0xb7b2e5e12992267f85455ffee1435f02760402f0["CLAIM_ADJUSTER"] = 0xc61185cffa955bd1a6b914a6c616b3cdd5206aa1["MONTHLY_PREMIUM"] = 100*10^18
  # Seconds in a month: 2628000, Seconds since 1970 on 1/1/2014: 1387584000["START_DATE"] = 1387584000["ARBITRATOR"] = 0x38155ef3698a43b24b054d816a8a5f79fc148623
  # Customer calling... with claim evidence provided as the contract input
  if msg.sender ==["CUSTOMER"]:
    # Increment customer's balance with the amount he's sending in["CUSTOMER_BALANCE"] = (["CUSTOMER_BALANCE"] + msg.value)["PROOF_OF_GOOF"] =[0]
  # Adjuster calling... with the payout amount as the contract input
  # (Or it's the arbitrator calling... in the event there was a dispute)
  if (msg.sender ==["ARBITRATOR"] or msg.sender ==["CLAIM_ADJUSTER"]):
    # label the calculation for elapsed policy months
    POLICY_MONTHS = ((block.timestamp -["START_DATE"]) / 2628000)
    # when the received premiums have equaled the required premium, the policy is paid up, so pay claim
      send(["CUSTOMER"],[0], (tx.gas - 100))

Serpent contract for Ethereum

My Serpent code description.


Note: Your changes won't be saved, because not Logged-in.

Create your own Contract