Platform: Code4rena
Start Date: 09/12/2022
Pot Size: $90,500 USDC
Total HM: 35
Participants: 84
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 12
Id: 192
League: ETH
Rank: 70/84
Findings: 1
Award: $13.76
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: yjrwkk
Also found by: 0x4non, 0xDecorativePineapple, 0xdeadbeef0x, Avci, Critical, Deivitto, Dinesh11G, Englave, Tointer, ak1, chaduke, izhelyazkov, pwnforce, rbserver, rvierdiiev, unforgiven
13.7578 USDC - $13.76
The StableVault
has a deposit
function, which allows a user to deposit a whitelisted token in exchange for tigAsset
.
If the whitelisted token has above 18 decimals, the deposit
and depositWithPermit
functions will revert, thus rendering any asset with > 18 decimals incompatible with the protocol.
deploy/00.Mocks.js
script.test/06.StableVault.js
:it("Listing and depositing a token with > 18 decimals", async function () { await stablevault.connect(owner).listToken(MockBigDecimal.address); await mockBD.connect(owner).approve(StableVault.address, 5000000); await (stablevault.connect(owner).deposit(MockBigDecimal.address, 100000)); })
Error: VM Exception while processing transaction: reverted with panic code 0x11 (Arithmetic operation underflowed or overflowed outside of an unchecked block)
VS Code Plugins, Hardhat
Explicitly add a check or a comment if the StableVault is not meant to support tokens with > 18 decimals.
#0 - c4-judge
2022-12-20T15:43:27Z
GalloDaSballo marked the issue as duplicate of #533
#1 - c4-judge
2023-01-22T17:45:06Z
GalloDaSballo marked the issue as satisfactory