TransferToken fails to transfer and throws "Contract verification failed" when done in a specific pattern
Exception:
"Contract verification failed: Failed requirement: total input amount equals total output amount, contract: io.cordite.dgl.corda.token.Token, transaction: E9945E31B9D3CE92531E90805006ED0356E9A4D3D54B88E4E7044FDE676EFF0F"
How to reproduce:
- Create two accounts 'A' and 'B' on a single node
- Create a token type with 0 exponents and issue '100' tokens from the account 'A'
- Send 20 tokens from account 'A' to account 'B'
- Repeat the same transaction of 20 tokens from account A to account B exactly 3 more times.
- On the 3rd time, Cordite will throw the exception mentioned above.
Note: Both accounts being on the same node and the 100 tokens issue amount and 20 tokens transfer amount is significant to reproduce this error. If any of the factors change the contract verification does not fail.
Edited by Omer Shafiq