Code example of a smart contract

To give you an idea of what a smart contract looks like from a code perspective, here is a simple example of assigning an accident to a case worker:

/** * Assign an Case woker to the accident report * @param {nl.amis.registry.accidents.AssignToCaseWorker} assignToCaseWorker - the particular accident that you want to assign to a responsible case worker * @transaction */function AssignToCaseWorker(assignToCaseWorker) {  if (assignToCaseWorker.accident.status !== 'OPEN')     throw new Error('Case already assigned to an Case worker.');  else {    assignToCaseWorker.accident.status = 'ASSIGNED';    assignToCaseWorker.accident.assignee = assignToCaseWorker.assignee;  }   return getAssetRegistry('nl.amis.registry.accidents.Accident') ...

Get Blockchain across Oracle now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.