shentu icon indicating copy to clipboard operation
shentu copied to clipboard

Improve shield purchases and claims

Open dshe-certik opened this issue 4 years ago • 2 comments

Summary

When we create or update a pool, a purchase is made.

  • [ ] The purchaser is set to be shield admin rather than sponsor address. Considering the sponsor is the one who submits claims, it should be the sponsor address.
  • [ ] No purchase event is emitted. Should we move the purchase event from the handler to the keeper?
  • [ ] We should not allow adding service fees without any purchases, because service fees are updated when purchases expire.

When a proposal is submitted,

  • [ ] we didn't consider the case when we can't find the target purchase: https://github.com/certikfoundation/shentu/blob/master/x/shield/keeper/proposal.go#L52

For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged

dshe-certik avatar Nov 24 '20 21:11 dshe-certik

If a purchase couldn't be found with the provided poolID and purchaser, it would've errored out on L42, no?

jim380 avatar Nov 29 '20 03:11 jim380

If a purchase couldn't be found with the provided poolID and purchaser, it would've errored out on L42, no?

Right, but we didn't check if the target purchase ID exists or not for this purchaser.

dshe-certik avatar Nov 30 '20 16:11 dshe-certik