Skip to content

Commit

Permalink
Update CryptoHerosGame
Browse files Browse the repository at this point in the history
  • Loading branch information
PhyrexTsai committed Jul 24, 2018
1 parent 072a3de commit 494ea30
Show file tree
Hide file tree
Showing 6 changed files with 1,172 additions and 795 deletions.
12 changes: 0 additions & 12 deletions contracts/CryptoHerosGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,11 @@ contract CryptoHerosGame is Ownable {
uint constant minHerosToken = 5 ether;

//address public cryptoHerosGame = 0x0;
uint256 public maxGameId = 0;
uint256 public maxSingleGameId = 0;

uint nonce = 0;
CryptoHerosToken cryptoHerosToken;

struct Game {
address winner;
address creator;
address participant;
uint256 creatorTokenId;
uint256 participantTokenId;
uint256 creatorBet;
uint256 participantBet;
}

struct SingleGame {
address player;
uint256 playerTokenId;
Expand All @@ -35,7 +24,6 @@ contract CryptoHerosGame is Ownable {
uint8 result; // 0 user win, 1 contract win, 2 draw
}

Game[] public games;
SingleGame[] public singleGames;

constructor(CryptoHerosToken _cryptoHerosToken) public {
Expand Down
30 changes: 0 additions & 30 deletions dapp/src/lib/cryptoHerosGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,4 @@ CryptoHerosGame.prototype.name = function (callback) {
});
}

CryptoHerosGame.prototype.symbol = function (callback) {
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) {
return cryptoHerosGame.symbolAsync();
});
}

CryptoHerosGame.prototype.ownerOf = function (tokenId, callback) {
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) {
return cryptoHerosGame.ownerOfAsync(tokenId);
});
}

CryptoHerosGame.prototype.tokenURI = function (tokenId, callback) {
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) {
return cryptoHerosGame.tokenURIAsync(tokenId);
});
}

CryptoHerosGame.prototype.transferOwnership = function (address, callback) {
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) {
return cryptoHerosGame.transferOwnershipAsync(address);
});
}

CryptoHerosGame.prototype.getOwnedTokens = function (address, callback) {
return this.cryptoHerosGamePromise.then(function (cryptoHerosGame) {
return cryptoHerosGame.getOwnedTokensAsync(address);
});
}

module.exports = CryptoHerosGame;
Loading

0 comments on commit 494ea30

Please sign in to comment.