Skip to content

Commit

Permalink
BNB-29 | Forta Integration (#38)
Browse files Browse the repository at this point in the history
* forta init

* wip

* added high bnbx mint, high bnbx unstake

* wip

* rewards pct change done

* startDelegation, completeDelegation delay completed

* bot undelegation failures tracked

* readme update

* er-drop, bnbx-supply done

* README pdate

* minor changes

* small changes

* bots published

* added reorg fix

* fix: added blockNumber impl.

* updated logs

Co-authored-by: Dulguun <[email protected]>
  • Loading branch information
Manoj Patra and dulguun-staderlabs authored Dec 13, 2022
1 parent 970b292 commit 0c3f1f1
Show file tree
Hide file tree
Showing 37 changed files with 25,764 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
coverage
coverage.json
typechain
dist

#Hardhat files
cache
Expand Down
3 changes: 3 additions & 0 deletions agents/bot-operations-agent/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
forta.config.json
3 changes: 3 additions & 0 deletions agents/bot-operations-agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
forta.config.json
17 changes: 17 additions & 0 deletions agents/bot-operations-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build stage: compile Typescript to Javascript
FROM node:12-alpine AS builder
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build

# Final stage: copy compiled Javascript from previous stage and install production dependencies
FROM node:12-alpine
ENV NODE_ENV=production
# Uncomment the following line to enable agent logging
LABEL "network.forta.settings.agent-logs.enable"="true"
WORKDIR /app
COPY --from=builder /app/dist ./src
COPY package*.json ./
RUN npm ci --production
CMD [ "npm", "run", "start:prod" ]
56 changes: 56 additions & 0 deletions agents/bot-operations-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# BNBx Bot Operations Agent

## Supported Chains

- BSC

## Alerts

- BNBx-REWARD-CHANGE

- Fired when Reward changes by more than 0.5 %
- Severity is set to "Medium"
- Type is set to "Info"
- metadata: lastRewardAmount, curentRewardAmount

- BNBx-DAILY-REWARDS

- Fired when Daily Rewards is not executed
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastRewardsTime

- BNBx-START-DELEGATION

- Fired when StartDelegation is not executed for 36 hours
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastStartDelegationTime

- BNBx-COMPLETE-DELEGATION

- Fired when CompleteDelegation is not executed for 12 hours past StartDelegation
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastStartDelegationTime, lastCompleteDelegationTime

- BNBx-START-UNDELEGATION

- Fired when StartUndelegation is not executed for 7 days and 1 hours
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastStartUndelegationTime

- BNBx-UNDELEGATION-UPDATE

- Fired when undelegationStarted is not executed for 12 hours past StartUndelegation
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastStartDelegationTime, lastUndelegationUpdateTime

- BNBx-COMPLETE-UNDELEGATION

- Fired when CompleteUndelegation is not executed for 8 days and 12 hours past StartUndelegation
- Severity is set to "Critical"
- Type is set to "Info"
- metadata: lastStartUndelegationTime, lastCompleteUndelegationTime
5 changes: 5 additions & 0 deletions agents/bot-operations-agent/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
testPathIgnorePatterns: ["dist"],
};
Loading

0 comments on commit 0c3f1f1

Please sign in to comment.