47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
|
|
import { createPublicClient, http } from 'viem'
|
||
|
|
import { arbitrumSepolia } from 'viem/chains'
|
||
|
|
|
||
|
|
const client = createPublicClient({
|
||
|
|
chain: arbitrumSepolia,
|
||
|
|
transport: http('https://api.zan.top/node/v1/arb/sepolia/baf84c429d284bb5b676cb8c9ca21c07')
|
||
|
|
})
|
||
|
|
|
||
|
|
const CONFIGURATOR = '0x488409CE9A3Fcd8EbD373dCb7e025cF8AB96fcdc'
|
||
|
|
const LENDING_PROXY = '0xCb4E7B1069F6C26A1c27523ce4c8dfD884552d1D'
|
||
|
|
|
||
|
|
const OWNER_ABI = [
|
||
|
|
{
|
||
|
|
inputs: [],
|
||
|
|
name: 'owner',
|
||
|
|
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
||
|
|
stateMutability: 'view',
|
||
|
|
type: 'function'
|
||
|
|
}
|
||
|
|
]
|
||
|
|
|
||
|
|
async function main() {
|
||
|
|
console.log('🔍 检查合约 owner...\n')
|
||
|
|
|
||
|
|
try {
|
||
|
|
const configuratorOwner = await client.readContract({
|
||
|
|
address: CONFIGURATOR,
|
||
|
|
abi: OWNER_ABI,
|
||
|
|
functionName: 'owner'
|
||
|
|
})
|
||
|
|
|
||
|
|
const lendingOwner = await client.readContract({
|
||
|
|
address: LENDING_PROXY,
|
||
|
|
abi: OWNER_ABI,
|
||
|
|
functionName: 'owner'
|
||
|
|
})
|
||
|
|
|
||
|
|
console.log('Configurator Owner:', configuratorOwner)
|
||
|
|
console.log('Lending Proxy Owner:', lendingOwner)
|
||
|
|
|
||
|
|
} catch (error) {
|
||
|
|
console.error('❌ 读取 owner 失败:', error.message)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
main()
|