This commit is contained in:
elegant651
2020-03-24 14:39:38 +09:00
commit 6e0388b653
83 changed files with 92480 additions and 0 deletions

View File

@@ -0,0 +1,894 @@
{
"contractName": "Migrations",
"abi": [
{
"constant": true,
"inputs": [],
"name": "last_completed_migration",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "completed",
"type": "uint256"
}
],
"name": "setCompleted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101c2806100606000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063445df0ac1461005c5780638da5cb5b14610087578063fdacd576146100de575b600080fd5b34801561006857600080fd5b5061007161010b565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b5061009c610111565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100ea57600080fd5b5061010960048036038101908080359060200190929190505050610136565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561019357806001819055505b505600a165627a7a7230582057ab4f3d2dc0ee96a250055d0353849a4bc5ad1c98a2ceaabcbefe7934899afc0029",
"deployedBytecode": "0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063445df0ac1461005c5780638da5cb5b14610087578063fdacd576146100de575b600080fd5b34801561006857600080fd5b5061007161010b565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b5061009c610111565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100ea57600080fd5b5061010960048036038101908080359060200190929190505050610136565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561019357806001819055505b505600a165627a7a7230582057ab4f3d2dc0ee96a250055d0353849a4bc5ad1c98a2ceaabcbefe7934899afc0029",
"sourceMap": "34:311:0:-;;;123:50;8:9:-1;5:2;;;30:1;27;20:12;5:2;123:50:0;158:10;150:5;;:18;;;;;;;;;;;;;;;;;;34:311;;;;;;",
"deployedSourceMap": "34:311:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;82:36;;8:9:-1;5:2;;;30:1;27;20:12;5:2;82:36:0;;;;;;;;;;;;;;;;;;;;;;;58:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;58:20:0;;;;;;;;;;;;;;;;;;;;;;;;;;;240:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;240:103:0;;;;;;;;;;;;;;;;;;;;;;;;;;82:36;;;;:::o;58:20::-;;;;;;;;;;;;;:::o;240:103::-;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;329:9;302:24;:36;;;;205:26;240:103;:::o",
"source": "pragma solidity >=0.4.21 <0.7.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n}\n",
"sourcePath": "/Users/willpark/Desktop/bookwork-klaytn/project_codes/todofeed/backend-todofeed/contracts/Migrations.sol",
"ast": {
"absolutePath": "/Users/willpark/Desktop/bookwork-klaytn/project_codes/todofeed/backend-todofeed/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
36
]
},
"id": 37,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.4",
".21",
"<",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:32:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 36,
"linearizedBaseContracts": [
36
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "58:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "58:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "82:36:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "82:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 13,
"nodeType": "Block",
"src": "144:29:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 11,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "150:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 231,
"src": "158:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 10,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "158:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "150:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 12,
"nodeType": "ExpressionStatement",
"src": "150:18:0"
}
]
},
"documentation": null,
"id": 14,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "134:2:0"
},
"payable": false,
"returnParameters": {
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "144:0:0"
},
"scope": 36,
"src": "123:50:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 22,
"nodeType": "Block",
"src": "199:37:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 231,
"src": "209:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 17,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "209:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 18,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "223:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "209:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 21,
"nodeType": "IfStatement",
"src": "205:26:0",
"trueBody": {
"id": 20,
"nodeType": "PlaceholderStatement",
"src": "230:1:0"
}
}
]
},
"documentation": null,
"id": 23,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [],
"src": "196:2:0"
},
"src": "177:59:0",
"visibility": "internal"
},
{
"body": {
"id": 34,
"nodeType": "Block",
"src": "296:47:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 30,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "302:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 31,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 25,
"src": "329:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "302:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 33,
"nodeType": "ExpressionStatement",
"src": "302:36:0"
}
]
},
"documentation": null,
"id": 35,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": null,
"id": 28,
"modifierName": {
"argumentTypes": null,
"id": 27,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 23,
"src": "285:10:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "285:10:0"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 25,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 35,
"src": "262:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "262:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "261:16:0"
},
"payable": false,
"returnParameters": {
"id": 29,
"nodeType": "ParameterList",
"parameters": [],
"src": "296:0:0"
},
"scope": 36,
"src": "240:103:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 37,
"src": "34:311:0"
}
],
"src": "0:346:0"
},
"legacyAST": {
"absolutePath": "/Users/willpark/Desktop/bookwork-klaytn/project_codes/todofeed/backend-todofeed/contracts/Migrations.sol",
"exportedSymbols": {
"Migrations": [
36
]
},
"id": 37,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.4",
".21",
"<",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:32:0"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 36,
"linearizedBaseContracts": [
36
],
"name": "Migrations",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3,
"name": "owner",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "58:20:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "58:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 5,
"name": "last_completed_migration",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "82:36:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "82:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 13,
"nodeType": "Block",
"src": "144:29:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 11,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 8,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "150:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 9,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 231,
"src": "158:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 10,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "158:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "150:18:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 12,
"nodeType": "ExpressionStatement",
"src": "150:18:0"
}
]
},
"documentation": null,
"id": 14,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [],
"src": "134:2:0"
},
"payable": false,
"returnParameters": {
"id": 7,
"nodeType": "ParameterList",
"parameters": [],
"src": "144:0:0"
},
"scope": 36,
"src": "123:50:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 22,
"nodeType": "Block",
"src": "199:37:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 16,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 231,
"src": "209:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 17,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "209:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 18,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3,
"src": "223:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "209:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 21,
"nodeType": "IfStatement",
"src": "205:26:0",
"trueBody": {
"id": 20,
"nodeType": "PlaceholderStatement",
"src": "230:1:0"
}
}
]
},
"documentation": null,
"id": 23,
"name": "restricted",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [],
"src": "196:2:0"
},
"src": "177:59:0",
"visibility": "internal"
},
{
"body": {
"id": 34,
"nodeType": "Block",
"src": "296:47:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 30,
"name": "last_completed_migration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "302:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 31,
"name": "completed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 25,
"src": "329:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "302:36:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 33,
"nodeType": "ExpressionStatement",
"src": "302:36:0"
}
]
},
"documentation": null,
"id": 35,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": null,
"id": 28,
"modifierName": {
"argumentTypes": null,
"id": 27,
"name": "restricted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 23,
"src": "285:10:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "285:10:0"
}
],
"name": "setCompleted",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 26,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 25,
"name": "completed",
"nodeType": "VariableDeclaration",
"scope": 35,
"src": "262:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 24,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "262:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "261:16:0"
},
"payable": false,
"returnParameters": {
"id": 29,
"nodeType": "ParameterList",
"parameters": [],
"src": "296:0:0"
},
"scope": 36,
"src": "240:103:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
}
],
"scope": 37,
"src": "34:311:0"
}
],
"src": "0:346:0"
},
"compiler": {
"name": "solc",
"version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.2",
"updatedAt": "2020-03-23T08:11:45.049Z"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
pragma solidity >=0.4.21 <0.7.0;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}

View File

@@ -0,0 +1,64 @@
pragma solidity 0.4.25;
contract TodoFeed {
event TodoCompleted (uint256 indexed todoId, address owner, string title, bytes photo, uint256 timestamp);
event TodoVerified (uint256 indexed todoId, address verifier);
TodoData[] public todoList;
mapping(uint256 => TodoData) public todoMap;
struct TodoData {
uint256 todoId; // Unique token id
address owner;
string title;
bytes photo; // Image source encoded in uint 8 array format
uint256 timestamp; // Uploaded time
bool isVerified; // check if is verified, default false.
address verifier; // verifier address
}
function writeTodo(string title, bytes photo) public {
uint256 todoId = todoList.length + 1;
TodoData memory newData = TodoData({
todoId : todoId,
owner : msg.sender,
title : title,
photo : photo,
timestamp : now,
isVerified: false,
verifier: address(0)
});
todoList.push(newData);
todoMap[todoId] = newData;
emit TodoCompleted(todoId, msg.sender, title, photo, now);
}
function verifyTodo(uint256 todoId) {
todoMap[todoId].isVerified = true;
todoMap[todoId].verifier = msg.sender;
emit TodoVerified(todoId, msg.sender);
}
function getTotalTodoCount () public view returns (uint) {
return todoList.length;
}
function getTodo (uint todoId) public view
returns(uint256, address, string, bytes, uint256, bool, address) {
require(todoMap[todoId].todoId != 0, "Todo does not exist");
return (
todoMap[todoId].todoId,
todoMap[todoId].owner,
todoMap[todoId].title,
todoMap[todoId].photo,
todoMap[todoId].timestamp,
todoMap[todoId].isVerified,
todoMap[todoId].verifier);
}
}

View File

@@ -0,0 +1 @@
[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"todoList","outputs":[{"name":"todoId","type":"uint256"},{"name":"owner","type":"address"},{"name":"title","type":"string"},{"name":"photo","type":"bytes"},{"name":"timestamp","type":"uint256"},{"name":"isVerified","type":"bool"},{"name":"verifier","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"todoMap","outputs":[{"name":"todoId","type":"uint256"},{"name":"owner","type":"address"},{"name":"title","type":"string"},{"name":"photo","type":"bytes"},{"name":"timestamp","type":"uint256"},{"name":"isVerified","type":"bool"},{"name":"verifier","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"todoId","type":"uint256"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"title","type":"string"},{"indexed":false,"name":"photo","type":"bytes"},{"indexed":false,"name":"timestamp","type":"uint256"}],"name":"TodoCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"todoId","type":"uint256"},{"indexed":false,"name":"verifier","type":"address"}],"name":"TodoVerified","type":"event"},{"constant":false,"inputs":[{"name":"title","type":"string"},{"name":"photo","type":"bytes"}],"name":"writeTodo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"todoId","type":"uint256"}],"name":"verifyTodo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTotalTodoCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"todoId","type":"uint256"}],"name":"getTodo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"address"},{"name":"","type":"string"},{"name":"","type":"bytes"},{"name":"","type":"uint256"},{"name":"","type":"bool"},{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

View File

@@ -0,0 +1 @@
0xa47898be53fba0fecdb9b4e1dadea5bf0f3c77f7

View File

@@ -0,0 +1,5 @@
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};

View File

@@ -0,0 +1,24 @@
const TodoFeed = artifacts.require('./TodoFeed.sol')
const fs = require('fs')
module.exports = function (deployer) {
deployer.deploy(TodoFeed)
.then(() => {
if (TodoFeed._json) {
fs.writeFile(
'deployedABI',
JSON.stringify(TodoFeed._json.abi, 2),
(err) => {
if (err) throw err
console.log(`The abi of ${TodoFeed._json.contractName} is recorded on deployedABI file`)
})
}
fs.writeFile(
'deployedAddress',
TodoFeed.address,
(err) => {
if (err) throw err
console.log(`The deployed contract address * ${TodoFeed.address} * is recorded on deployedAddress file`)
})
})
}

2789
todofeed/backend-todofeed/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,112 @@
/**
* Use this file to configure your truffle project. It's seeded with some
* common settings for different networks and features like migrations,
* compilation and testing. Uncomment the ones you need or modify
* them to suit your project as necessary.
*
* More information about configuration can be found at:
*
* truffleframework.com/docs/advanced/configuration
*
* To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
* to sign your transactions before they're sent to a remote public node. Infura accounts
* are available for free at: infura.io/register.
*
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
* phrase from a file you've .gitignored so it doesn't accidentally become public.
*
*/
// const HDWalletProvider = require('@truffle/hdwallet-provider');
// const infuraKey = "fj4jll3k.....";
//
// const fs = require('fs');
// const mnemonic = fs.readFileSync(".secret").toString().trim();
const HDWalletProvider = require("truffle-hdwallet-provider-klaytn");
const NETWORK_ID = '1001'
const URL = 'https://api.baobab.klaytn.net:8651' // testnet
const PRIVATE_KEY = '0x64f34d1d035e8e329a8633764616d267b61ceb91dfd72dea594da53ae108eca8' //testnet
module.exports = {
/**
* Networks define how you connect to your ethereum client and let you set the
* defaults web3 uses to send transactions. If you don't specify one truffle
* will spin up a development blockchain for you on port 9545 when you
* run `develop` or `test`. You can ask a truffle command to use a specific
* network from the command line, e.g
*
* $ truffle test --network <network-name>
*/
networks: {
klaytn: {
provider: () => new HDWalletProvider(PRIVATE_KEY, URL),
network_id: NETWORK_ID,
gas: '8500000',
gasPrice: null,
},
// Useful for testing. The `development` name is special - truffle uses it by default
// if it's defined here and no other network is specified at the command line.
// You should run a client (like ganache-cli, geth or parity) in a separate terminal
// tab if you use this network and you must also set the `host`, `port` and `network_id`
// options below to some value.
//
// development: {
// host: "127.0.0.1", // Localhost (default: none)
// port: 8545, // Standard Ethereum port (default: none)
// network_id: "*", // Any network (default: none)
// },
// Another network with more advanced options...
// advanced: {
// port: 8777, // Custom port
// network_id: 1342, // Custom network
// gas: 8500000, // Gas sent with each transaction (default: ~6700000)
// gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
// from: <address>, // Account to send txs from (default: accounts[0])
// websockets: true // Enable EventEmitter interface for web3 (default: false)
// },
// Useful for deploying to a public network.
// NB: It's important to wrap the provider as a function.
// ropsten: {
// provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
// network_id: 3, // Ropsten's id
// gas: 5500000, // Ropsten has a lower block limit than mainnet
// confirmations: 2, // # of confs to wait between deployments. (default: 0)
// timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
// skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
// },
// Useful for private networks
// private: {
// provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
// network_id: 2111, // This network is yours, in the cloud.
// production: true // Treats this network as if it was a public net. (default: false)
// }
},
// Set default mocha options here, use special reporters etc.
mocha: {
// timeout: 100000
},
// Configure your compilers
compilers: {
solc: {
// version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
// settings: { // See the solidity docs for advice about optimization and evmVersion
// optimizer: {
// enabled: false,
// runs: 200
// },
// evmVersion: "byzantium"
// }
}
}
}