Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
superwunc committed Jun 18, 2024
1 parent 09df8b2 commit 7f888a2
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 21 deletions.
36 changes: 29 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

48 changes: 35 additions & 13 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ import * as core from '@actions/core'

import fs from 'node:fs'
import _ from 'lodash'

const PendleDeployer = [
'0x59aad2C81b86df6E4A0Dae51c5C5bd45Ba451875',
'0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7',
'0xC107DAcAf1d6e369CFDc67695BEAdf5e2068191e',
'0x196e6d50df6289e1F82838E84774b2B0c8f4aF62'
]
const MagpieDeployer = ['0x0cdb34e6a4d635142bb92fe403d38f636bbb77b8']
const WombatDeployer = [
'0x8c6644415b3F3CD7FC0A453c5bE3d3306Fe0b2F9',
'0xcB3Bb767104e0b3235520fafB182e005D7efD045'
]

const DeployList = PendleDeployer.concat(MagpieDeployer)
.concat(WombatDeployer)
.map(item => item.toLowerCase())
// Recursive function to get files
function getFiles(dir: string, files: string[] = []) {

Check failure on line 22 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Missing return type on function

Check failure on line 22 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Missing return type on function
// Get an array of all files and directories in the passed directory using fs.readdirSync
Expand Down Expand Up @@ -55,10 +71,7 @@ export async function run(): Promise<void> {
const data: any = await response.json()

Check failure on line 71 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 71 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (data.status === '1') {
data.result.forEach((item: any) => {

Check failure on line 73 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Prefer for...of instead of Array.forEach

Check failure on line 73 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 73 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Prefer for...of instead of Array.forEach

Check failure on line 73 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (
item.contractCreator.toLowerCase() !==
'0x0cdb34e6a4d635142bb92fe403d38f636bbb77b8'.toLowerCase()
) {
if (!DeployList.includes(item.contractCreator.toLowerCase())) {
console.log(
`BSC\thttps://bscscan.com/address/${item.contractAddress}\t${item.contractCreator}`
)
Expand All @@ -73,10 +86,7 @@ export async function run(): Promise<void> {
const data: any = await response.json()

Check failure on line 86 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 86 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (data.status === '1') {
data.result.forEach((item: any) => {

Check failure on line 88 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Prefer for...of instead of Array.forEach

Check failure on line 88 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 88 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Prefer for...of instead of Array.forEach

Check failure on line 88 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (
item.contractCreator.toLowerCase() !==
'0x0cdb34e6a4d635142bb92fe403d38f636bbb77b8'.toLowerCase()
) {
if (!DeployList.includes(item.contractCreator.toLowerCase())) {
console.log(
`ETH\thttps://etherscan.com/address/${item.contractAddress}\t${item.contractCreator}`
)
Expand All @@ -92,12 +102,24 @@ export async function run(): Promise<void> {
const data: any = await response.json()

Check failure on line 102 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 102 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (data.status === '1') {
data.result.forEach((item: any) => {

Check failure on line 104 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Prefer for...of instead of Array.forEach

Check failure on line 104 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 104 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Prefer for...of instead of Array.forEach

Check failure on line 104 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (
item.contractCreator.toLowerCase() !==
'0x0cdb34e6a4d635142bb92fe403d38f636bbb77b8'.toLowerCase()
) {
if (!DeployList.includes(item.contractCreator.toLowerCase())) {
console.log(
`OPT\thttps://optimistic.etherscan.io/address/${item.contractAddress}\t${item.contractCreator}`
)
}
})
}
}
response = await fetch(
`https://api.arbiscan.io/api?module=contract&action=getcontractcreation&contractaddresses=${contractAddress.join(',')}&apikey=GW3162V3DQ8IDU5XZYM28QK79W2K16CUYB`
)
if (response.ok) {
const data = await response.json()
if (data.status === '1') {
data.result.forEach((item: any) => {
if (!DeployList.includes(item.contractCreator.toLowerCase())) {
console.log(
`OPT\thttps://optimistic.etherscan.io//address/${item.contractAddress}\t${item.contractCreator}`
`ARB\thttps://arbiscan.io/address/${item.contractAddress}\t${item.contractCreator}`
)
}
})
Expand Down

0 comments on commit 7f888a2

Please sign in to comment.