Skip to content

Commit

Permalink
Merge pull request #445 from NanYeZhuYu/fix_rwm_bugs
Browse files Browse the repository at this point in the history
fix(aptos): only parse APT transfer transactions
  • Loading branch information
soralit authored Apr 6, 2023
2 parents b0a1de2 + 311777c commit 7b640cb
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ private static boolean isSystemTransfer(PayLoad payLoad) {
if (payLoad instanceof EntryFunction) {
EntryFunction entryFunction = (EntryFunction) payLoad;
String function = entryFunction.getFunction();
String[] splitFunction = function.split(JOINER);
return splitFunction.length == 3 && "0x1".equals(splitFunction[0]) && "transfer".equals(splitFunction[2]);
if (entryFunction.getTypeArguments() != null && entryFunction.getTypeArguments().size() > 0) {
String typeArgument = entryFunction.getTypeArguments().get(0);
if ("0x1::aptos_coin::AptosCoin".equals(typeArgument)) {
String[] splitFunction = function.split(JOINER);
return splitFunction.length == 3 && "0x1".equals(splitFunction[0]) && "transfer".equals(splitFunction[2]);
}
} else {
return "0x1::aptos_account::transfer".equals(function);
}
}
return false;
}
Expand Down

0 comments on commit 7b640cb

Please sign in to comment.