Closed code423n4 closed 2 years ago
https://github.com/Rari-Capital/solmate/blob/1205a9067ff957ef8b0b003ff9d77c20ef9f2e0b/src/mixins/ERC4626.sol#L67
Resubmitting this issue with a better explanation, apologize for the double submit.
In the mint function, it should produce shares token, but there is an inattention mistake and it produces amount tokens.
shares
amount
Assume the contract manages 1000 assets for 10 shares, if you call mint for 10 shares, you'll in fact create 1000.
mint
I am developing a contract using the ERC4626 standard
Replace amount by shares
https://github.com/code-423n4/2022-02-tribe-turbo-findings/issues/18
Finding is valid, however it's a duplicate by the same warden, marking as invalid
Lines of code
https://github.com/Rari-Capital/solmate/blob/1205a9067ff957ef8b0b003ff9d77c20ef9f2e0b/src/mixins/ERC4626.sol#L67
Vulnerability details
Resubmitting this issue with a better explanation, apologize for the double submit.
Impact
In the mint function, it should produce
shares
token, but there is an inattention mistake and it producesamount
tokens.Proof of Concept
https://github.com/Rari-Capital/solmate/blob/1205a9067ff957ef8b0b003ff9d77c20ef9f2e0b/src/mixins/ERC4626.sol#L67
Assume the contract manages 1000 assets for 10 shares, if you call
mint
for 10 shares, you'll in fact create 1000.Tools Used
I am developing a contract using the ERC4626 standard
Recommended Mitigation Steps
Replace
amount
byshares