There is currently no way to withdraw the remaining dust from the tokens. Depending on the quantities used and the number of users interacting with the contract, over time, dust will accumulate that cannot be withdrawn.
Small loss of funds that may escalate over time and with the number of users utilizing the contract.
Accumulation of dust that remain unused.
describe("LiquidationPool Dust", () => {
it("Test", async () => {
const holders = [];
let stakeValue = ethers.utils.parseEther('10');
let initialEUROsManagerBalance = 45612378345315;
for (let i = 0; i < 5; i++) {
wallet = ethers.Wallet.createRandom();
wallet = wallet.connect(ethers.provider);
await network.provider.send("hardhat_setBalance", [
wallet.address,
"0x1000000000000000",
]);
await TST.mint(wallet.address, stakeValue);
await EUROs.mint(wallet.address, stakeValue);
await TST.connect(wallet).approve(LiquidationPool.address, stakeValue);
await EUROs.connect(wallet).approve(LiquidationPool.address, stakeValue);
await LiquidationPool.connect(wallet).increasePosition(stakeValue, stakeValue);
holders.push(wallet);
}
await fastForward(DAY + 1);
await EUROs.mint(LiquidationPoolManager.address, initialEUROsManagerBalance);
await LiquidationPoolManager.distributeFees();
for (let i = 0; i < holders.length; i++) {
const position = await LiquidationPool.position(holders[i].address);
await LiquidationPool.connect(holders[i]).decreasePosition(position[0].TST, position[0].EUROs);
}
const finalPoolBalanceEUROs = await EUROs.balanceOf(LiquidationPool.address);
const finalPoolBalanceTST = await TST.balanceOf(LiquidationPool.address);
console.log({ finalPoolBalanceTST, finalPoolBalanceEUROs });
})
})
Find a way to distribute it to the users or create a function to withdraw the dust.