improved homepage text
This commit is contained in:
		
							parent
							
								
									64e9479092
								
							
						
					
					
						commit
						a4b141dbde
					
				| @ -67,6 +67,10 @@ impl Store { | |||||||
|         self.sol_client.token_address() |         self.sol_client.token_address() | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     pub fn get_pubkey_base58(&self) -> String { | ||||||
|  |         self.sol_client.wallet_address() | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     pub fn get_keypair_base58(&self) -> String { |     pub fn get_keypair_base58(&self) -> String { | ||||||
|         self.sol_client.get_keypair_base58() |         self.sol_client.get_keypair_base58() | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| #![allow(dead_code)] | #![allow(dead_code)] | ||||||
| use crate::datastore; | use crate::{datastore, datastore::Store}; | ||||||
| use crate::datastore::Store; |  | ||||||
| use actix_web::{ | use actix_web::{ | ||||||
|     // http::StatusCode, error::ResponseError, Result,
 |     // http::StatusCode, error::ResponseError, Result,
 | ||||||
|     get, |     get, | ||||||
| @ -15,31 +14,37 @@ use chrono::{DateTime, Utc}; | |||||||
| use serde::{Deserialize, Serialize}; | use serde::{Deserialize, Serialize}; | ||||||
| use std::sync::Arc; | use std::sync::Arc; | ||||||
| 
 | 
 | ||||||
| const HOMEPAGE: &str = r#"Welcome, beloved hacker!
 | const HOMEPAGE: &str = r#"Welcome, b3L0v3D h4ck3r!
 | ||||||
| 
 | 
 | ||||||
| This node is part of the DeTEE hacker-challenge network. This network allows you | This node is part of the DeTEE hacker-challenge, a decentralized wallet that mints the HCKT Token. | ||||||
| to mint the token {token_address}, | The private key of the mint authority was generated within the network. The challenge is easy: | ||||||
| and owns the mint address {mint_address}. | Hack the network to get the private key, and all the SOL is yours. We also offer other rewards, including: | ||||||
|  | - a unique NFT | ||||||
|  | - token rewards at after release of the DeTEE token | ||||||
|  | - a seat on the Advisory Board of DeTEE | ||||||
|  | - possible employment at DeTEE | ||||||
| 
 | 
 | ||||||
| To be able to mint, you will need to send SOL to {mint_address}, however: | The mint address of the token is: TOKEN_ADDRESS | ||||||
|  | The mint authority is: MINT_AUTHORITY | ||||||
| 
 | 
 | ||||||
| BE AWARE THAT THE ONLY WAY TO GET THE SOL OUT IS BY HACKING THIS NETWORK! | In order to mint, the mint authority will need some SOL. Before sending SOL, the take into consideration that | ||||||
| DeTEE REPRESENTATIVES DON'T KNOW HOW TO HACK IT! THAT'S ACTUALLY WHY THIS GOT CREATED... | DeTEE REPRESENTATIVES DON'T KNOW HOW TO GET THE SOL OUT OF THE NETWORK! | ||||||
| 
 | 
 | ||||||
| Allowed operations: | Allowed operations: | ||||||
| 
 |  | ||||||
| /nodes <- information about nodes and counters of network activity | /nodes <- information about nodes and counters of network activity | ||||||
| /mint (address) <- mint DHCT tokens to the address; the wallet needs sol for this operation | /mint (address) <- mint DHCT tokens to the address; the wallet needs sol for this operation | ||||||
| 
 | 
 | ||||||
| Feel free to use this as a faucet for HCKT tokens, that you can use for testing in any dApp. | If you are able to get the SOL out of the wallet, please contact us at https://detee.ltd
 | ||||||
| 
 | The code of the challenge can be found at https://gitea.detee.cloud/ghe0/hacker-challenge
 | ||||||
| The objective of the hacker challenge is to get the SOL out of {mint_address}. |  | ||||||
| If you hack it, contact us at https://detee.cloud cause we have lots of rewards.
 |  | ||||||
| "#;
 | "#;
 | ||||||
| 
 | 
 | ||||||
| #[get("/")] | #[get("/")] | ||||||
| async fn homepage() -> impl Responder { | async fn homepage(ds: web::Data<Arc<Store>>) -> impl Responder { | ||||||
|     HttpResponse::Ok().body(HOMEPAGE) |     let text = HOMEPAGE | ||||||
|  |         .to_string() | ||||||
|  |         .replace("TOKEN_ADDRESS", &ds.get_token_address()) | ||||||
|  |         .replace("MINT_AUTHORITY", &ds.get_pubkey_base58()); | ||||||
|  |     HttpResponse::Ok().body(text) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[derive(Serialize)] | #[derive(Serialize)] | ||||||
| @ -76,10 +81,7 @@ impl From<(String, datastore::NodeInfo)> for NodesResp { | |||||||
| #[get("/nodes")] | #[get("/nodes")] | ||||||
| async fn get_nodes(ds: web::Data<Arc<Store>>) -> HttpResponse { | async fn get_nodes(ds: web::Data<Arc<Store>>) -> HttpResponse { | ||||||
|     HttpResponse::Ok().json( |     HttpResponse::Ok().json( | ||||||
|         ds.get_node_list() |         ds.get_node_list().into_iter().map(Into::<NodesResp>::into).collect::<Vec<NodesResp>>(), | ||||||
|             .into_iter() |  | ||||||
|             .map(Into::<NodesResp>::into) |  | ||||||
|             .collect::<Vec<NodesResp>>(), |  | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user