bro-n-bro / spacebox

MIT License
35 stars 4 forks source link

Add admin-module #88

Closed bro-n-bro-0 closed 1 month ago

bro-n-bro-0 commented 1 month ago

https://docs.neutron.org/2.0/neutron/modules/admin-module/messages

messages might be in smart contract txs

in cosmwasm proposals

SELECT JSONExtractString(JSONExtractString(message, 'msg'), 'propose') as t FROM spacebox.message
WHERE type = '/cosmwasm.wasm.v1.MsgExecuteContract' and t != ''
iljagrabar14 commented 1 month ago

looks like we must search it in stargate

iljagrabar14 commented 1 month ago

i think i've found pattern how to find it

select *
from
(
    SELECT 
        *, 
        JSONExtractString(message, 'msg', 'propose', 'msg', 'propose', 'msgs') as propose,
        arrayJoin(JSONExtractArrayRaw(JSONExtractString(message, 'msg', 'propose', 'msg', 'propose', 'msgs'))) as s
    FROM spacebox.message
    WHERE `type` = '/cosmwasm.wasm.v1.MsgExecuteContract' and propose != '' and JSONExtractString(s, 'stargate') != ''
)
where JSONExtractString(s, 'stargate', 'type_url') = '/cosmos.adminmodule.adminmodule.MsgAddAdmin'
limit 4

but i can't parse message, here is some issue with decoding

value example

CkJuZXV0cm9uMXN1aGdmNXN2aHU0dXNydXJ2eHpsZ241NGtzeG1uOGdsamFyanR4cW5hcHY4a2pucDRucnN0ZHh2ZmYSQm5ldXRyb24xempncDZjYTZuNjhhcjU3Z2xyczRyOHpmZnFmOXR4amNxZDNrdWxzNjA0NmE1eDd6ZHZ5c3lyazhqaw==

decoded value

Bneutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvffBneutron1zjgp6ca6n68ar57glrs4r8zffqf9txjcqd3kuls6046a5x7zdvysyrk8jk
iljagrabar14 commented 1 month ago

save value as undecoded string