Skip to content

Commit

Permalink
god damn no web3
Browse files Browse the repository at this point in the history
  • Loading branch information
lsg1213 committed Aug 1, 2019
1 parent d9af108 commit e2c9da2
Show file tree
Hide file tree
Showing 280 changed files with 54,649 additions and 22,573 deletions.
9,140 changes: 0 additions & 9,140 deletions contracts/Capsule.json

This file was deleted.

7,624 changes: 0 additions & 7,624 deletions contracts/Manage.json

This file was deleted.

49 changes: 0 additions & 49 deletions contracts/deployContract.js

This file was deleted.

58 changes: 0 additions & 58 deletions contracts/init.js

This file was deleted.

8 changes: 6 additions & 2 deletions contracts/capsule.sol → contracts/solidity/Capsule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ contract Capsule {
생성자
input : 시간 얼마나 뒤에 열거야, 묻는 사람, x좌표, y좌표, 키
*/
constructor (uint _period, address _owner, uint _latitude, uint _longitude, string memory _key, uint value, uint _limit, string memory _hash) public payable {
constructor (uint _period, address _owner, uint _latitude, uint _longitude, uint value, uint _limit, string memory _hash) public payable {
time = now + _period;
owner.push(_owner);
taked[_owner] = false;
manager = tx.origin;
pos.latitude = _latitude;
pos.longitude = _longitude;
key = _key;
balance = value;
limit = now + _period + _limit;
hash = _hash;
Expand All @@ -53,6 +52,11 @@ contract Capsule {
if (a > b) return a - b;
else if (a <= b) return b - a;
}

function KeyRegister(string memory _key) public {
require(msg.sender == owner[0]);
key = _key;
}

/*
시간 지났는지 아닌지 체크
Expand Down
24 changes: 7 additions & 17 deletions contracts/manage.sol → contracts/solidity/Manage.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
pragma solidity ^0.5.0;
import "./capsule.sol";
import "./Capsule.sol";

contract manage {
contract Manage {
address payable private owner; // 서버
address[] list; // 고객 명단(지갑 주소)
mapping(address => Capsul) cap; // 고객 명단을 통해 저장하는 캡슐 개수와 내용, 고객의 존재 여부
bytes32 ok = "The process was success"; // 성공시 출력
bytes32 fail = "The process was fail"; // 실패시 출력

event last(address owner, address caps);

struct Capsul {
address[] capList;
Expand All @@ -31,8 +32,8 @@ contract manage {
input : 기간, 캡슐 묻는 사람, 실행 하는 위치 x, y
output : 만든 캡슐 컨트랙트 주소
*/
function Bury(uint _period, address _owner, uint _x, uint _y, string memory _key, uint _limit, string memory _hash) public OwnerShip payable returns(address) {
Capsule capsule = new Capsule(_period, _owner, _x, _y, _key, msg.value, _limit, _hash);
function Bury(uint _period, address _owner, uint _x, uint _y, uint _limit, string memory _hash) public OwnerShip payable returns(address) {
Capsule capsule = new Capsule(_period, _owner, _x, _y, msg.value, _limit, _hash);
address(capsule).transfer(msg.value);
if (!cap[_owner].exist) {
cap[_owner].exist = true;
Expand All @@ -47,9 +48,9 @@ contract manage {
}


last_capsule = address(capsule);
emit last(_owner, address(capsule));
}
address last_capsule;
address public last_capsule;

function CheckLastCapsule() public view returns(address) {
return last_capsule;
Expand All @@ -64,17 +65,6 @@ contract manage {
서버만 실행 가능
cap[list[i]].capList[j] == all address of capsule
*/
function checking() public view returns(uint , uint, address, address, address) {
return(list.length, cap[list[0]].num, cap[list[0]].capList[0], cap[list[0]].capList[1], cap[list[0]].capList[2]);
}
function showmode(Capsule tmp) public returns(bool) {
bytes memory a;
(mode, a) = address(tmp).call(abi.encodeWithSignature("ShowMode()"));
}
bool mode;
function show() public view returns(bool) {
return mode;
}
function ServiceEnd() public OwnerShip {
selfdestruct(owner);
}
Expand Down
402 changes: 0 additions & 402 deletions contracts/test.js

This file was deleted.

Loading

0 comments on commit e2c9da2

Please sign in to comment.