Liquidator Contract
The LiquidatorContract.sol smart contract facilitates liquidations by interacting with the Bonzo lending pool and performing token swaps via SaucerSwap.
1. Review the Contract
You can find the contract code here.
Key Functions:
liquidate(): Initiates the flash loan and triggers the liquidation.executeOperation(): Called after receiving the flash-loaned amount; performs the liquidation and token swap._associateToken(): Associates Hedera tokens with the contract (required on Hedera).
2. Compile the Contract
Compile the contract using Hardhat:
npm run compile3. Deploy the Contract
Deploy the contract to the Hedera testnet:
npx hardhat run scripts/deploy.ts --network hedera_testnetEnsure your
hardhat.config.tsis set up for the Hedera testnet.In
deploy.ts, replaceLendingPoolAddressesProvider_addressandSaucerswapRouter_addresswith the actual contract addresses.
Last updated