-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,045 additions
and
1,316 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
pragma solidity ^0.8.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
pragma solidity ^0.8.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,52 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; | ||
import { LibTBG } from "../libraries/LibTurnBasedGame.sol"; | ||
import { LibCoinVending } from "../libraries/LibCoinVending.sol"; | ||
import {LibTBG} from "../libraries/LibTurnBasedGame.sol"; | ||
import {LibCoinVending} from "../libraries/LibCoinVending.sol"; | ||
|
||
interface IBestOf { | ||
struct Score { | ||
address participant; | ||
uint256 score; | ||
} | ||
struct Score { | ||
address participant; | ||
uint256 score; | ||
} | ||
|
||
struct BOGSettings { | ||
uint256 gamePrice; | ||
uint256 joinGamePrice; | ||
uint256 numGames; | ||
address rankTokenAddress; | ||
bool contractInitialized; | ||
} | ||
struct BOGSettings { | ||
uint256 gamePrice; | ||
uint256 joinGamePrice; | ||
uint256 numGames; | ||
address rankTokenAddress; | ||
bool contractInitialized; | ||
} | ||
|
||
struct ContractState { | ||
BOGSettings BestOfState; | ||
LibTBG.GameSettings TBGSEttings; | ||
} | ||
struct ContractState { | ||
BOGSettings BestOfState; | ||
LibTBG.GameSettings TBGSEttings; | ||
} | ||
|
||
// struct HiddenProposal { | ||
// string cipherText; //encrypted with game masters key | ||
// bytes32 hash; //plain proposal string hashed with current turn salt | ||
// } | ||
// struct HiddenProposal { | ||
// string cipherText; //encrypted with game masters key | ||
// bytes32 hash; //plain proposal string hashed with current turn salt | ||
// } | ||
|
||
struct VoteHidden { | ||
bytes32[3] votedFor; | ||
bytes proof; | ||
} | ||
struct VoteHidden { | ||
bytes32[3] votedFor; | ||
bytes proof; | ||
} | ||
|
||
struct BOGInstance { | ||
uint256 rank; | ||
address createdBy; | ||
mapping(uint256 => string) ongoingProposals; //Previous Turn Proposals (These are being voted on) | ||
uint256 numOngoingProposals; | ||
mapping(address => bytes32) proposalCommitmentHashes; //Current turn Proposal submittion | ||
uint256 numCommitments; | ||
mapping(address => VoteHidden) votesHidden; | ||
} | ||
struct BOGInstance { | ||
uint256 rank; | ||
address createdBy; | ||
mapping(uint256 => string) ongoingProposals; //Previous Turn Proposals (These are being voted on) | ||
uint256 numOngoingProposals; | ||
mapping(address => bytes32) proposalCommitmentHashes; //Current turn Proposal submittion | ||
uint256 numCommitments; | ||
mapping(address => VoteHidden) votesHidden; | ||
} | ||
|
||
event RegistrationOpen(uint256 indexed gameid); | ||
event PlayerJoined(uint256 indexed gameId, address participant); | ||
event GameStarted(uint256 indexed gameId); | ||
event gameCreated( | ||
uint256 gameId, | ||
address indexed gm, | ||
address indexed creator, | ||
uint256 rank | ||
); | ||
event GameClosed(uint256 indexed gameId); | ||
event PlayerLeft(uint256 indexed gameId, address indexed player); | ||
event RegistrationOpen(uint256 indexed gameid); | ||
event PlayerJoined(uint256 indexed gameId, address participant); | ||
event GameStarted(uint256 indexed gameId); | ||
event gameCreated(uint256 gameId, address indexed gm, address indexed creator, uint256 rank); | ||
event GameClosed(uint256 indexed gameId); | ||
event PlayerLeft(uint256 indexed gameId, address indexed player); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
pragma solidity ^0.8.0; | ||
|
||
|
||
/** | ||
* @title ERC1155 transfer receiver interface | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.