| name | ouc-onchain |
| description | Use this skill when you need to query on-chain data from EVM or ICP. This includes: ERC-7546 Dictionary state, OUC canister state, auditor pools, proposals, and upgrade status. Provides helper functions for cast and dfx calls.
|
| allowed-tools | Bash,Read |
OUC On-Chain Data Retrieval Skill
This skill provides patterns for querying on-chain data from both EVM and ICP chains.
EVM Queries (via cast)
Query ERC-7546 Dictionary Implementation
cast call $DICTIONARY_ADDR "getImplementation(bytes4)(address)" $SELECTOR --rpc-url $RPC_URL
cast call $DICTIONARY_ADDR "owner()(address)" --rpc-url $RPC_URL
cast storage $CONTRACT_ADDR $SLOT --rpc-url $RPC_URL
Query ERC-7546 Proxy
DICTIONARY_SLOT="0x267691be3525af8a813d30db0c9e2bad5b0d2c0f67d9e4f1c769018cff56f4"
cast storage $PROXY_ADDR $DICTIONARY_SLOT --rpc-url $RPC_URL
Block Information
cast block-number --rpc-url $RPC_URL
cast block latest --json --rpc-url $RPC_URL | jq '.timestamp'
ICP Queries (via dfx)
Query OUC Canister
dfx canister call ouc getVersion
dfx canister call ouc getProposalCount
dfx canister call ouc getProposal '(0)'
dfx canister call ouc getAuditorCount
Canister Status
dfx canister status ouc
dfx canister id ouc
Common Patterns
Compare Local vs Deployed (EVM)
- Read local handler selectors from SPEC.toml or source code
- Query dictionary for each selector's implementation
- Check if implementation addresses match expected
- Detect zombie references (impl with no code)
Upgrade Detection
- Take baseline snapshot (dictionary state at block N)
- Take current snapshot (dictionary state now)
- Compare implementations for each selector
- Detect Added/Removed/Changed/Unchanged
Risk Assessment for Auditor Assignment
Based on detected changes:
- Critical: Zombie references detected
- High: Multiple selector changes, core function upgrades
- Medium: Single selector change, non-critical function
- Low: Minor updates, configuration changes
- None: No changes detected
Environment Variables
export RPC_URL="https://eth.llamarpc.com"
export DICTIONARY_ADDR="0x..."
export PROXY_ADDR="0x..."
export DFX_NETWORK="local"
Helper Functions
Parse hex address from cast output
parse_address() {
echo "0x$(echo $1 | sed 's/0x//' | tail -c 41)"
}
Check if address has code
has_code() {
local size=$(cast codesize $1 --rpc-url $RPC_URL)
[ "$size" != "0" ]
}