Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit ea68ff9

Browse files
committed
first commit
0 parents  commit ea68ff9

File tree

12 files changed

+5257
-0
lines changed

12 files changed

+5257
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
forta.config.json

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
dist
3+
forta.config.json
4+
**/.DS_Store
5+
.vscode
6+
**/node_modules/
7+
**/.env
8+
**/cache/
9+
**/.ipynb_checkpoints
10+
**/__pycache__
11+
**/artifacts/

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build stage: compile Typescript to Javascript
2+
FROM node:12-alpine AS builder
3+
WORKDIR /app
4+
COPY . .
5+
RUN npm ci
6+
RUN npm run build
7+
# obfuscate compiled Javascript (optional)
8+
# RUN npm install -g javascript-obfuscator
9+
# RUN javascript-obfuscator ./dist --output ./obfuscated --split-strings true --split-strings-chunk-length 3
10+
11+
# Final stage: copy compiled Javascript from previous stage and install production dependencies
12+
FROM node:12-alpine
13+
ENV NODE_ENV=production
14+
WORKDIR /app
15+
# if using obfuscated code:
16+
# COPY --from=builder /app/obfuscated ./src
17+
# else if using unobfuscated code:
18+
COPY --from=builder /app/dist ./src
19+
COPY package*.json ./
20+
RUN npm ci --production
21+
CMD [ "npm", "run", "start:prod" ]

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# High Gas Agent
2+
3+
## Description
4+
5+
This agent detects transactions with high gas consumption
6+
7+
## Supported Chains
8+
9+
- Ethereum
10+
- List any other chains this agent can support e.g. BSC
11+
12+
## Alerts
13+
14+
Describe each of the type of alerts fired by this agent
15+
16+
- FORTA-1
17+
- Fired when a transaction consumes more gas than 1,000,000 gas
18+
- Severity is always set to "medium" (mention any conditions where it could be something else)
19+
- Type is always set to "suspicious" (mention any conditions where it could be something else)
20+
- Mention any other type of metadata fields included with this alert
21+
22+
## Test Data
23+
24+
The agent behaviour can be verified with the following transactions:
25+
26+
- 0x1b71dcc24657989f920d627c7768f545d70fcb861c9a05824f7f5d056968aeee (1,094,700 gas)
27+
- 0x8df0579bf65e859f87c45b485b8f1879c56bc818043c3a0d6870c410b5013266 (2,348,226 gas)

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node",
4+
testPathIgnorePatterns: ["dist"],
5+
};

0 commit comments

Comments
 (0)