-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Nodeguardians/develop
Questplay MVP
- Loading branch information
Showing
36 changed files
with
29,800 additions
and
239 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main, develop ] | ||
pull_request: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
node-version: [16.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm link | ||
- run: npm run test -- ${{ matrix.os }} |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
.vscode | ||
artifacts | ||
cache | ||
.credentials | ||
.env |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
interface IValidator { | ||
|
||
/// @dev Returns address of contract belonging to `user` in part `k` of quest. | ||
function deployments(address user, uint k) external view returns (address); | ||
|
||
|
||
/// @dev Deploys CTF contract for user to interact with. | ||
function deploy(uint k) external; | ||
|
||
|
||
/// @dev Tests whether contract belonging to `user` in part `k` has been "captured". | ||
/// Returns true if contract "captured", false otherwise. | ||
function test(address user, uint k) external view returns (bool); | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
/// @dev Test token with minting capabilities | ||
/// Clone-friendly for cheaper gas in CTF quests | ||
contract Token is ERC20 { | ||
|
||
string private _name; | ||
string private _symbol; | ||
|
||
address private owner; | ||
bool private isInitialized; | ||
|
||
modifier onlyOwner() { | ||
require(msg.sender == owner, "Caller is not owner"); | ||
_; | ||
} | ||
|
||
constructor() ERC20("", "") { } | ||
|
||
function initialize( | ||
string memory name_, | ||
string memory symbol_ | ||
) external { | ||
require(!isInitialized, "Token already initialized"); | ||
|
||
_name = name_; | ||
_symbol = symbol_; | ||
|
||
owner = msg.sender; | ||
isInitialized = true; | ||
} | ||
|
||
function mint(address to, uint256 amount) external onlyOwner { | ||
_mint(to, amount); | ||
} | ||
|
||
function name() public view override returns (string memory) { | ||
return _name; | ||
} | ||
|
||
function symbol() public view override returns (string memory) { | ||
return _symbol; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@ngquests/contracts", | ||
"version": "0.1.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"No test specified\"" | ||
}, | ||
"author": "", | ||
"license": "MIT" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
get matchers () { return require('./src/matchers.js'); }, | ||
get events () { return require('./src/events.js'); }, | ||
get diamonds () { return require('./src/diamonds.js'); }, | ||
get ast () { return require('./src/ast.js'); }, | ||
get cheating () { return require('./src/cheating.js'); } | ||
} |
Oops, something went wrong.