pragma solidity >=0.4.21 <0.6.0; import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Full.sol'; import 'openzeppelin-solidity/contracts/token/ERC721/ERC721MetadataMintable.sol'; contract Reflaunt is ERC721Full, ERC721MetadataMintable { enum JourneyType { SingleJourney, ReturnJourney } struct ActivityType { uint id; string name; string metadata; address[] certifyingAddresses; } struct Activity { uint activityTypeId; address[] certificationTokenAddress; } struct Journey { JourneyType type; bool is_performed; } mapping(uint => ActivityType) private _activityTypes; mapping(uint => Activity) private _tokenActivityLogs; mapping(uint => Activity) private _tokenActivity; constructor() ERC721Full("Reflaunt", "RF") public { } function createNewActivity(uint _id, string _name, string _metadata, address[] _certifyingAddresses) external { require(_activityTypes[_id].id == 0); _activityTypes[_id] = ActivityType(_id, _name, _metadata, _certifyingAddresses); } // owner can create a journey, // journey is a list of tasks that will be performed for a single product. // a task will produce an activity // journey will respect the order of tasks which means that if a task is not completed, the journey cannot move to the next task. // there are 2 end results of a journey // - if single journey means it will not be coming back to the owner // - if return journey means it will be coming back to the owner after the last journey function createJourney(string type) { } function performTask() { // Bob need to create a contract with data given and publish it onchain // Bob send the contract id to Alice // Alice receive the contract and claim it // if the contract is not expired then location will be changed } }