foo-hack

所属分类:其他
开发工具:Rust
文件大小:0KB
下载次数:0
上传日期:2023-11-06 12:56:41
上 传 者sh-1993
说明:  2022年6月,Scrypto社区的三名成员与redfoo合作,使用Scrypto.构建一个去中心化的国际象棋系统
(In June 2022, three members of the Scrypto community teamed up with redfoo to build a decentralized chess system using Scrypto)

文件列表:
LICENSE (11357, 2023-11-06)
frontend/ (0, 2023-11-06)
frontend/package-lock.json (1221128, 2023-11-06)
frontend/package.json (1203, 2023-11-06)
frontend/public/ (0, 2023-11-06)
frontend/public/favicon.ico (3870, 2023-11-06)
frontend/public/index.html (1721, 2023-11-06)
frontend/public/logo192.png (5347, 2023-11-06)
frontend/public/logo512.png (9664, 2023-11-06)
frontend/public/manifest.json (492, 2023-11-06)
frontend/public/radichess.wasm (1245655, 2023-11-06)
frontend/public/result-gifs/ (0, 2023-11-06)
frontend/public/result-gifs/draw.gif (1493370, 2023-11-06)
frontend/public/result-gifs/lose.gif (2425822, 2023-11-06)
frontend/public/result-gifs/win.gif (2779119, 2023-11-06)
frontend/public/robots.txt (67, 2023-11-06)
frontend/src/ (0, 2023-11-06)
frontend/src/App.css (90, 2023-11-06)
frontend/src/App.js (625, 2023-11-06)
frontend/src/App.test.js (246, 2023-11-06)
frontend/src/components/ (0, 2023-11-06)
frontend/src/components/CreateAccountModal.jsx (1389, 2023-11-06)
frontend/src/components/GameItem/ (0, 2023-11-06)
frontend/src/components/GameItem/GameItem.jsx (1636, 2023-11-06)
frontend/src/components/GameItem/GameItem.styles.scss (145, 2023-11-06)
frontend/src/components/GameList/ (0, 2023-11-06)
frontend/src/components/GameList/GameList.actions.js (711, 2023-11-06)
frontend/src/components/GameList/GameList.jsx (731, 2023-11-06)
frontend/src/components/GameList/GameList.styles.scss (964, 2023-11-06)
frontend/src/components/GameList/GameList.utils.js (1593, 2023-11-06)
frontend/src/components/GameTabs.jsx (1947, 2023-11-06)
frontend/src/components/Header.jsx (657, 2023-11-06)
frontend/src/components/Loader.jsx (355, 2023-11-06)
frontend/src/components/TabPanel.jsx (532, 2023-11-06)
frontend/src/index.css (366, 2023-11-06)
frontend/src/index.js (938, 2023-11-06)
... ...

# FooHack From June 14th to 16th 2022, three members of the Radix community [teamed up with redfoo](https://www.radixdlt.com/post/legendary-musician-redfoo-teams-up-with-radix-to-host-foohack), the legendary musician behind [Party Rock Anthem](https://www.youtube.com/watch?v=KQ6zr6kCPj8), to build a chess system using Scrypto as a backend. This repository is the result of this three day hackathon. On the last day of the hackathon, **redfoo** tested the system by playing a live game against **Avaunt**, a member of the Radix community. You can see a recap of the match [here](https://www.youtube.com/watch?v=O3EMxDgIygo) (we will not spoil the winner). Scrypto is the asset-oriented smart contract language of the Radix network and allows developers to build smart contract in a more intuitive and secure way. You can find more information about Scrypto [here](https://developers.radixdlt.com). ## The project The code in this repository is split between the frontend functionality and the Scrypto code. Both were connected together using the [Public Testing Environment](https://docs.radixdlt.com/main/scrypto/public-test-environment/pte-introduction.html), that Radix is temporarily providing to be able to connect a frontend to a Scrypto backend before a real test network is out. ## Frontend Using React, **@jameswylie** built a frontend that you can use to register as a player, list/view/create a chess game and view the leaderboard of players. ![Radichess game list](/images/game_list.png) ![Radichess spectate game](/images//spectate_game.png) ## Scrypto You will find two folder within the `scrypto` directory. One for the main blueprints (radichess) and one for an auction blueprint. The plan was to connect both so that once a chess game ended, an NFT would be minted and put on auction. It was **@RockHoward**, **@beemdvp** and **@redfoo22** who worked on that part of the project. ### Radichess structure Inside the radichess source folder, you will find different files. Here is a description of each file: | File | Description | | ------------- | ----------- | | radichess.rs | This contains the main Scrypto blueprint of the project. It defines the structure for the players and the games, along with defining a blueprint that acts as a game manager. A component instantiated from this blueprint allows people to register as a player, start a new game and manages the list of games. | | chess.rs | This is a blueprint where each instantiated component represents a single game of chess. Players are able to get the status of the game, join the game, make a move and withdraw a part of the proceeds from the auctioned NFT. | | board.rs | This file is the heart of the chess engine. It stores the current state of the board, validates the moves and declares the winner once a checkmate is attained. | | coordinate.rs | This provides a `Coordinate` structure, used by the chess engine, to represent a coordinate on the chess board. It provides useful methods to do calculations on the coordinates. | | piece.rs | This provides a `Piece` structure, again used by the chess engine, to represent a single piece and store some information like how many moves it did and its team. | | lib.rs | Scrypto packages always need a `lib.rs` file that describe the modules that it uses. This file simply reference the other files. | ## How to test 1. Download the PTE browser wallet [here](https://docs.radixdlt.com/main/scrypto/public-test-environment/pte-getting-started.html#_install_pte_browser_extension) 1. Go into the frontend directory: `cd frontend` 1. Install the dependencies: `npm install` 1. Start the local server: `npm start` 1. Open the following url in your browser: http://localhost:3000/ 1. If this is the first time opening the app, you should see a button to create a profile. Click on it and type your username. You will then be asked to sign and submit a transaction from the PTE wallet. After running this transaction, you will receive a badge resource in your wallet that represents your identity in the system. 1. You should now reload the page to see the main dashboard 1. You can then create/join/spectate games 1. To view the leaderboard, go to http://localhost:3000/leaderboard

近期下载者

相关文件


收藏者