import { Safe, Safe__factory } from "../typechain-types";
async function contractExample() {
// Factory.connect 的优势
const safe = Safe__factory.connect(safeAddress, deployer);
// 1. 类型安全的参数检查
await safe.setup(
[owner1, owner2],
2, // threshold
ZeroAddress, // to
"0x", // data
ZeroAddress, // fallbackHandler
ZeroAddress, // paymentToken
0, // payment
ZeroAddress // paymentReceiver
);
// 2. IDE 自动补全支持
const owners = await safe.getOwners();
const threshold = await safe.getThreshold();
}