Submitted by Svetoslavb, also found by dvrkzy, iam_emptyset, samuraii77, nfmelendez, Team_RockSolid, dhank, PetarTolev, Shaheen, Greed, Gosho, and rbserver
When transferring a token, which is of type fee-on-transfer, in THORChain_Router::_transferOutAndCallV5, the token is first deposited to the THORChain_Aggregator and then THORChain_Aggregator::swapOutV5 is called with the same amount. The call will always revert if the THORChain_Aggregator does not have tokens or grief/steal (depending on the token) of THORChain_Aggregators tokens.
An example of a fee-on-transfer token that is in the whitelist is PAXG (see here) to view the loss of funds that are locked and waiting to be rescued in the THORChain_Aggregator.
To reproduce this, please add the following test fee-on-transfer token. Create a file inside ethereum/contracts with the name FeeOnTransferToken.sol.
Paste this inside:
The next step is to add a test with this token. Because the other tests are with hard-coded gas asset assertion values, the easiest way is to add new test. Create a file in ethereum/test (next to other tests) and paste this:
Consider creating a safeTransfer function, similar to the safeTransferFrom.
Add this below THORChain_Router::safeTransferFrom:
In THORChain_Router::_transferOutAndCallV5:
Token-Transfer
the-eridanus (Thorchain) confirmed via duplicate Issue #15
