Annotation Type Payable


  • @Target(METHOD)
    public @interface Payable
    Annotation 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 Context.getValue().

    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 fallback method was not annotated with @Payable, it would not be listed on the SCORE APIs and could not be called as well.