Skip to content

Commit

Permalink
count legacy DAOs in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed May 31, 2024
1 parent 959188b commit 36ae1a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data/formulas/generic/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { GenericFormula, dbKeyForKeys } from '@/core'
export const daos: GenericFormula<number> = {
dynamic: true,
compute: async ({ query }) => {
// sg_dao and cw3_dao are beta/legacy DAO DAO (v0.2.5 and v0.3.0)
const [{ count }] = await query(
`SELECT COUNT(*) as "count" FROM (SELECT DISTINCT ON ("contractAddress") "contractAddress" FROM "WasmStateEvents" WHERE "key" = '${dbKeyForKeys(
'contract_info'
)}' AND ("value" LIKE '%cw-core%' OR "value" LIKE '%cwd-core%' OR "value" LIKE '%dao-core%') ORDER BY "contractAddress") tmp`
)}' AND ("value" LIKE '%cw-core%' OR "value" LIKE '%cwd-core%' OR "value" LIKE '%dao-core%' OR "value" LIKE '%sg_dao%' OR "value" LIKE '%cw3_dao%') ORDER BY "contractAddress") tmp`
)

return Number(count)
Expand Down

0 comments on commit 36ae1a0

Please sign in to comment.