Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can create infinite amount of payouts per claim #106

Open
rapidddenis opened this issue May 29, 2023 · 1 comment
Open

can create infinite amount of payouts per claim #106

rapidddenis opened this issue May 29, 2023 · 1 comment

Comments

@rapidddenis
Copy link

rapidddenis commented May 29, 2023

in createPayout

function createPayout(
bytes32 processId,
uint256 claimId,
uint256 payoutAmount,
bytes calldata data
)

Implementation does not limits number of payouts per claim nor limits their cumulative payoutAmount.
In this situation it is possible to create any number of payouts with their cumulative payoutAmount exceeding claim.claimAmount and then process them. In this case claim.paidAmount > claim.claimAmount and claim will refuse to close.

@rapidddenis rapidddenis changed the title can create infinite amount of payouts per claim when claim.confirmedAmount > 0 can create infinite amount of payouts per claim May 29, 2023
@matthiaszimmermann
Copy link
Contributor

true, this observation is also valid for createClaim an arbitrary amount of claims can be created per policy.

we will need to consider if we want to limit these numbers. when we do it would consume some additional gas which every user has to pay. when we keep the current state it is either the product owner or the policy holder (depending on product implementtion) who pays the gas for creating claims/payouts which creates an incentive not to open an arbitrary amount of claims/payouts.

let's consider the situation where the product owner pays the gas for creating claims/payouts. it is in the direct interest of the product owner to restrict these numbers which will make the product owner implement the product in a way to implement these checks (with the benefit that only stakeholders to that product pay more for creating claims/payouts).

when the policy holder pays the gas for creating claims/payouts the situation might be similar as it is expensive to the policy holder to create claims/payouts. the product owner needs to decide if she/he feels comfortable whith the situation or if restricting these numbers is an attack vector they don't want to live with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants