File tree Expand file tree Collapse file tree 1 file changed +30
-5
lines changed
Expand file tree Collapse file tree 1 file changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,36 @@ impl KeywordDocs {
680680 mod continue_keyword { }
681681 } ;
682682
683+ let abi_keyword: ItemMod = parse_quote ! {
684+ /// Defines an Application Binary Interface (ABI).
685+ ///
686+ /// An `abi` block defines a set of methods that a contract exposes externally. It acts as the
687+ /// public interface for interacting with a smart contract. Only one `abi` block is allowed per
688+ /// contract.
689+ ///
690+ /// The methods defined within an `abi` block must be implemented in an associated [`impl`] block
691+ /// for the contract.
692+ ///
693+ /// ```sway
694+ /// contract;
695+ ///
696+ /// abi MyContract {
697+ /// #[storage(read, write)]
698+ /// fn update_counter(amount: u64) -> u64;
699+ /// }
700+ ///
701+ /// impl MyContract for Contract {
702+ /// #[storage(read, write)]
703+ /// fn update_counter(amount: u64) -> u64 {
704+ /// let current = storage.counter;
705+ /// storage.counter = current + amount;
706+ /// storage.counter
707+ /// }
708+ /// }
709+ /// ```
710+ mod abi_keyword { }
711+ } ;
712+
683713 // TODO
684714 let str_keyword: ItemMod = parse_quote ! {
685715 mod str_keyword { }
@@ -725,11 +755,6 @@ impl KeywordDocs {
725755 mod mod_keyword { }
726756 } ;
727757
728- // TODO
729- let abi_keyword: ItemMod = parse_quote ! {
730- mod abi_keyword { }
731- } ;
732-
733758 // TODO
734759 let storage_keyword: ItemMod = parse_quote ! {
735760 mod storage_keyword { }
You can’t perform that action at this time.
0 commit comments