Skip to content

Commit c015864

Browse files
authored
Ops/deploy 5-24 (#148)
* feat: upgraded InteractionFactory * ops: deploy 5.24.2025
1 parent 0596c0e commit c015864

7 files changed

Lines changed: 3922 additions & 1015 deletions

File tree

broadcast/DeployAll.s.sol/80002/run-1748106182.json

Lines changed: 2489 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/DeployAll.s.sol/80002/run-latest.json

Lines changed: 969 additions & 969 deletions
Large diffs are not rendered by default.

contracts/autid/IAutID.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
interface IAutID {
4+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
5+
6+
interface IAutID is IERC721 {
57
error ConflictingRecord();
68
error UntransferableToken();
79

contracts/interactions/IInteractionFactory.sol

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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".
1111
struct 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

2325
struct 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

Comments
 (0)