contracts/interfaces/IERC6551Registry.sol 1.4 K raw
1
// SPDX-License-Identifier: MIT
2
pragma solidity ^0.8.20;
3
4
interface IERC6551Registry {
5
    /**
6
     * @dev The registry SHALL emit the AccountCreated event upon successful account creation
7
     */
8
    event AccountCreated(
9
        address account,
10
        address indexed implementation,
11
        uint256 chainId,
12
        address indexed tokenContract,
13
        uint256 indexed tokenId,
14
        uint256 salt
15
    );
16
17
    /**
18
     * @dev Creates a token bound account for a non-fungible token
19
     *
20
     * If account has already been created, returns the account address without calling create2
21
     *
22
     * If initData is not empty and account has not yet been created, calls account with
23
     * provided initData after creation
24
     *
25
     * Emits AccountCreated event
26
     *
27
     * @return the address of the account
28
     */
29
    function createAccount(
30
        address implementation,
31
        uint256 chainId,
32
        address tokenContract,
33
        uint256 tokenId,
34
        uint256 seed,
35
        bytes calldata initData
36
    ) external returns (address);
37
38
    /**
39
     * @dev Returns the computed token bound account address for a non-fungible token
40
     *
41
     * @return The computed address of the token bound account
42
     */
43
    function account(
44
        address implementation,
45
        uint256 chainId,
46
        address tokenContract,
47
        uint256 tokenId,
48
        uint256 salt
49
    ) external view returns (address);
50
}