-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
š„š ā Adding context taken out in prev commit, and updating docs links
- Loading branch information
1 parent
286700a
commit c77311e
Showing
17 changed files
with
94 additions
and
698 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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
# sytizen-unity | ||
[![.github/workflows/moralis.yml](https://github.com/Signal-K/sytizen/actions/workflows/moralis.yml/badge.svg?branch=ansible)](https://github.com/Signal-K/sytizen/actions/workflows/moralis.yml) <br /> | ||
Citizen Science (Sci-tizen) visualisation in the Unity.com engine | ||
|
||
|
||
Check out our compass [here](http://ar.skinetics.tech/stellarios/compass) for more information about this product | ||
|
||
# Contracts | ||
<a href="https://thirdweb.com/goerli/0xCcaA1ABA77Bae6296D386C2F130c46FEc3E5A004?utm_source=contract_badge" target="_blank"> | ||
<img width="200" height="45" src="https://badges.thirdweb.com/contract?address=0xCcaA1ABA77Bae6296D386C2F130c46FEc3E5A004&theme=dark&chainId=5" alt="View contract" /> | ||
</a> | ||
|
||
<!-- | ||
Move `/server` into a separate submodule (or `styizen` into a submodule in another repo) | ||
Add react config (for frontend framework) to react, then move it into `signal-k/polygon` | ||
--> | ||
|
||
## Trader branch | ||
This branch contains a connection between Supabase (our current hosting platform for this backend) and the rest our our Notebooks & API. Everything else has been stripped out of this branch. | ||
|
||
Run `python3 -m venv .venv` to get started. | ||
|
||
Note: Start integrating in API from signal-k/polygon | ||
|
||
### Planti branch | ||
Stripping everything out (e.g. `Ansible`/`Generator`) and just leaving the initial dashboard/game frontend. We'll merge it back with `Trader` later | ||
[![.github/workflows/moralis.yml](https://github.com/Signal-K/sytizen/actions/workflows/moralis.yml/badge.svg?branch=ansible)](https://github.com/Signal-K/sytizen/actions/workflows/moralis.yml) | ||
[![Node.js CI](https://github.com/Signal-K/sytizen/actions/workflows/node.js.yml/badge.svg)](https://github.com/Signal-K/sytizen/actions/workflows/node.js.yml) | ||
[![Node.js CI](https://github.com/Signal-K/sytizen/actions/workflows/node.js.yml/badge.svg?branch=wb3-7--interacting-with-anomalies-from-smart)](https://github.com/Signal-K/sytizen/actions/workflows/node.js.yml) | ||
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/signal-k/sytizen/HEAD) | ||
[![](https://github.com/Signal-K/sytizen/actions/workflows/node.js.yml/badge.svg?branch=wb3-7--interacting-with-anomalies-from-smart)](https://deepnote.com/workspace/star-sailors-49d2efda-376f-4329-9618-7f871ba16007/project/Supabase-Talk-ab6b31e5-13c3-4949-af38-1197d00bd4d1/notebook/Flask%20API-cb9219547b9e4e228b15cbf8a1aa9cf4#99de0381ef0d40ffaee2354354861bae) | ||
[![](https://badges.thirdweb.com/contract?address=0xCcaA1ABA77Bae6296D386C2F130c46FEc3E5A004&theme=light&chainId=5)](https://thirdweb.com/goerli/0xCcaA1ABA77Bae6296D386C2F130c46FEc3E5A004?utm_source=contract_badge) | ||
|
||
# Signal-K/Sytizen Repo | ||
## Related repositories | ||
* [Signal-K/polygon](https://github.com/Signal-K/polygon/issues/26) ā Contract interactions | ||
* [Signal-K/client](https://github.com/Signal-K/client) ā Frontend for interactions with our contracts | ||
|
||
## Documentation | ||
All documentation is visible on [Notion](https://www.notion.so/skinetics/Sample-Planets-Contract-4c3bdcbca4b9450382f9cc4e72e081f7) | ||
|
||
# Citizen Science Classifications | ||
## Process | ||
* User mints an anomaly that has appeared in their UI (for now, the webapp, later it will be the game as well) | ||
* API searches for a token that has already been lazy minted with the TIC id of the anomaly (or the identifier of the candidate) | ||
* If there is a token id that has the TIC Id, then claim a copy of that to the `msg.sender` (playerās address) so they can manipulate it in-game | ||
* If the TIC ID has never been minted before, lazy mint a new one with parameters fetched from the data source and send it to `msg.sender` | ||
* Return the IPFS metadata | ||
* Add some buttons that allow manipulations for the NFT (e.g. viewing (reading) metadata (e.g. image/video files, graphs). | ||
* Graphs should be generated in a Jupyter notebook and returned in the Next app. | ||
* User creates post (proposal [Proposal Board ā Migration from Vite](https://www.notion.so/Proposal-Board-Migration-from-Vite-2e3ef95e384d4ac1875e0dbbe9a59337)) with the NFT ID for their anomaly and some extra metadata for their discoveries and proposal, and then users can vote |
2 changes: 1 addition & 1 deletion
2
...nd/pages/api/proposals/constants/index.ts ā Server/frontend/constants/proposals.ts
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
|
||
contract ClassificationProposal { | ||
struct Classification { | ||
// What types will this struct/campaign have? | ||
address owner; | ||
string title; // Title of the Proposal, type string | ||
string description; | ||
uint256 target; // How many coins to get the proposal to pass? | ||
uint256 deadline; | ||
uint256 amountCollected; // Goes towards target | ||
string image; // image uri/url | ||
address[] voters; | ||
uint256[] votes; // Consider adding more components to match discussion in wb3-5 task | ||
} | ||
|
||
mapping(uint256 => Classification) public classifications; | ||
uint256 public numberOfClassifications = 0; | ||
|
||
function createProposal(address _owner, string memory _title, string memory _description, uint256 _target, uint256 _deadline, string memory _image) public returns (uint256) { // Returns id of the classification's proposal | ||
Classification storage classification = classifications[numberOfClassifications]; // Populates the classifications array | ||
require(classification.deadline < block.timestamp, "The deadline should be a date in the future"); // Maybe add another modifier to specify a minimum deadline period e.g. 1 day | ||
|
||
classification.owner = _owner; | ||
classification.title = _title; | ||
classification.description = _description; | ||
classification.target = _target; | ||
classification.deadline = _deadline; | ||
classification.amountCollected = 0; | ||
classification.image = _image; | ||
|
||
numberOfClassifications++; | ||
|
||
return numberOfClassifications - 1; | ||
} | ||
|
||
function voteForProposal(uint256 _id) public payable { // Some crypto will be sent with the classificationID used as a param | ||
uint256 amount = msg.value; // This amount is set by user (typically in frontend); the amount they'll be pledging towards a classification | ||
Classification storage classification = classifications[_id]; | ||
|
||
classification.voters.push(msg.sender); // Push the address of user who voted | ||
classification.votes.push(amount); // Amount of custom erc20 token pledged | ||
|
||
(bool sent,) = payable(classification.owner).call{value: amount}(""); | ||
if (sent) { | ||
classification.amountCollected = classification.amountCollected + amount; | ||
} | ||
} | ||
|
||
function getVoters(uint256 _id) view public returns(address[] memory, uint256[] memory) { // Array of votes and number of voters | ||
return (classifications[_id].voters, classifications[_id].votes); | ||
} | ||
|
||
function getProposals() public view returns(Classification[] memory) { // Retrieved from memory | ||
Classification[] memory allClassifications = new Classification[](numberOfClassifications); // Empty array of empty structs referencing each classification/proposal | ||
|
||
for (uint i = 0; i < numberOfClassifications; i++) { | ||
Classification storage item = classifications[i]; | ||
allClassifications[i] = item; // Fetch the classification from storage and populate it in allClassifications | ||
} | ||
|
||
return allClassifications; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...end/pages/api/proposals/fetchProposals.js ā ...nd/pages/api/proposals/fetchProposals.jsx
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.