/ lib / src / templates / mod.rs
mod.rs
 1  pub mod solidity;
 2  pub mod stylus;
 3  
 4  pub use solidity::SolidityTemplate;
 5  pub use stylus::StylusTemplate;
 6  
 7  // Move these to a common location since they're shared
 8  #[derive(Clone, Debug, PartialEq)]
 9  pub enum ContractType {
10      Basic,
11      ERC20,
12      ERC721,
13      ERC1155,
14      ERC20Upgradeable,
15      ERC721Upgradeable,
16      ERC1155Upgradeable,
17      Interface,
18      Abstract,
19      MultiInheritance {
20          base_type: Box<ContractType>,
21          extensions: Vec<TokenExtension>,
22      },
23  }
24  
25  #[derive(Clone, Debug, PartialEq)]
26  pub enum TokenExtension {
27      // ERC20 Extensions
28      ERC20Permit,
29      ERC20Burnable,
30      ERC20Capped,
31      ERC20Pausable,
32      ERC20Votes,
33      ERC20Wrapper,
34      ERC20FlashMint,
35      ERC20TemporaryApproval,
36      ERC20Bridgeable,
37      ERC1363,
38      ERC4626,
39      
40      // ERC721 Extensions
41      ERC721Pausable,
42      ERC721Burnable,
43      ERC721Consecutive,
44      ERC721URIStorage,
45      ERC721Votes,
46      ERC721Royalty,
47      ERC721Wrapper,
48      ERC721Enumerable,
49      
50      // ERC1155 Extensions
51      ERC1155Pausable,
52      ERC1155Burnable,
53      ERC1155Supply,
54      ERC1155URIStorage,
55  }
56  
57  pub trait Template {
58      fn generate_contract(&self) -> String;
59      fn generate_test(&self) -> String;
60      fn generate_script(&self) -> String;
61      fn generate_library(&self) -> String;
62      fn generate_interface(&self) -> String;
63      fn generate_abstract_contract(&self) -> String;
64  }