Liquidator Contract
1. Review the Contract
2. Compile the Contract
npm run compile3. Deploy the Contract
npx hardhat run scripts/deploy.ts --network hedera_testnetLast updated
The LiquidatorContract.sol smart contract facilitates liquidations by interacting with the Bonzo lending pool and performing token swaps via SaucerSwap.
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).
Compile the contract using Hardhat:
npm run compileDeploy the contract to the Hedera testnet:
npx hardhat run scripts/deploy.ts --network hedera_testnetEnsure your hardhat.config.ts is set up for the Hedera testnet.
In deploy.ts, replace LendingPoolAddressesProvider_address and SaucerswapRouter_address with the actual contract addresses.
Last updated