t-isol 0.0.1 → 0.0.3
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.
|
@@ -24,78 +24,78 @@ abstract contract ERC20xTransferWithAuthorize is ERC20, TransferAuthorize, Reent
|
|
|
24
24
|
_mint(msg.sender, initialSupply * 10 ** decimals());
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/// @notice Relayer-triggered transfer using an off-chain signature by `from`.
|
|
27
|
+
/// @notice Relayer-triggered transfer using an off-chain signature (auth) by `from`.
|
|
28
28
|
/// @dev This allows anyone (a relayer) to submit the signed authorization on-chain.
|
|
29
29
|
function transferWithAuthorize(
|
|
30
30
|
address from,
|
|
31
31
|
address to,
|
|
32
32
|
uint256 value,
|
|
33
|
-
uint256
|
|
34
|
-
uint256
|
|
33
|
+
uint256 timeMFG,
|
|
34
|
+
uint256 timeEXP,
|
|
35
35
|
bytes32 nonce,
|
|
36
|
-
bytes calldata
|
|
36
|
+
bytes calldata auth
|
|
37
37
|
) external override nonReentrant {
|
|
38
38
|
address signer = _verifyTransfer(
|
|
39
39
|
from,
|
|
40
40
|
to,
|
|
41
41
|
value,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
timeMFG,
|
|
43
|
+
timeEXP,
|
|
44
44
|
nonce,
|
|
45
|
-
|
|
45
|
+
auth
|
|
46
46
|
);
|
|
47
|
-
require(signer == from, "ERC20TransferAuthorize: invalid signature");
|
|
47
|
+
require(signer == from, "ERC20TransferAuthorize: invalid authorization signature");
|
|
48
48
|
_useAuthorize(from, nonce);
|
|
49
49
|
_transfer(from, to, value);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/// @notice Relayer-triggered transfer using an off-chain signature by `from`.
|
|
52
|
+
/// @notice Relayer-triggered transfer using an off-chain signature (auth) by `from`.
|
|
53
53
|
/// @dev This allows anyone (a relayer) to submit the signed authorization on-chain.
|
|
54
54
|
function transferFromWithAuthorize(
|
|
55
55
|
address from,
|
|
56
56
|
address to,
|
|
57
57
|
uint256 value,
|
|
58
|
-
uint256
|
|
59
|
-
uint256
|
|
58
|
+
uint256 timeMFG,
|
|
59
|
+
uint256 timeEXP,
|
|
60
60
|
bytes32 nonce,
|
|
61
|
-
bytes calldata
|
|
61
|
+
bytes calldata auth
|
|
62
62
|
) external override nonReentrant {
|
|
63
63
|
address signer = _verifyTransferFrom(
|
|
64
64
|
from,
|
|
65
65
|
to,
|
|
66
66
|
value,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
timeMFG,
|
|
68
|
+
timeEXP,
|
|
69
69
|
nonce,
|
|
70
|
-
|
|
70
|
+
auth
|
|
71
71
|
);
|
|
72
|
-
require(signer == from, "ERC20TransferAuthorize: invalid signature");
|
|
72
|
+
require(signer == from, "ERC20TransferAuthorize: invalid authorization signature");
|
|
73
73
|
_useAuthorize(from, nonce);
|
|
74
74
|
_spendAllowance(from, to, value);
|
|
75
75
|
_transfer(from, to, value);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
/// @notice Relayer-triggered transfer using an off-chain signature by `from`.
|
|
78
|
+
/// @notice Relayer-triggered transfer using an off-chain signature (auth) by `from`.
|
|
79
79
|
/// @dev This allows anyone (a relayer) to submit the signed authorization on-chain.
|
|
80
80
|
function burnWithAuthorize(
|
|
81
81
|
address from,
|
|
82
82
|
// address to,
|
|
83
83
|
uint256 value,
|
|
84
|
-
uint256
|
|
85
|
-
uint256
|
|
84
|
+
uint256 timeMFG,
|
|
85
|
+
uint256 timeEXP,
|
|
86
86
|
bytes32 nonce,
|
|
87
|
-
bytes calldata
|
|
87
|
+
bytes calldata auth
|
|
88
88
|
) external override nonReentrant {
|
|
89
89
|
address signer = _verifyBurn(
|
|
90
90
|
from,
|
|
91
91
|
// to,
|
|
92
92
|
value,
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
timeMFG,
|
|
94
|
+
timeEXP,
|
|
95
95
|
nonce,
|
|
96
|
-
|
|
96
|
+
auth
|
|
97
97
|
);
|
|
98
|
-
require(signer == from, "ERC20TransferAuthorize: invalid signature");
|
|
98
|
+
require(signer == from, "ERC20TransferAuthorize: invalid authorization signature");
|
|
99
99
|
_useAuthorize(from, nonce);
|
|
100
100
|
_burn(from, value);
|
|
101
101
|
}
|