sherlock-2023-08-cooler-h03
[H-03] Clearinghouse.sol#claimDefaulted() - Clearinghouse doesn’t approve the MINTR to handle tokens in his name, which bricks the entire function
Summary
Clearinghouse 소유 토큰을 MINTR 가 사용하는 것을 허용하는 코드가 없다. 따라서 MINTR.burnOhm() 호출은 동작하지 않고, 프로토콜이 동작하지 않는다.
Keyword
erc20, logic flaw
Vulnerability
function claimDefaulted(address[] calldata coolers_, uint256[] calldata loans_) external {
...
@> MINTR.burnOhm(address(this), staking.unstake(address(this), totalCollateral - keeperRewards, false, false));
}Clearinghouse.claimDefaulted 의 마지막 라인에서 MINTR.burnOhm() 를 호출한다. 이는 OHM.burnFrom 를 호출해 OHM 토큰을 소각한다.
MINTR.burnOhm() 문서를 보면, Burn OHM from an address. Must have approval 로 반드시 토큰 사용을 허용받아야 한다고 명시한다. 따라서 MINTR.burnOhm()를 호출하기 전 Clearinghouse 의 토큰을 MINTER 가 사용할 수 있도록 허용해야 한다. 하지만 어디에서도 approve를 호출하지 않는다.
Impact
claimDefaulted 함수가 항상 실패한다. 프로토콜이 동작하지 않는다.
Mitigation
Clearinghouse의 OHM 토큰을 MINTR가 사용하는 것을 허용한다. (approve 호출)
tags: bughunting, olympus dao, smart contract, solidity, lending protocol, erc20, logic flaw, severity high