Skip to content

Commit 3c62c90

Browse files
committed
fix: lax the rpc filter
1 parent d8eeecf commit 3c62c90

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

server.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ async function expressServer() {
6363
});
6464
app.post("/rpc", async (req: Request, res: Response) => {
6565
const { method } = req.body;
66-
if (!method.startsWith("eth_") && method != "net_version") {
66+
if (
67+
!method.startsWith("eth_") &&
68+
method != "net_version" &&
69+
!method.startsWith("web3_") &&
70+
!method.startsWith("debug_") &&
71+
!method.startsWith("trace_")
72+
) {
6773
console.log("Invalid method:", method);
6874
res.status(403).send({ error: "Method not allowed" });
6975
return;
@@ -116,7 +122,10 @@ function getProvider() {
116122
}
117123

118124
function getSigner() {
119-
return new ethers.Wallet("0xaa20aa192b89a9f6e50bafff8dc5e6399e4150f45f3f14dced24b30e5152e18e", getProvider());
125+
return new ethers.Wallet(
126+
"0xaa20aa192b89a9f6e50bafff8dc5e6399e4150f45f3f14dced24b30e5152e18e",
127+
getProvider()
128+
);
120129
}
121130

122131
function getContract(contract: string) {
@@ -229,10 +238,10 @@ async function rickroll() {
229238
data: "0x68747470733a2f2f7777772e796f75747562652e636f6d2f77617463683f763d6451773477395767586351",
230239
value: 0,
231240
});
232-
await tx.wait()
241+
await tx.wait();
233242
setTimeout(() => {
234243
rickroll();
235-
}, 60000)
244+
}, 60000);
236245
} catch (e) {
237246
console.log(`Error rickrolling`, e);
238247
}
@@ -241,4 +250,3 @@ async function rickroll() {
241250
expressServer();
242251
randomSwitcher();
243252
rickroll();
244-

0 commit comments

Comments
 (0)