You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, during the MsgSwapWithinBatch verification phase of MsgServer, if OfferCoinFee is zero, it is calculated and filled according to the current SwapFeeRate.
However, this method does not specify OfferCoinFee exactly in the msg, which can cause confusion that users expect.
so after this update, the proper OfferCoinFee should be in MsgSwapWithinBatch
and there is also a risk of using a small OfferCoin to pay less OfferCoinFee because it is currently being truncated when calculating OfferCoinFee, So It change to Ceil
v1.2.x: MsgSwapWithinBatch.OfferCoinFee should be OfferCoin * params.SwapFeeRate with Truncate or 0
v1.3.x: MsgSwapWithinBatch.OfferCoinFee should be OfferCoin * params.SwapFeeRate with Ceil
Proposal
When calculating OfferCoinFee, the decimal points are rounded up.
Add test code for MsgSwapWithinBatch validation and OfferCoinFee calculation
Corrected the missing part of the Spec doc and updated the above.
Fix reserveOfferCoinFee residual Issue due to decimal error
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Problem Definition
Currently, during the
MsgSwapWithinBatch
verification phase of MsgServer, ifOfferCoinFee
is zero, it is calculated and filled according to the current SwapFeeRate.However, this method does not specify
OfferCoinFee
exactly in the msg, which can cause confusion that users expect.so after this update, the proper OfferCoinFee should be in MsgSwapWithinBatch
and there is also a risk of using a small
OfferCoin
to pay lessOfferCoinFee
because it is currently being truncated when calculatingOfferCoinFee
, So It change to CeilMsgSwapWithinBatch.OfferCoinFee
should beOfferCoin
*params.SwapFeeRate
with Truncate or 0MsgSwapWithinBatch.OfferCoinFee
should beOfferCoin
*params.SwapFeeRate
with CeilProposal
When calculating
OfferCoinFee
, the decimal points are rounded up.Add test code for
MsgSwapWithinBatch
validation andOfferCoinFee
calculationCorrected the missing part of the Spec doc and updated the above.
Fix
reserveOfferCoinFee
residual Issue due to decimal errorFor Admin Use
The text was updated successfully, but these errors were encountered: