Skip to content

Collecting fee before or after token transfer, does it matters ? #1

@datgrog

Description

@datgrog

Hi, just wondering about the order of fee collection in case of a revert / not enough fund case scenario:

  • xCheque(...) fn transfer the fee before transfering the amount to the dst contract
  • xChai(...) fn transfer the fee after transfering the amount to the dst contract

Does it technically matters at some point?

+ exitChai() questions

  • The fn collect the fee in chai, why not collecting in dai ? My guess is that It would introduce a SafeMath.sol and it's a burden you want to avoid ?
  • The fn use dai.balanceOf(address(this)) to avoid computing the amount passed in dai but is it safe ? Why not calling chai.dai(sender) beforehand and use chai.draw() instead ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions