Bitcoin Balance monitor
Use Gatelang to monitor your bitcoin balance. In this example we monitor that the bitcoin balance in the reserve addrees equals the total supplt of kbtc on all supporte chains (ETH&OP)
use Call, BitcoinBalance from hexagate;
source kbtcEth: address = 0x73e0c0d45e048d25fc26fa3159b0aa04bfa4db98;
source kbtcOp: address = 0x73E0C0d45E048D25Fc26Fa3159b0aA04BfA4Db98;
source kbtcReserve: integer = BitcoinBalance {
address: "bc1qqwf6hexnnswmj6yuhz5xyj20frtp8exv7mclck"
};
source ethSupply: integer = Call {
contract: kbtcEth,
signature: "function totalSupply() returns (uint256)",
chainId: 1
};
source opSupply: integer = Call {
contract: kbtcOp,
signature: "function totalSupply() returns (uint256)",
chainId: 10
};
rule {
description: "kBTC reserve invariant: BTC ($kbtcReserve) != ETH ($ethSupply) + OP ($opSupply)",
condition: kbtcReserve == ethSupply + opSupply
};Last updated