Back to Sway

Payable

docs/reference/src/documentation/language/annotations/attributes/payable.md

0.71.0371 B
Original Source

Payable

The payable annotation is used to allow a contract function to accept an asset forwarded via a call.

Usage

To allow a contract to accept assets we use the payable keyword.

sway
{{#include ../../../../code/language/annotations/src/main.sw:payable}}