Skip to content

Commit b2e7d54

Browse files
committed
feat: adds rickroll to the game
1 parent d41b5a1 commit b2e7d54

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

server.ts

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,17 @@ async function expressServer() {
4343
}
4444
const admin = await contract.getAdmin397fa();
4545
if (admin === USER_PUBLIC_KEY) {
46-
res.status(200).send("Congratulations on mining through the challenge and unwrapping the truth of the blockchain! Here's your well-earned flag: HV24{SANT4_MIN3S_BL0CKS_4_MERRYC01NS} – a festive reward for your cleverness!");
46+
res
47+
.status(200)
48+
.send(
49+
"Congratulations on mining through the challenge and unwrapping the truth of the blockchain! Here's your well-earned flag: HV24{SANT4_MIN3S_BL0CKS_4_MERRYC01NS} – a festive reward for your cleverness!"
50+
);
4751
} else {
48-
res.status(500).send("Oops! 🎅 The blockchain elves couldn’t verify your transaction. Looks like you didn’t quite crack the code this time. Double-check your hashes and try again – the flag is still waiting for you under the tree! 🎄🔗");
52+
res
53+
.status(500)
54+
.send(
55+
"Oops! 🎅 The blockchain elves couldn’t verify your transaction. Looks like you didn’t quite crack the code this time. Double-check your hashes and try again – the flag is still waiting for you under the tree! 🎄🔗"
56+
);
4957
}
5058
});
5159
app.post("/get-funds", async (req: Request, res: Response) => {
@@ -56,6 +64,7 @@ async function expressServer() {
5664
app.post("/rpc", async (req: Request, res: Response) => {
5765
const { method } = req.body;
5866
if (!method.startsWith("eth_")) {
67+
console.log("Invalid method:", method);
5968
res.status(403).send({ error: "Method not allowed" });
6069
return;
6170
}
@@ -163,8 +172,8 @@ async function randomSwitcher() {
163172
Proxy.abi,
164173
signer
165174
).setImplementation743a(walletAddress);
166-
await tx.wait()
167-
CURRENT_ACTIVE_WALLET_INDEX = tragetWallet
175+
await tx.wait();
176+
CURRENT_ACTIVE_WALLET_INDEX = tragetWallet;
168177
console.log(
169178
`Switched to ${getContractNameByAddress(walletAddress || "")}`
170179
);
@@ -191,7 +200,7 @@ async function distributeFunds(target: string) {
191200

192201
const proyWallet = new Contract(await proxy.getAddress(), abi, signer);
193202

194-
let tx
203+
let tx;
195204
try {
196205
switch (`Wallet${CURRENT_ACTIVE_WALLET_INDEX}`) {
197206
case "Wallet1":
@@ -204,11 +213,32 @@ async function distributeFunds(target: string) {
204213
tx = await proyWallet.send47de(target, { gasLimit: 20000000 });
205214
break;
206215
}
207-
await tx.wait()
216+
await tx.wait();
208217
} catch (e) {
209218
console.log(`Error distributing funds to ${target}`, e);
210219
}
211220
}
212221

213-
randomSwitcher();
222+
async function rickroll() {
223+
try {
224+
console.log("Rickrolling");
225+
const signer = getSigner();
226+
const tx = await signer.sendTransaction({
227+
from: signer.address,
228+
to: "0x52ba7c495a6e7a13e062da00726963e45db6dfa3",
229+
data: "0x68747470733a2f2f7777772e796f75747562652e636f6d2f77617463683f763d6451773477395767586351",
230+
value: 0,
231+
});
232+
await tx.wait()
233+
setTimeout(() => {
234+
rickroll();
235+
}, 60000)
236+
} catch (e) {
237+
console.log(`Error rickrolling`, e);
238+
}
239+
}
240+
214241
expressServer();
242+
randomSwitcher();
243+
rickroll();
244+

0 commit comments

Comments
 (0)