chi icon indicating copy to clipboard operation
chi copied to clipboard

Correct "value" in "modifier discountCHI"

Open vmish opened this issue 5 years ago • 0 comments

I have noticed different value in freeFromUpTo:

  • medium - (gasSpent + 14154) / 41947
modifier discountCHI {
    uint256 gasStart = gasleft();
    _;
    uint256 gasSpent = 21000 + gasStart - gasleft() + 16 * msg.data.length;
    chi.freeFromUpTo(msg.sender, (gasSpent + 14154) / 41947);
}
modifier discountCHI {
    uint256 gasStart = gasleft();
    _;
    uint256 gasSpent = 21000 + gasStart - gasleft() + 16 * msg.data.length;
    chi.freeFromUpTo(msg.sender, (gasSpent + 14154) / 41130);
}

Which is the right one?

vmish avatar Oct 03 '20 02:10 vmish