Skip to content

Commit

Permalink
Merge pull request #114 from NethermindEth/ice-phishing/remove-error-…
Browse files Browse the repository at this point in the history
…findings

Remove creation of error findings
  • Loading branch information
RCantu92 authored Aug 8, 2024
2 parents e7908d3 + df71989 commit 7a97494
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
1 change: 1 addition & 0 deletions ice-phishing/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
forta.config.json
bot-config.json
secrets.json
2 changes: 1 addition & 1 deletion ice-phishing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forta-ice-phishing-starter-kit",
"version": "0.1.10",
"version": "0.1.11",
"displayName": "Ice Phishing Detection Bot",
"description": "This bot detects if an account gains high number of approvals and if it transfers the approved funds",
"longDescription": "The bot's functionality revolves around identifying specific transaction patterns involving accounts or contracts. It detects instances where an account, whether an externally owned account (EOA) with a low nonce or an unverified contract with a low transaction count, garners a unusually high number of approvals or ERC20 permissions, subsequently transferring the approved funds. The bot extends its analysis to EOAs with high nonces or verified contracts with limited transactions, emitting alerts of lower severity. Moreover, it scrutinizes the involvement of accounts or contracts flagged in the ScamSniffer database or identified by the Malicious Smart Contract ML Bot v2 alert, particularly in Approval, Transfer, or permit transactions. The bot's multifaceted approach contributes to a comprehensive monitoring system within the blockchain ecosystem, aimed at identifying potential anomalies or risks associated with transactional activities.",
Expand Down
17 changes: 0 additions & 17 deletions ice-phishing/src/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const {
isFailSafe,
} = require("./helper");
const {
createErrorAlert,
createHighNumApprovalsAlertERC20,
createHighNumApprovalsInfoAlertERC20,
createHighNumApprovalsAlertERC721,
Expand Down Expand Up @@ -571,10 +570,6 @@ const provideHandleTransaction =
} catch (e) {
tries++;
if (tries === 3) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(
createErrorAlert(e.toString(), "agent.handleTransaction (approvals-getCode)", stackTrace)
);
return findings;
}
console.log(`Attempt ${tries} to get the code failed, retrying...`);
Expand Down Expand Up @@ -1011,10 +1006,6 @@ const provideHandleTransaction =
try {
nonce = await getTransactionCount(txFrom, provider, blockNumber);
} catch (e) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(
createErrorAlert(e.toString(), "agent.handleTransaction (transfers-getTxCount)", stackTrace)
);
return findings;
}
if (nonce > 50000) continue;
Expand All @@ -1025,10 +1016,6 @@ const provideHandleTransaction =
try {
code = await provider.getCode(from);
} catch (e) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(
createErrorAlert(e.toString(), "agent.handleTransaction (transfers-getCode)", stackTrace)
);
return findings;
}
if (code === "0x") {
Expand All @@ -1041,10 +1028,6 @@ const provideHandleTransaction =
try {
fromNonce = await getTransactionCount(from, provider, blockNumber);
} catch (e) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(
createErrorAlert(e.toString(), "agent.handleTransaction (transfers-getTxCount2)", stackTrace)
);
return findings;
}
if (fromNonce < 3) {
Expand Down
9 changes: 0 additions & 9 deletions ice-phishing/src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const {
} = require("./utils");
const errorCache = require("./errorCache");
const AddressType = require("./address-type");
const { createErrorAlert } = require("./findings");

let getApiKeys;

Expand Down Expand Up @@ -279,10 +278,6 @@ async function getTransactionCount(address, provider, blockNumber) {
break; // exit the loop if successful
} catch (e) {
tries++;
if (tries === maxTries) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(createErrorAlert(e.toString(), "helper.getEoaType", stackTrace));
}
await new Promise((resolve) => setTimeout(resolve, 1000)); // wait for 1 second before retrying
}
}
Expand Down Expand Up @@ -399,10 +394,6 @@ async function getAddressType(address, scamAddresses, cachedAddresses, provider,
break; // exit the loop if successful
} catch (e) {
tries++;
if (tries === maxTries) {
const stackTrace = util.inspect(e, { showHidden: false, depth: null });
errorCache.add(createErrorAlert(e.toString(), "helper.getEoaType", stackTrace));
}
await new Promise((resolve) => setTimeout(resolve, 1000)); // wait for 1 second before retrying
}
}
Expand Down

0 comments on commit 7a97494

Please sign in to comment.