t-isol 0.0.6 → 0.0.8
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.
|
@@ -11,16 +11,10 @@ interface ITransferAuthorize {
|
|
|
11
11
|
event AuthorizeUsed(address indexed authorizer, bytes32 indexed nonce);
|
|
12
12
|
|
|
13
13
|
/// @notice Emitted when a transfer with authorization is executed
|
|
14
|
-
event TransferWithAuthorize(address indexed from, address indexed to, uint256 value, uint256 createTime, uint256 expireTime, bytes32 indexed nonce, bytes auth);
|
|
15
|
-
|
|
16
|
-
/// @notice Emitted when a transferFrom with authorization is executed
|
|
17
|
-
event TransferFromWithAuthorize(address indexed from, address indexed to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 indexed nonce);
|
|
18
|
-
|
|
19
|
-
/// @notice Emitted when a approve with authorization is executed
|
|
20
|
-
event ApproveWithAuthorize(address indexed from, address indexed to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 indexed nonce);
|
|
14
|
+
event TransferWithAuthorize(address sender, address indexed from, address indexed to, uint256 value, uint256 createTime, uint256 expireTime, bytes32 indexed nonce, bytes auth);
|
|
21
15
|
|
|
22
16
|
/// @notice Emitted when a burn with authorization is executed
|
|
23
|
-
event BurnWithAuthorize(address indexed from, uint256 value, uint256
|
|
17
|
+
event BurnWithAuthorize(address indexed from, uint256 value, uint256 createTime, uint256 expireTime, bytes32 indexed nonce, bytes auth);
|
|
24
18
|
|
|
25
19
|
/// @notice Returns whether a nonce has been used for a given authorizer
|
|
26
20
|
/// @param authorizer the account that signed the authorization
|
|
@@ -61,7 +61,7 @@ abstract contract TransferAuthorize is ITransferAuthorize, EIP712 {
|
|
|
61
61
|
uint256 expireTime,
|
|
62
62
|
bytes32 nonce,
|
|
63
63
|
bytes calldata auth
|
|
64
|
-
) internal
|
|
64
|
+
) internal returns (address signer) {
|
|
65
65
|
require(block.timestamp >= createTime, "TransferAuthorize: not yet created");
|
|
66
66
|
require(block.timestamp <= expireTime, "TransferAuthorize: not yet expired");
|
|
67
67
|
bytes32 structHash = keccak256(
|
|
@@ -76,6 +76,7 @@ abstract contract TransferAuthorize is ITransferAuthorize, EIP712 {
|
|
|
76
76
|
)
|
|
77
77
|
);
|
|
78
78
|
signer = ECDSA.recover(_hashTypedDataV4(structHash), auth);
|
|
79
|
+
emit TransferWithAuthorize(msg.sender, from, to, value, createTime, expireTime, nonce, auth);
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
/// @dev Verify an EIP-712 typed signature for TransferFromWithAuthorize and return the recovered signer
|
|
@@ -48,7 +48,6 @@ abstract contract ERC20xTransferWithAuthorize is ERC20, TransferAuthorize, Reent
|
|
|
48
48
|
require(signer == from, "ERC20TransferAuthorize: invalid signature");
|
|
49
49
|
_useAuthorize(from, nonce);
|
|
50
50
|
_transfer(from, to, value);
|
|
51
|
-
emit TransferWithAuthorize(from, to, value, createTime, expireTime, nonce, auth);
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
/// @notice Relayer-triggered transfer using an off-chain signature by `from`.
|