From 7702e378b997f0bec423a56459a1f26d59c12a2f Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 16:38:26 +0200 Subject: [PATCH 1/8] feat: add more informative description in case of STONKS EasyTrack motion event --- .../src/abi/TopUpAllowedRecipients.json | 1 + ethereum-governance/src/common/constants.ts | 1 + .../subagents/easy-track/agent-easy-track.ts | 5 +++- .../src/subagents/easy-track/constants.ts | 4 +++ .../src/subagents/easy-track/utils.ts | 29 +++++++++++++++++++ .../stonks-order-watcher.ts | 7 ++--- 6 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 ethereum-governance/src/abi/TopUpAllowedRecipients.json diff --git a/ethereum-governance/src/abi/TopUpAllowedRecipients.json b/ethereum-governance/src/abi/TopUpAllowedRecipients.json new file mode 100644 index 00000000..7ac84c5f --- /dev/null +++ b/ethereum-governance/src/abi/TopUpAllowedRecipients.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"address","name":"_trustedCaller","type":"address"},{"internalType":"address","name":"_allowedRecipientsRegistry","type":"address"},{"internalType":"address","name":"_finance","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_easyTrack","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"allowedRecipientsRegistry","outputs":[{"internalType":"contract AllowedRecipientsRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_creator","type":"address"},{"internalType":"bytes","name":"_evmScriptCallData","type":"bytes"}],"name":"createEVMScript","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_evmScriptCallData","type":"bytes"}],"name":"decodeEVMScriptCallData","outputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"easyTrack","outputs":[{"internalType":"contract EasyTrack","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finance","outputs":[{"internalType":"contract IFinance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trustedCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] diff --git a/ethereum-governance/src/common/constants.ts b/ethereum-governance/src/common/constants.ts index 09c66ca6..e1bc566a 100644 --- a/ethereum-governance/src/common/constants.ts +++ b/ethereum-governance/src/common/constants.ts @@ -74,6 +74,7 @@ export const INCREASE_STAKING_LIMIT_ADDRESS = "0xfebd8fac16de88206d4b18764e826af38546afe0"; export const REWARD_PROGRAMS_REGISTRY_ADDRESS = "0xfcad241d9d2a2766979a2de208e8210edf7b7d4f"; +export const STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT = "0x6e04aed774b7c89bb43721acdd7d03c872a51b69" // Other export const DEPOSIT_EXECUTOR_ADDRESS = diff --git a/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts b/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts index 86aa43e9..2a1e2a22 100644 --- a/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts +++ b/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts @@ -10,13 +10,14 @@ import { ethersProvider } from "../../ethers"; import INCREASE_STAKING_LIMIT_ABI from "../../abi/IncreaseStakingLimit.json"; import NODE_OPERATORS_REGISTRY_ABI from "../../abi/NodeOperatorsRegistry.json"; -import { getMotionLink, getMotionType } from "./utils"; +import { buildStonksTopUpDescription, getMotionLink, getMotionType } from "./utils"; import { handleEventsOfNotice, RedefineMode, requireWithTier, } from "../../common/utils"; import type * as Constants from "./constants"; +import { EASY_TRACK_STONKS_CONTRACTS } from "./constants"; export const name = "EasyTrack"; @@ -95,6 +96,8 @@ async function handleEasyTrackMotionCreated( } else { description += `\nNo issues with keys! ✅`; } + } else if (EASY_TRACK_STONKS_CONTRACTS.includes(args._evmScriptFactory.toLowerCase())){ + description += `\n${await buildStonksTopUpDescription(args)}` } findings.push( Finding.fromObject({ diff --git a/ethereum-governance/src/subagents/easy-track/constants.ts b/ethereum-governance/src/subagents/easy-track/constants.ts index 1835f6f1..6155935a 100644 --- a/ethereum-governance/src/subagents/easy-track/constants.ts +++ b/ethereum-governance/src/subagents/easy-track/constants.ts @@ -7,6 +7,7 @@ import { INCREASE_STAKING_LIMIT_ADDRESS as increaseStakinigLimitAddress, EVM_SCRIPT_EXECUTOR_ADDRESS as evmExecutorAddress, REWARD_PROGRAMS_REGISTRY_ADDRESS as rewardProgramRegAddress, + STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT, } from "../../common/constants"; export const INCREASE_STAKING_LIMIT_ADDRESS = increaseStakinigLimitAddress; @@ -191,3 +192,6 @@ export const EASY_TRACK_TYPES_BY_FACTORIES = new Map([ "Top up recipients (stETH reWARDS)", ], ]); + + +export const EASY_TRACK_STONKS_CONTRACTS = [STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT] diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index 185a15e9..c8378227 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -1,3 +1,8 @@ +import { ethers } from "forta-agent"; +import TOP_UP_ALLOWED_RECIPIENTS_ABI from "../../abi/TopUpAllowedRecipients.json"; +import { ethersProvider } from "../../ethers"; +import { STONKS } from "../stonks-order-watcher/constants"; + export const getMotionType = ( types: Map, evmScriptFactory: string, @@ -8,3 +13,27 @@ export const getMotionType = ( export const getMotionLink = (motionId: string) => { return `[${motionId}](https://easytrack.lido.fi/motions/${motionId})`; }; + +// this helper placed here because it's used in handling easy track motion events +export const buildStonksTopUpDescription = async (args: any): Promise => { + const topUpContract = new ethers.Contract( + args._evmScriptFactory, + TOP_UP_ALLOWED_RECIPIENTS_ABI, + ethersProvider, + ); + const data = await topUpContract.decodeEVMScriptCallData( + args._evmScriptCallData, + ); + const {recipients, amounts} = data + const descriptions = recipients.map((recipient: string, idx: number) => { + const stonksData = getStonksContractInfo(recipient); + const amount = ethers.utils.formatUnits(amounts[idx]); + const etherScanAddress = `[${stonksData?.from} -> ${stonksData?.to}](https://etherscan.io/address/${recipient})`; + return `${etherScanAddress} pair with ${amount} stETH`; + }); + return `Top up STONKS:\n ${descriptions.join("\n")}`; +}; + +const getStonksContractInfo = (address: string) => { + return STONKS.find((c) => c.address === address); +} diff --git a/ethereum-governance/src/subagents/stonks-order-watcher/stonks-order-watcher.ts b/ethereum-governance/src/subagents/stonks-order-watcher/stonks-order-watcher.ts index 04fe4db2..3126e4f5 100644 --- a/ethereum-governance/src/subagents/stonks-order-watcher/stonks-order-watcher.ts +++ b/ethereum-governance/src/subagents/stonks-order-watcher/stonks-order-watcher.ts @@ -111,8 +111,7 @@ export async function handleBlock(blockEvent: BlockEvent) { if (blockEvent.blockNumber % BLOCK_WINDOW != 0) { return []; } - const findings = await handleOrderSettlement(blockEvent); - return findings; + return handleOrderSettlement(blockEvent); } export async function handleTransaction(txEvent: TransactionEvent) { @@ -201,10 +200,10 @@ export async function handleOrderSettlement(txBlock: BlockEvent) { if (balance.lte(STETH_MAX_PRECISION)) { findings.push( Finding.fromObject({ - name: "✅ Stonks: order fulfill", + name: "✅ Stonks: order fulfilled", description: `Stonks order ${etherscanAddress( order.address, - )} was fulfill`, + )} was fulfilled`, alertId: "STONKS-ORDER-FULFILL", severity: FindingSeverity.Info, type: FindingType.Info, From c8092bb9bb8db50d2f4e89fd72e83d2a869c0f14 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 16:42:37 +0200 Subject: [PATCH 2/8] fix: prettier --- ethereum-governance/src/common/constants.ts | 3 ++- .../src/subagents/easy-track/agent-easy-track.ts | 14 +++++++++++--- .../src/subagents/easy-track/constants.ts | 5 +++-- .../src/subagents/easy-track/utils.ts | 8 +++++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ethereum-governance/src/common/constants.ts b/ethereum-governance/src/common/constants.ts index e1bc566a..43ad600a 100644 --- a/ethereum-governance/src/common/constants.ts +++ b/ethereum-governance/src/common/constants.ts @@ -74,7 +74,8 @@ export const INCREASE_STAKING_LIMIT_ADDRESS = "0xfebd8fac16de88206d4b18764e826af38546afe0"; export const REWARD_PROGRAMS_REGISTRY_ADDRESS = "0xfcad241d9d2a2766979a2de208e8210edf7b7d4f"; -export const STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT = "0x6e04aed774b7c89bb43721acdd7d03c872a51b69" +export const STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT = + "0x6e04aed774b7c89bb43721acdd7d03c872a51b69"; // Other export const DEPOSIT_EXECUTOR_ADDRESS = diff --git a/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts b/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts index 2a1e2a22..9d0747bd 100644 --- a/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts +++ b/ethereum-governance/src/subagents/easy-track/agent-easy-track.ts @@ -10,7 +10,11 @@ import { ethersProvider } from "../../ethers"; import INCREASE_STAKING_LIMIT_ABI from "../../abi/IncreaseStakingLimit.json"; import NODE_OPERATORS_REGISTRY_ABI from "../../abi/NodeOperatorsRegistry.json"; -import { buildStonksTopUpDescription, getMotionLink, getMotionType } from "./utils"; +import { + buildStonksTopUpDescription, + getMotionLink, + getMotionType, +} from "./utils"; import { handleEventsOfNotice, RedefineMode, @@ -96,8 +100,12 @@ async function handleEasyTrackMotionCreated( } else { description += `\nNo issues with keys! ✅`; } - } else if (EASY_TRACK_STONKS_CONTRACTS.includes(args._evmScriptFactory.toLowerCase())){ - description += `\n${await buildStonksTopUpDescription(args)}` + } else if ( + EASY_TRACK_STONKS_CONTRACTS.includes( + args._evmScriptFactory.toLowerCase(), + ) + ) { + description += `\n${await buildStonksTopUpDescription(args)}`; } findings.push( Finding.fromObject({ diff --git a/ethereum-governance/src/subagents/easy-track/constants.ts b/ethereum-governance/src/subagents/easy-track/constants.ts index 6155935a..6eb0b48a 100644 --- a/ethereum-governance/src/subagents/easy-track/constants.ts +++ b/ethereum-governance/src/subagents/easy-track/constants.ts @@ -193,5 +193,6 @@ export const EASY_TRACK_TYPES_BY_FACTORIES = new Map([ ], ]); - -export const EASY_TRACK_STONKS_CONTRACTS = [STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT] +export const EASY_TRACK_STONKS_CONTRACTS = [ + STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT, +]; diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index c8378227..6c995f26 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -15,7 +15,9 @@ export const getMotionLink = (motionId: string) => { }; // this helper placed here because it's used in handling easy track motion events -export const buildStonksTopUpDescription = async (args: any): Promise => { +export const buildStonksTopUpDescription = async ( + args: any, +): Promise => { const topUpContract = new ethers.Contract( args._evmScriptFactory, TOP_UP_ALLOWED_RECIPIENTS_ABI, @@ -24,7 +26,7 @@ export const buildStonksTopUpDescription = async (args: any): Promise => const data = await topUpContract.decodeEVMScriptCallData( args._evmScriptCallData, ); - const {recipients, amounts} = data + const { recipients, amounts } = data; const descriptions = recipients.map((recipient: string, idx: number) => { const stonksData = getStonksContractInfo(recipient); const amount = ethers.utils.formatUnits(amounts[idx]); @@ -36,4 +38,4 @@ export const buildStonksTopUpDescription = async (args: any): Promise => const getStonksContractInfo = (address: string) => { return STONKS.find((c) => c.address === address); -} +}; From d011f2b34677574275da50f17c0a50cef246f0c0 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 16:52:39 +0200 Subject: [PATCH 3/8] fix: remove redundant var --- ethereum-governance/src/subagents/easy-track/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index 6c995f26..370ac2e4 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -23,10 +23,9 @@ export const buildStonksTopUpDescription = async ( TOP_UP_ALLOWED_RECIPIENTS_ABI, ethersProvider, ); - const data = await topUpContract.decodeEVMScriptCallData( + const { recipients, amounts } = await topUpContract.decodeEVMScriptCallData( args._evmScriptCallData, ); - const { recipients, amounts } = data; const descriptions = recipients.map((recipient: string, idx: number) => { const stonksData = getStonksContractInfo(recipient); const amount = ethers.utils.formatUnits(amounts[idx]); From 2a91b4a7e86db011f537d78ccd13eeacd4f89eba Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 17:14:10 +0200 Subject: [PATCH 4/8] fix: simplified imports --- ethereum-governance/src/subagents/easy-track/utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index 370ac2e4..7e3ca447 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -1,6 +1,5 @@ -import { ethers } from "forta-agent"; +import { ethers, getEthersProvider } from "forta-agent"; import TOP_UP_ALLOWED_RECIPIENTS_ABI from "../../abi/TopUpAllowedRecipients.json"; -import { ethersProvider } from "../../ethers"; import { STONKS } from "../stonks-order-watcher/constants"; export const getMotionType = ( @@ -21,7 +20,7 @@ export const buildStonksTopUpDescription = async ( const topUpContract = new ethers.Contract( args._evmScriptFactory, TOP_UP_ALLOWED_RECIPIENTS_ABI, - ethersProvider, + getEthersProvider(), ); const { recipients, amounts } = await topUpContract.decodeEVMScriptCallData( args._evmScriptCallData, From 77d8abe6a780eb23a6fd0573fe49a957a09284d8 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 17:22:01 +0200 Subject: [PATCH 5/8] fix: build etherscan address in one place --- ethereum-governance/src/common/utils.ts | 4 ++-- ethereum-governance/src/subagents/easy-track/utils.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ethereum-governance/src/common/utils.ts b/ethereum-governance/src/common/utils.ts index 238c74cd..9fe61d72 100644 --- a/ethereum-governance/src/common/utils.ts +++ b/ethereum-governance/src/common/utils.ts @@ -44,8 +44,8 @@ function getSubpathForNetwork(): string { return ""; } -export function etherscanAddress(address: string): string { - return `[${address}](https://${getSubpathForNetwork()}etherscan.io/address/${address})`; +export function etherscanAddress(address: string, text?: string): string { + return `[${text ? text : address}](https://${getSubpathForNetwork()}etherscan.io/address/${address})`; } export function etherscanNft(address: string, id: number | string): string { diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index 7e3ca447..c23c089c 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -1,6 +1,7 @@ import { ethers, getEthersProvider } from "forta-agent"; import TOP_UP_ALLOWED_RECIPIENTS_ABI from "../../abi/TopUpAllowedRecipients.json"; import { STONKS } from "../stonks-order-watcher/constants"; +import { etherscanAddress } from "../../common/utils"; export const getMotionType = ( types: Map, @@ -28,7 +29,7 @@ export const buildStonksTopUpDescription = async ( const descriptions = recipients.map((recipient: string, idx: number) => { const stonksData = getStonksContractInfo(recipient); const amount = ethers.utils.formatUnits(amounts[idx]); - const etherScanAddress = `[${stonksData?.from} -> ${stonksData?.to}](https://etherscan.io/address/${recipient})`; + const etherScanAddress = etherscanAddress(recipient, `${stonksData?.from} -> ${stonksData?.to}`) return `${etherScanAddress} pair with ${amount} stETH`; }); return `Top up STONKS:\n ${descriptions.join("\n")}`; From c7c735c848facf6df1079b29a0efea7ea8cc96e1 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 17:24:22 +0200 Subject: [PATCH 6/8] fix: simplify etherscanAddress signature --- ethereum-governance/src/common/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereum-governance/src/common/utils.ts b/ethereum-governance/src/common/utils.ts index 9fe61d72..1763597f 100644 --- a/ethereum-governance/src/common/utils.ts +++ b/ethereum-governance/src/common/utils.ts @@ -44,8 +44,8 @@ function getSubpathForNetwork(): string { return ""; } -export function etherscanAddress(address: string, text?: string): string { - return `[${text ? text : address}](https://${getSubpathForNetwork()}etherscan.io/address/${address})`; +export function etherscanAddress(address: string, text = address): string { + return `[${text}](https://${getSubpathForNetwork()}etherscan.io/address/${address})`; } export function etherscanNft(address: string, id: number | string): string { From 61a9af85f02aab1f39486093c5590a1ce4583fa5 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 17:25:15 +0200 Subject: [PATCH 7/8] fix: prettier --- ethereum-governance/src/subagents/easy-track/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index c23c089c..6605fe8f 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -29,7 +29,10 @@ export const buildStonksTopUpDescription = async ( const descriptions = recipients.map((recipient: string, idx: number) => { const stonksData = getStonksContractInfo(recipient); const amount = ethers.utils.formatUnits(amounts[idx]); - const etherScanAddress = etherscanAddress(recipient, `${stonksData?.from} -> ${stonksData?.to}`) + const etherScanAddress = etherscanAddress( + recipient, + `${stonksData?.from} -> ${stonksData?.to}`, + ); return `${etherScanAddress} pair with ${amount} stETH`; }); return `Top up STONKS:\n ${descriptions.join("\n")}`; From 0681375d4edcdf33f9a65749d84021ed9fc80a53 Mon Sep 17 00:00:00 2001 From: Ivan Feofanov Date: Fri, 19 Apr 2024 20:33:50 +0200 Subject: [PATCH 8/8] fix: renamed constant to follow the common naming conventions, changed eth amount formatter to more precise one --- ethereum-governance/src/common/constants.ts | 2 +- ethereum-governance/src/common/utils.ts | 17 +++++++++++++++++ .../src/subagents/easy-track/constants.ts | 4 ++-- .../src/subagents/easy-track/utils.ts | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ethereum-governance/src/common/constants.ts b/ethereum-governance/src/common/constants.ts index 43ad600a..bb059d42 100644 --- a/ethereum-governance/src/common/constants.ts +++ b/ethereum-governance/src/common/constants.ts @@ -74,7 +74,7 @@ export const INCREASE_STAKING_LIMIT_ADDRESS = "0xfebd8fac16de88206d4b18764e826af38546afe0"; export const REWARD_PROGRAMS_REGISTRY_ADDRESS = "0xfcad241d9d2a2766979a2de208e8210edf7b7d4f"; -export const STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT = +export const STONKS_TOP_UP_ALLOWED_RECIPIENTS_ADDRESS = "0x6e04aed774b7c89bb43721acdd7d03c872a51b69"; // Other diff --git a/ethereum-governance/src/common/utils.ts b/ethereum-governance/src/common/utils.ts index 1763597f..0b389350 100644 --- a/ethereum-governance/src/common/utils.ts +++ b/ethereum-governance/src/common/utils.ts @@ -1,5 +1,6 @@ import { Finding, FindingType, TransactionEvent } from "forta-agent"; import { RUN_TIER } from "./constants"; +import { BigNumberish, BigNumber, utils } from "ethers"; export enum RedefineMode { Strict = "strict", @@ -161,3 +162,19 @@ export function eventSig(abi: string) { argsRaw.map((arg) => args.push(arg.trim().split(" ")[0])); return `${name}(${args.join(",")})`; } + +export const formatToken = ( + amount: BigNumber, + decimals: BigNumberish, +): string => { + const amountStr = utils.formatUnits(amount, decimals); + + const formatter = new Intl.NumberFormat("en", { + maximumFractionDigits: 2, + minimumFractionDigits: 2, + }); + + return formatter.format(parseFloat(amountStr)); +}; + +export const formatEth = (amount: BigNumber): string => formatToken(amount, 18); diff --git a/ethereum-governance/src/subagents/easy-track/constants.ts b/ethereum-governance/src/subagents/easy-track/constants.ts index 6eb0b48a..bd0275c4 100644 --- a/ethereum-governance/src/subagents/easy-track/constants.ts +++ b/ethereum-governance/src/subagents/easy-track/constants.ts @@ -7,7 +7,7 @@ import { INCREASE_STAKING_LIMIT_ADDRESS as increaseStakinigLimitAddress, EVM_SCRIPT_EXECUTOR_ADDRESS as evmExecutorAddress, REWARD_PROGRAMS_REGISTRY_ADDRESS as rewardProgramRegAddress, - STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT, + STONKS_TOP_UP_ALLOWED_RECIPIENTS_ADDRESS, } from "../../common/constants"; export const INCREASE_STAKING_LIMIT_ADDRESS = increaseStakinigLimitAddress; @@ -194,5 +194,5 @@ export const EASY_TRACK_TYPES_BY_FACTORIES = new Map([ ]); export const EASY_TRACK_STONKS_CONTRACTS = [ - STONKS_TOP_UP_ALLOWED_RECIPIENTS_CONTRACT, + STONKS_TOP_UP_ALLOWED_RECIPIENTS_ADDRESS, ]; diff --git a/ethereum-governance/src/subagents/easy-track/utils.ts b/ethereum-governance/src/subagents/easy-track/utils.ts index 6605fe8f..0d654d85 100644 --- a/ethereum-governance/src/subagents/easy-track/utils.ts +++ b/ethereum-governance/src/subagents/easy-track/utils.ts @@ -1,7 +1,7 @@ import { ethers, getEthersProvider } from "forta-agent"; import TOP_UP_ALLOWED_RECIPIENTS_ABI from "../../abi/TopUpAllowedRecipients.json"; import { STONKS } from "../stonks-order-watcher/constants"; -import { etherscanAddress } from "../../common/utils"; +import { etherscanAddress, formatEth } from "../../common/utils"; export const getMotionType = ( types: Map, @@ -28,7 +28,7 @@ export const buildStonksTopUpDescription = async ( ); const descriptions = recipients.map((recipient: string, idx: number) => { const stonksData = getStonksContractInfo(recipient); - const amount = ethers.utils.formatUnits(amounts[idx]); + const amount = formatEth(amounts[idx]); const etherScanAddress = etherscanAddress( recipient, `${stonksData?.from} -> ${stonksData?.to}`,