Main Punch Caterpillar
Medium
The Minter
exchanges boostAddress
for collateralAddress
at a constant rate, which results in vulnerable trades.
When minting IBoostStablecoin
, the Minter
attempts to treat the underlying collateral asset as redeemable for IBoostStablecoin
at a one-to-one-rate.
For simplicity, let's assume that boostAddress
and collateralAddress
both 18
decimals of precision:
function mint(address to, uint256 amount) external whenNotPaused onlyContract onlyRole(MINTER_ROLE) {
IERC20Upgradeable(collateralAddress).safeTransferFrom(
msg.sender,
treasury,
- amount / (10 ** (boostDecimals - collateralDecimals))
+ amount
);
IBoostStablecoin(boostAddress).mint(to, amount);
emit TokenMinted(msg.sender, to, amount);
}
It is clear that the Minter
will attempt to mint at a constant rate for the underlying collateral, irrespective of the economic reality.
No response
- The price of collateral is trading at $1.00 and the price of boost is trading at $0.99.
- An authorized minter exchanges 100,000 of underlying in exchange for 100,000 boost.
In real terms, the minter has exchanged $100,000 of assets in exchange for $99,000 of boost (1% loss).
The Minter
does not respect the price volatility of the underlying stablecoin, resulting in unfair trades.
No response
Use a price oracle.