File tree Expand file tree Collapse file tree
framework/src/main/java/org/tron/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3438,6 +3438,9 @@ private void checkShieldedTRC20NoteValue(
34383438 if (spendNote .getNote ().getValue () < 0 ) {
34393439 throw new ContractValidateException ("The value in SpendNoteTRC20 must >= 0" );
34403440 }
3441+ if (StringUtils .isEmpty (spendNote .getNote ().getPaymentAddress ())) {
3442+ throw new ContractValidateException ("Payment Address in SpendNote should not be empty" );
3443+ }
34413444 }
34423445 }
34433446
@@ -3446,6 +3449,9 @@ private void checkShieldedTRC20NoteValue(
34463449 if (receiveNote .getNote ().getValue () < 0 ) {
34473450 throw new ContractValidateException ("The value in ReceiveNote must >= 0" );
34483451 }
3452+ if (StringUtils .isEmpty (receiveNote .getNote ().getPaymentAddress ())) {
3453+ throw new ContractValidateException ("Payment Address in ReceiveNote should not be empty" );
3454+ }
34493455 }
34503456 }
34513457 }
Original file line number Diff line number Diff line change 1919import java .io .ByteArrayOutputStream ;
2020import java .util .ArrayList ;
2121import java .util .List ;
22+ import org .apache .commons .lang3 .StringUtils ;
2223import org .tron .common .utils .Bech32 ;
2324import org .tron .common .utils .Bech32 .Bech32Data ;
2425
@@ -29,6 +30,9 @@ public class KeyIo {
2930 private static String SAPLING_PAYMENT_ADDRESS = "ztron" ;
3031
3132 public static PaymentAddress decodePaymentAddress (String str ) {
33+ if (StringUtils .isEmpty (str )) {
34+ return null ;
35+ }
3236 byte [] data ;
3337 Bech32Data bech = Bech32 .decode (str );
3438 if (bech .hrp .equals (SAPLING_PAYMENT_ADDRESS )
You can’t perform that action at this time.
0 commit comments