Skip to main content

tempo_contracts/precompiles/
tip20_factory.rs

1pub use ITIP20Factory::{
2    ITIP20FactoryErrors as TIP20FactoryError, ITIP20FactoryEvents as TIP20FactoryEvent,
3    createToken_0Call as createTokenCall, createToken_1Call as createTokenWithLogoCall,
4};
5
6crate::sol! {
7  #[derive(Debug, PartialEq, Eq)]
8    #[sol(abi)]
9    #[allow(clippy::too_many_arguments)]
10    interface ITIP20Factory {
11        error AddressReserved();
12        error AddressNotReserved();
13        error InvalidQuoteToken();
14        error TokenAlreadyExists(address token);
15
16        event TokenCreated(address indexed token, string name, string symbol, string currency, address quoteToken, address admin, bytes32 salt);
17
18        function createToken(
19            string memory name,
20            string memory symbol,
21            string memory currency,
22            address quoteToken,
23            address admin,
24            bytes32 salt
25        ) external returns (address);
26
27        /// @notice Creates a token and sets its logoURI atomically (TIP-1026).
28        /// @dev Solidity overload of `createToken` with an additional `logoURI` argument.
29        ///      Reverts with `LogoURITooLong` if `bytes(logoURI).length > 256`, or
30        ///      with `InvalidLogoURI` if `logoURI` is non-empty and either has no
31        ///      parseable scheme or its scheme is not in the allow-list.
32        function createToken(
33            string memory name,
34            string memory symbol,
35            string memory currency,
36            address quoteToken,
37            address admin,
38            bytes32 salt,
39            string memory logoURI
40        ) external returns (address);
41
42        function isTIP20(address token) public view returns (bool);
43
44        function getTokenAddress(address sender, bytes32 salt) public pure returns (address);
45    }
46}