contribute
function is the lib.rs
is used for the contribution of sol to the fund, this is usually called by the users.
How this should usually work,
Transfer the sol from the user contract to this contract
increase the fund.amount_raised
increase the contribution of the user.
However it does not implement the later properly, there is no increment in contribution of the user, this can create problem in two front
Improper handling of the funds
The contributors are not able to refund the funds, if needed
The later seems more complication then the previous one, refund
function is implemented as follows
Here we can clearly see that the amount
is equal to the ctx.accounts.contribution
but because it was never incremented it will remain as the default value of 0
, the users cannot get a refund anymore.
None
Incrementing the user contribution on contribution will likely fix this issue.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.