/
ISponsorPaymaster.sol
63 lines (44 loc) · 1.96 KB
/
ISponsorPaymaster.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {IKintoAppRegistry} from "./IKintoAppRegistry.sol";
import {IKintoID} from "./IKintoID.sol";
interface ISponsorPaymaster {
/* ============ Errors ============ */
error OnlyOwner();
error InvalidAmount();
error SenderKYCRequired();
error AccountKYCRequired();
error InvalidTarget();
error TokenDepositLocked();
error InvalidRegistry();
error GasOutsideRangeForPostOp();
error GasTooHighForVerification();
error PaymasterAndDataLengthInvalid();
error GasTooHighForUserOp();
error DepositNotLocked();
error DepositTooLow();
error KintoRateLimitExceeded();
error AppRateLimitExceeded();
error AppGasLimitExceeded();
/* ============ Structs ============ */
struct RateLimitData {
uint256 lastOperationTime;
uint256 operationCount;
uint256 ethCostCount;
}
/* ============ State Change ============ */
function initialize(address owner, IKintoAppRegistry _appRegistry, IKintoID _kintoID) external;
function setAppRegistry(address _appRegistry) external;
function addDepositFor(address account) external payable;
function withdrawTokensTo(address target, uint256 amount) external;
function unlockTokenDeposit() external;
function lockTokenDeposit() external;
/* ============ Basic Viewers ============ */
function depositInfo(address account) external view returns (uint256 amount, uint256 _unlockBlock);
/* ============ Constants and attrs ============ */
function balances(address account) external view returns (uint256 amount);
function appRegistry() external view returns (IKintoAppRegistry);
function contractSpent(address account) external view returns (uint256 amount);
function unlockBlock(address account) external view returns (uint256 block);
function appUserLimit(address user, address app) external view returns (uint256, uint256, uint256, uint256);
}