Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
152 changes: 152 additions & 0 deletions blockchain/DrillbitChain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"ApplicationName": "DrillbitChain",
"DisplayName": "DrillbitChain",
"Description": "An app for haunted hackathon.",
"ApplicationRoles": [
{
"Name": "Engineer",
"Description": "Engineer reviewing picture and dull rating."
},
{
"Name": "PIC",
"Description": "Person in charge."
},
{
"Name": "Vendor",
"Description": "Vendor."
},
{
"Name": "Superintendent",
"Description": "Superintendent."
}
],
"Workflows": [
{
"Name": "DrillbitChain",
"DisplayName": "Confirm Dull Rating",
"Description": "A simple workflow to send a pic of drill bit and take further action if necessary.",
"Initiators": [
"PIC"
],
"StartState": "Request",
"Properties": [
{
"Name": "State",
"DisplayName": "State",
"Description": "Holds the state of the contract.",
"Type": {
"Name": "state"
}
},
{
"Name": "PIC",
"DisplayName": "PIC",
"Description": "A person sending a request.",
"Type": {
"Name": "PIC"
}
},
{
"Name": "Engineer",
"DisplayName": "Engineer",
"Description": "A person sending a response.",
"Type": {
"Name": "Engineer"
}
},
{
"Name": "RequestMessage",
"DisplayName": "Request Message",
"Description": "A request message.",
"Type": {
"Name": "string"
}
},
{
"Name": "ResponseMessage",
"DisplayName": "Response Message",
"Description": "A response message.",
"Type": {
"Name": "string"
}
}
],
"Constructor": {
"Parameters": [
{
"Name": "message",
"Description": "...",
"DisplayName": "Request Message",
"Type": {
"Name": "string"
}
}
]
},
"Functions": [
{
"Name": "SendRequest",
"DisplayName": "Request",
"Description": "...",
"Parameters": [
{
"Name": "requestMessage",
"Description": "...",
"DisplayName": "Request Message",
"Type": {
"Name": "string"
}
}
]
},
{
"Name": "SendResponse",
"DisplayName": "Response",
"Description": "...",
"Parameters": [
{
"Name": "responseMessage",
"Description": "...",
"DisplayName": "Response Message",
"Type": {
"Name": "string"
}
}
]
}
],
"States": [
{
"Name": "Request",
"DisplayName": "Request",
"Description": "...",
"PercentComplete": 50,
"Value": 0,
"Style": "Success",
"Transitions": [
{
"AllowedRoles": [
"Engineer"
],
"AllowedInstanceRoles": [],
"Description": "...",
"Function": "SendResponse",
"NextStates": [
"Respond"
],
"DisplayName": "Send Response"
}
]
},
{
"Name": "Respond",
"DisplayName": "Respond",
"Description": "...",
"PercentComplete": 100,
"Style": "Success",
"Transitions": []
}
]
}
]
}
73 changes: 73 additions & 0 deletions blockchain/DrillbitChain.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
pragma solidity ^0.4.20;

contract WorkbenchBase {
event WorkbenchContractCreated(string applicationName, string workflowName, address originatingAddress);
event WorkbenchContractUpdated(string applicationName, string workflowName, string action, address originatingAddress);

string internal ApplicationName;
string internal WorkflowName;

function WorkbenchBase(string applicationName, string workflowName) internal {
ApplicationName = applicationName;
WorkflowName = workflowName;
}

function ContractCreated() internal {
WorkbenchContractCreated(ApplicationName, WorkflowName, msg.sender);
}

function ContractUpdated(string action) internal {
WorkbenchContractUpdated(ApplicationName, WorkflowName, action, msg.sender);
}
}

contract DrillbitChain is WorkbenchBase('DrillbitChain', 'DrillbitChain') {

//Set of States
enum StateType { Request, Respond, Initiated}

//List of properties
StateType public State;
address public PIC;
address public Engineer;

string public RequestMessage;
string public ResponseMessage;

// constructor function
function DrillbitChain(string message) public
{
PIC = msg.sender;
RequestMessage = message;
State = StateType.Request;

// call ContractCreated() to create an instance of this workflow
ContractCreated();
}

// call this function to send a request
function SendRequest(string requestMessage) public
{
if (PIC != msg.sender)
{
revert();
}

RequestMessage = requestMessage;
State = StateType.Request;

// call ContractUpdated() to record this action
ContractUpdated('SendRequest');
}

// call this function to send a response
function SendResponse(string responseMessage) public
{
Engineer = msg.sender;

// call ContractUpdated() to record this action
ResponseMessage = responseMessage;
State = StateType.Respond;
ContractUpdated('SendResponse');
}
}
2 changes: 2 additions & 0 deletions blockchain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# blockchain
blockchain code repos
1 change: 1 addition & 0 deletions frackenstein.github.io/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
11 changes: 11 additions & 0 deletions frackenstein.github.io/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: false
language: node_js
node_js:
- "node"
install: npm install
script:
- npm test
- gulp
cache:
directories:
- node_modules
21 changes: 21 additions & 0 deletions frackenstein.github.io/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2013-2018 Blackrock Digital LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 2 additions & 0 deletions frackenstein.github.io/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# frackenstein.github.io
Main site for Frackenstein
Loading