File tree 1 file changed +30
-5
lines changed 1 file changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,36 @@ impl KeywordDocs {
680
680
mod continue_keyword { }
681
681
} ;
682
682
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
+
683
713
// TODO
684
714
let str_keyword: ItemMod = parse_quote ! {
685
715
mod str_keyword { }
@@ -725,11 +755,6 @@ impl KeywordDocs {
725
755
mod mod_keyword { }
726
756
} ;
727
757
728
- // TODO
729
- let abi_keyword: ItemMod = parse_quote ! {
730
- mod abi_keyword { }
731
- } ;
732
-
733
758
// TODO
734
759
let storage_keyword: ItemMod = parse_quote ! {
735
760
mod storage_keyword { }
You can’t perform that action at this time.
0 commit comments