@@ -7,29 +7,109 @@ enum RoyaltiesModel {
77 UsageTier
88}
99
10- // Same as InteractionTemplate minus "author" and uniqueHash
10+ // Same as InteractionTemplate minus "creator", "createdAt", and " uniqueHash".
1111struct InteractionTemplateParams {
1212 string name;
1313 string description;
14+ string protocol;
1415 string logo;
1516 string actionUrl;
1617 address targetContract;
17- string contractURI ;
18+ string functionABI ;
1819 uint256 networkId;
1920 uint256 price;
21+ address royaltyRecipient;
2022 RoyaltiesModel royaltiesModel;
2123}
2224
2325struct InteractionTemplate {
2426 string name;
2527 string description;
28+ string protocol;
2629 string logo;
2730 string actionUrl;
2831 address targetContract;
29- string contractURI ;
32+ string functionABI ;
3033 uint256 networkId;
31- uint256 price;
34+ bytes32 uniqueHash;
35+ address royaltyRecipient;
3236 RoyaltiesModel royaltiesModel;
33- address author;
34- bytes32 uniqueHash; // Unique hash for deduplication.
37+ uint256 price;
38+ address creator;
39+ uint256 createdAt;
40+ }
41+
42+ interface IInteractionFactory {
43+ event InteractionTemplateCreated (uint256 indexed tokenId , address indexed creator , bytes32 indexed uniqueHash );
44+
45+ event InteractionCreatedByAutID (address indexed creator , uint256 indexed tokenId );
46+
47+ /**
48+ * @notice Emitted when the AutID registry is set
49+ * @param registryAddress The address of the AutID registry
50+ */
51+ event AutIDRegistrySet (address indexed registryAddress );
52+
53+ /**
54+ * @notice Checks if an address owns an AutID
55+ * @param account The address to check
56+ * @return True if the address owns an AutID
57+ */
58+ function hasAutID (address account ) external view returns (bool );
59+
60+ /**
61+ * @notice Creates a batch of interaction templates
62+ * @param allParams Array of parameters for each template
63+ * @return tokenIds Array of token IDs for the created templates
64+ */
65+ function createInteractionTemplates (
66+ InteractionTemplateParams[] calldata allParams
67+ ) external returns (uint256 [] memory );
68+
69+ /**
70+ * @notice Creates a single interaction template
71+ * @param params Parameters for the template
72+ * @return tokenId Token ID of the created template
73+ */
74+ function createInteractionTemplate (InteractionTemplateParams calldata params ) external returns (uint256 );
75+
76+ /**
77+ * @notice Returns the total number of templates
78+ * @return count The total count of templates
79+ */
80+ function totalTemplates () external view returns (uint256 );
81+
82+ /**
83+ * @notice Gets the template data for a given token ID
84+ * @param tokenId The token ID to query
85+ * @return template The complete template data
86+ */
87+ function getInteractionTemplate (uint256 tokenId ) external view returns (InteractionTemplate memory );
88+
89+ /**
90+ * @notice Gets the token ID for a given hash
91+ * @param hash The unique hash to query
92+ * @return tokenId The token ID (0 if not found)
93+ */
94+ function getTokenIdByHash (bytes32 hash ) external view returns (uint256 );
95+
96+ /**
97+ * @notice Computes the unique hash for a template
98+ * @param targetContract The contract address
99+ * @param functionABI The function ABI or signature
100+ * @param networkId The network ID
101+ * @return hash The computed hash
102+ */
103+ function computeTemplateHash (
104+ address targetContract ,
105+ string calldata functionABI ,
106+ uint256 networkId
107+ ) external pure returns (bytes32 );
108+
109+ /**
110+ * @notice Gets all templates created by a specific address
111+ * @param creator The creator address
112+ * @return tokenIds Array of token IDs created by the address
113+ */
114+ function getInteractionsByCreator (address creator ) external view returns (uint256 [] memory );
35115}
0 commit comments