gelatodigital / gelato-network

V1 implementation of Gelato Network
https://gelato.network/
MIT License
231 stars 29 forks source link

Call notes 30.03.20 - with working solution to integrate Actions [ ]  #40

Open hilmarx opened 4 years ago

hilmarx commented 4 years ago

Summary:

Identified Problems with Conditions[] Actions[] approach:

Possible Solution:

Providers pay for users to execute an action. Hence they want to be sure that certain requirements (i.e. terms of service) are met beforehand. To ensure composability, the actions will have to be self-sufficient (aka be able to pay for themselves without the presence of any other action). This means, we can still enable exex() to accept an Actions[ ] array, however we would have to make each ActionConditionsOkCheck individually, possibly doing some (like ERC20 balance check) more than once.

hilmarx commented 4 years ago

Vulnerability with Actions []. Out of Gas reverts! If user can combine whitelisted actions arbitrary, they can result in the calls to consume more than 6M gas, which will lead to a revert and a payment for the provider, but without any fees. Note this is a grieving vector, as users still have to pay for minting the claim in the first place.

gitpusha commented 4 years ago

Resulting Q: Do we need to whitelist conditions?

I think we still do because there could be buggy conditions that eat up all the gas and cause a revert refund payable by provider.