Description:Description\
The poolDeposit() of PoolDeposit.sol contract takes an array of Contribution struct which contains address of contributor and the amount they wanna send to rabbit contract, however the as per the current logic the contributors are not sending the token to rabbit address, the token amount is taken from the msg.sender of the poolDeposit().
we can see that the contribAmount is summed up in totalAmount and an even is emited by saying that the contributor is the depositor of the contribAmount.
But if we see the makeTransferFrom() call from poolDeposit():
it is visible that the total amount of token is transfered from that msg.sender of poolDeposit(). But no token is taken from contributors and sent to msg.sender so that he can transfer those token to rabbit address.
Attack Scenario\
There is actually no attack scenario, it is a logic error.
Attachments
We can fix this issue by correcting the logic of this function:
poolDeposit() will be used by a third party to make multiple deposits on behalf of different contributors. It is normal that the tokens are pulled from the msg.sender (third party)
Github username: @itsabinashb Twitter username: 0xAbinash Submission hash (on-chain): 0x84ea4e08780bcbe46bc6966fcd459e21ac7bc9cd21124335848fce2280122c85 Severity: high
Description: Description\ The
poolDeposit()
of PoolDeposit.sol contract takes an array ofContribution
struct which contains address of contributor and the amount they wanna send to rabbit contract, however the as per the current logic the contributors are not sending the token to rabbit address, the token amount is taken from themsg.sender
of thepoolDeposit()
.Let's review the iteration of
contributions[]
:we can see that the
contribAmount
is summed up intotalAmount
and an even is emited by saying that thecontributor
is the depositor of thecontribAmount
. But if we see themakeTransferFrom()
call frompoolDeposit()
:it is visible that the total amount of token is transfered from that
msg.sender
ofpoolDeposit()
. But no token is taken from contributors and sent tomsg.sender
so that he can transfer those token to rabbit address.Attack Scenario\ There is actually no attack scenario, it is a logic error.
Attachments
We can fix this issue by correcting the logic of this function: