@trustvc/eip7702 1.1.0-beta.1 → 1.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/Factory.sol +0 -8
- package/contracts/PlatformPaymaster.sol +18 -1
- package/dist/index.d.mts +7 -29
- package/dist/index.d.ts +7 -29
- package/dist/index.js +8 -40
- package/dist/index.mjs +8 -40
- package/package.json +1 -1
package/contracts/Factory.sol
CHANGED
|
@@ -8,7 +8,6 @@ import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
|
|
8
8
|
contract PlatformAccountFactory is Ownable {
|
|
9
9
|
address public tdocDeployer;
|
|
10
10
|
address public paymasterImplementation;
|
|
11
|
-
mapping(address => address) public attachedPaymaster;
|
|
12
11
|
|
|
13
12
|
event PlatformOnboarded(
|
|
14
13
|
address indexed platformAddress,
|
|
@@ -27,13 +26,6 @@ contract PlatformAccountFactory is Ownable {
|
|
|
27
26
|
paymasterImplementation = _paymasterImplementation;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
function setAttachedPaymaster(
|
|
31
|
-
address platformAddress
|
|
32
|
-
) external view returns (address) {
|
|
33
|
-
address paymaster = attachedPaymaster[platformAddress];
|
|
34
|
-
return paymaster;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
29
|
function updateTdocDeployer(address _tdocDeployer) external onlyOwner {
|
|
38
30
|
require(_tdocDeployer != address(0), "Zero address");
|
|
39
31
|
tdocDeployer = _tdocDeployer;
|
|
@@ -170,6 +170,12 @@ contract PlatformPaymaster is BasePaymaster {
|
|
|
170
170
|
bytes calldata remark
|
|
171
171
|
) external returns (address titleEscrow) {
|
|
172
172
|
require(authorizedRegistries[registry], "registry not authorized");
|
|
173
|
+
require(
|
|
174
|
+
authorizedCallers[msg.sender] ||
|
|
175
|
+
userWhitelist[msg.sender] > 0 ||
|
|
176
|
+
msg.sender == owner(),
|
|
177
|
+
"caller not authorized"
|
|
178
|
+
);
|
|
173
179
|
|
|
174
180
|
titleEscrow = ITradeTrustToken(registry).mint(
|
|
175
181
|
beneficiary,
|
|
@@ -291,7 +297,18 @@ contract PlatformPaymaster is BasePaymaster {
|
|
|
291
297
|
}
|
|
292
298
|
|
|
293
299
|
if (innerSel == MINT_DOCUMENT_SEL) {
|
|
294
|
-
|
|
300
|
+
if (
|
|
301
|
+
!authorizedCallers[sender] &&
|
|
302
|
+
userWhitelist[sender] == 0 &&
|
|
303
|
+
sender != owner()
|
|
304
|
+
) {
|
|
305
|
+
emit UserOpRejected(sender, "caller not authorized");
|
|
306
|
+
return ("", _packValidationData(true, 0, 0));
|
|
307
|
+
}
|
|
308
|
+
if (dailyLimit > 0 && dailySpend[sender] + maxCost > dailyLimit) {
|
|
309
|
+
emit UserOpRejected(sender, "daily limit exceeded");
|
|
310
|
+
return ("", _packValidationData(true, 0, 0));
|
|
311
|
+
}
|
|
295
312
|
return (
|
|
296
313
|
abi.encode(sender, maxCost, false),
|
|
297
314
|
_packValidationData(false, 0, 0)
|
package/dist/index.d.mts
CHANGED
|
@@ -320,20 +320,6 @@ declare const platformAccountFactoryAbi: readonly [{
|
|
|
320
320
|
}];
|
|
321
321
|
readonly name: "TdocDeployerUpdated";
|
|
322
322
|
readonly type: "event";
|
|
323
|
-
}, {
|
|
324
|
-
readonly inputs: readonly [{
|
|
325
|
-
readonly internalType: "address";
|
|
326
|
-
readonly name: "";
|
|
327
|
-
readonly type: "address";
|
|
328
|
-
}];
|
|
329
|
-
readonly name: "attachedPaymaster";
|
|
330
|
-
readonly outputs: readonly [{
|
|
331
|
-
readonly internalType: "address";
|
|
332
|
-
readonly name: "";
|
|
333
|
-
readonly type: "address";
|
|
334
|
-
}];
|
|
335
|
-
readonly stateMutability: "view";
|
|
336
|
-
readonly type: "function";
|
|
337
323
|
}, {
|
|
338
324
|
readonly inputs: readonly [{
|
|
339
325
|
readonly internalType: "bytes32";
|
|
@@ -396,20 +382,6 @@ declare const platformAccountFactoryAbi: readonly [{
|
|
|
396
382
|
readonly outputs: readonly [];
|
|
397
383
|
readonly stateMutability: "nonpayable";
|
|
398
384
|
readonly type: "function";
|
|
399
|
-
}, {
|
|
400
|
-
readonly inputs: readonly [{
|
|
401
|
-
readonly internalType: "address";
|
|
402
|
-
readonly name: "platformAddress";
|
|
403
|
-
readonly type: "address";
|
|
404
|
-
}];
|
|
405
|
-
readonly name: "setAttachedPaymaster";
|
|
406
|
-
readonly outputs: readonly [{
|
|
407
|
-
readonly internalType: "address";
|
|
408
|
-
readonly name: "";
|
|
409
|
-
readonly type: "address";
|
|
410
|
-
}];
|
|
411
|
-
readonly stateMutability: "view";
|
|
412
|
-
readonly type: "function";
|
|
413
385
|
}, {
|
|
414
386
|
readonly inputs: readonly [];
|
|
415
387
|
readonly name: "tdocDeployer";
|
|
@@ -1167,11 +1139,17 @@ declare namespace index$1 {
|
|
|
1167
1139
|
|
|
1168
1140
|
declare const ChainId: {
|
|
1169
1141
|
readonly Sepolia: 11155111;
|
|
1142
|
+
readonly Amoy: 80002;
|
|
1170
1143
|
};
|
|
1171
1144
|
/** Deployed contract addresses indexed by chainId */
|
|
1172
1145
|
declare const contractAddress: {
|
|
1146
|
+
readonly PaymasterImplementation: {
|
|
1147
|
+
readonly 11155111: "0x5ca5652025ca77d13323ed4887b4cbee6098dd8f";
|
|
1148
|
+
readonly 80002: "0xf47d58D3adc642DaD23966698A7A60b8b34D72f8";
|
|
1149
|
+
};
|
|
1173
1150
|
readonly PlatformAccountFactory: {
|
|
1174
|
-
readonly 11155111: "
|
|
1151
|
+
readonly 11155111: "0x1fe801f6af6e9a6c76431db08b121a7de70bc895";
|
|
1152
|
+
readonly 80002: "0x2762abf6fa22314ebcab41dd4666836038d29341";
|
|
1175
1153
|
};
|
|
1176
1154
|
};
|
|
1177
1155
|
|
package/dist/index.d.ts
CHANGED
|
@@ -320,20 +320,6 @@ declare const platformAccountFactoryAbi: readonly [{
|
|
|
320
320
|
}];
|
|
321
321
|
readonly name: "TdocDeployerUpdated";
|
|
322
322
|
readonly type: "event";
|
|
323
|
-
}, {
|
|
324
|
-
readonly inputs: readonly [{
|
|
325
|
-
readonly internalType: "address";
|
|
326
|
-
readonly name: "";
|
|
327
|
-
readonly type: "address";
|
|
328
|
-
}];
|
|
329
|
-
readonly name: "attachedPaymaster";
|
|
330
|
-
readonly outputs: readonly [{
|
|
331
|
-
readonly internalType: "address";
|
|
332
|
-
readonly name: "";
|
|
333
|
-
readonly type: "address";
|
|
334
|
-
}];
|
|
335
|
-
readonly stateMutability: "view";
|
|
336
|
-
readonly type: "function";
|
|
337
323
|
}, {
|
|
338
324
|
readonly inputs: readonly [{
|
|
339
325
|
readonly internalType: "bytes32";
|
|
@@ -396,20 +382,6 @@ declare const platformAccountFactoryAbi: readonly [{
|
|
|
396
382
|
readonly outputs: readonly [];
|
|
397
383
|
readonly stateMutability: "nonpayable";
|
|
398
384
|
readonly type: "function";
|
|
399
|
-
}, {
|
|
400
|
-
readonly inputs: readonly [{
|
|
401
|
-
readonly internalType: "address";
|
|
402
|
-
readonly name: "platformAddress";
|
|
403
|
-
readonly type: "address";
|
|
404
|
-
}];
|
|
405
|
-
readonly name: "setAttachedPaymaster";
|
|
406
|
-
readonly outputs: readonly [{
|
|
407
|
-
readonly internalType: "address";
|
|
408
|
-
readonly name: "";
|
|
409
|
-
readonly type: "address";
|
|
410
|
-
}];
|
|
411
|
-
readonly stateMutability: "view";
|
|
412
|
-
readonly type: "function";
|
|
413
385
|
}, {
|
|
414
386
|
readonly inputs: readonly [];
|
|
415
387
|
readonly name: "tdocDeployer";
|
|
@@ -1167,11 +1139,17 @@ declare namespace index$1 {
|
|
|
1167
1139
|
|
|
1168
1140
|
declare const ChainId: {
|
|
1169
1141
|
readonly Sepolia: 11155111;
|
|
1142
|
+
readonly Amoy: 80002;
|
|
1170
1143
|
};
|
|
1171
1144
|
/** Deployed contract addresses indexed by chainId */
|
|
1172
1145
|
declare const contractAddress: {
|
|
1146
|
+
readonly PaymasterImplementation: {
|
|
1147
|
+
readonly 11155111: "0x5ca5652025ca77d13323ed4887b4cbee6098dd8f";
|
|
1148
|
+
readonly 80002: "0xf47d58D3adc642DaD23966698A7A60b8b34D72f8";
|
|
1149
|
+
};
|
|
1173
1150
|
readonly PlatformAccountFactory: {
|
|
1174
|
-
readonly 11155111: "
|
|
1151
|
+
readonly 11155111: "0x1fe801f6af6e9a6c76431db08b121a7de70bc895";
|
|
1152
|
+
readonly 80002: "0x2762abf6fa22314ebcab41dd4666836038d29341";
|
|
1175
1153
|
};
|
|
1176
1154
|
};
|
|
1177
1155
|
|
package/dist/index.js
CHANGED
|
@@ -438,25 +438,6 @@ var platformAccountFactoryAbi = [
|
|
|
438
438
|
"name": "TdocDeployerUpdated",
|
|
439
439
|
"type": "event"
|
|
440
440
|
},
|
|
441
|
-
{
|
|
442
|
-
"inputs": [
|
|
443
|
-
{
|
|
444
|
-
"internalType": "address",
|
|
445
|
-
"name": "",
|
|
446
|
-
"type": "address"
|
|
447
|
-
}
|
|
448
|
-
],
|
|
449
|
-
"name": "attachedPaymaster",
|
|
450
|
-
"outputs": [
|
|
451
|
-
{
|
|
452
|
-
"internalType": "address",
|
|
453
|
-
"name": "",
|
|
454
|
-
"type": "address"
|
|
455
|
-
}
|
|
456
|
-
],
|
|
457
|
-
"stateMutability": "view",
|
|
458
|
-
"type": "function"
|
|
459
|
-
},
|
|
460
441
|
{
|
|
461
442
|
"inputs": [
|
|
462
443
|
{
|
|
@@ -538,25 +519,6 @@ var platformAccountFactoryAbi = [
|
|
|
538
519
|
"stateMutability": "nonpayable",
|
|
539
520
|
"type": "function"
|
|
540
521
|
},
|
|
541
|
-
{
|
|
542
|
-
"inputs": [
|
|
543
|
-
{
|
|
544
|
-
"internalType": "address",
|
|
545
|
-
"name": "platformAddress",
|
|
546
|
-
"type": "address"
|
|
547
|
-
}
|
|
548
|
-
],
|
|
549
|
-
"name": "setAttachedPaymaster",
|
|
550
|
-
"outputs": [
|
|
551
|
-
{
|
|
552
|
-
"internalType": "address",
|
|
553
|
-
"name": "",
|
|
554
|
-
"type": "address"
|
|
555
|
-
}
|
|
556
|
-
],
|
|
557
|
-
"stateMutability": "view",
|
|
558
|
-
"type": "function"
|
|
559
|
-
},
|
|
560
522
|
{
|
|
561
523
|
"inputs": [],
|
|
562
524
|
"name": "tdocDeployer",
|
|
@@ -1529,11 +1491,17 @@ __export(constants_exports, {
|
|
|
1529
1491
|
contractAddress: () => contractAddress
|
|
1530
1492
|
});
|
|
1531
1493
|
var ChainId = {
|
|
1532
|
-
Sepolia: 11155111
|
|
1494
|
+
Sepolia: 11155111,
|
|
1495
|
+
Amoy: 80002
|
|
1533
1496
|
};
|
|
1534
1497
|
var contractAddress = {
|
|
1498
|
+
PaymasterImplementation: {
|
|
1499
|
+
[ChainId.Sepolia]: "0x5ca5652025ca77d13323ed4887b4cbee6098dd8f",
|
|
1500
|
+
[ChainId.Amoy]: "0xf47d58D3adc642DaD23966698A7A60b8b34D72f8"
|
|
1501
|
+
},
|
|
1535
1502
|
PlatformAccountFactory: {
|
|
1536
|
-
[ChainId.Sepolia]: "
|
|
1503
|
+
[ChainId.Sepolia]: "0x1fe801f6af6e9a6c76431db08b121a7de70bc895",
|
|
1504
|
+
[ChainId.Amoy]: "0x2762abf6fa22314ebcab41dd4666836038d29341"
|
|
1537
1505
|
}
|
|
1538
1506
|
};
|
|
1539
1507
|
|
package/dist/index.mjs
CHANGED
|
@@ -436,25 +436,6 @@ var platformAccountFactoryAbi = [
|
|
|
436
436
|
"name": "TdocDeployerUpdated",
|
|
437
437
|
"type": "event"
|
|
438
438
|
},
|
|
439
|
-
{
|
|
440
|
-
"inputs": [
|
|
441
|
-
{
|
|
442
|
-
"internalType": "address",
|
|
443
|
-
"name": "",
|
|
444
|
-
"type": "address"
|
|
445
|
-
}
|
|
446
|
-
],
|
|
447
|
-
"name": "attachedPaymaster",
|
|
448
|
-
"outputs": [
|
|
449
|
-
{
|
|
450
|
-
"internalType": "address",
|
|
451
|
-
"name": "",
|
|
452
|
-
"type": "address"
|
|
453
|
-
}
|
|
454
|
-
],
|
|
455
|
-
"stateMutability": "view",
|
|
456
|
-
"type": "function"
|
|
457
|
-
},
|
|
458
439
|
{
|
|
459
440
|
"inputs": [
|
|
460
441
|
{
|
|
@@ -536,25 +517,6 @@ var platformAccountFactoryAbi = [
|
|
|
536
517
|
"stateMutability": "nonpayable",
|
|
537
518
|
"type": "function"
|
|
538
519
|
},
|
|
539
|
-
{
|
|
540
|
-
"inputs": [
|
|
541
|
-
{
|
|
542
|
-
"internalType": "address",
|
|
543
|
-
"name": "platformAddress",
|
|
544
|
-
"type": "address"
|
|
545
|
-
}
|
|
546
|
-
],
|
|
547
|
-
"name": "setAttachedPaymaster",
|
|
548
|
-
"outputs": [
|
|
549
|
-
{
|
|
550
|
-
"internalType": "address",
|
|
551
|
-
"name": "",
|
|
552
|
-
"type": "address"
|
|
553
|
-
}
|
|
554
|
-
],
|
|
555
|
-
"stateMutability": "view",
|
|
556
|
-
"type": "function"
|
|
557
|
-
},
|
|
558
520
|
{
|
|
559
521
|
"inputs": [],
|
|
560
522
|
"name": "tdocDeployer",
|
|
@@ -1527,11 +1489,17 @@ __export(constants_exports, {
|
|
|
1527
1489
|
contractAddress: () => contractAddress
|
|
1528
1490
|
});
|
|
1529
1491
|
var ChainId = {
|
|
1530
|
-
Sepolia: 11155111
|
|
1492
|
+
Sepolia: 11155111,
|
|
1493
|
+
Amoy: 80002
|
|
1531
1494
|
};
|
|
1532
1495
|
var contractAddress = {
|
|
1496
|
+
PaymasterImplementation: {
|
|
1497
|
+
[ChainId.Sepolia]: "0x5ca5652025ca77d13323ed4887b4cbee6098dd8f",
|
|
1498
|
+
[ChainId.Amoy]: "0xf47d58D3adc642DaD23966698A7A60b8b34D72f8"
|
|
1499
|
+
},
|
|
1533
1500
|
PlatformAccountFactory: {
|
|
1534
|
-
[ChainId.Sepolia]: "
|
|
1501
|
+
[ChainId.Sepolia]: "0x1fe801f6af6e9a6c76431db08b121a7de70bc895",
|
|
1502
|
+
[ChainId.Amoy]: "0x2762abf6fa22314ebcab41dd4666836038d29341"
|
|
1535
1503
|
}
|
|
1536
1504
|
};
|
|
1537
1505
|
|