Annotation Type Payable
@Target(METHOD) public @interface PayableAnnotation that can be used to indicate whether the method can receive ICX coins.
If this annotation is applied to the external method, the method can receive the incoming ICX coins designated in the transaction message and process further works for it. Users can get the value of transferred ICX coins by using
If ICX coins were passed to a non-payable method, that transaction would fail.
NOTE: The special method, named
fallback, is invoked whenever the contract receives plain ICX coins without data. However, if the
fallbackmethod was not annotated with
@Payable, it would not be listed on the SCORE APIs and could not be called as well.