secure-transac-contracts 1.0.0
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/build/contracts/AccessControl.json +4579 -0
- package/build/contracts/Context.json +356 -0
- package/build/contracts/CreditSystem.json +6037 -0
- package/build/contracts/ECDSA.json +4734 -0
- package/build/contracts/EIP712.json +3021 -0
- package/build/contracts/ERC165.json +352 -0
- package/build/contracts/ERC20.json +6816 -0
- package/build/contracts/ERC20Permit.json +2658 -0
- package/build/contracts/ERC721.json +12779 -0
- package/build/contracts/ERC721Utils.json +1058 -0
- package/build/contracts/Groth16Verifier.json +6298 -0
- package/build/contracts/Guardian.json +1116 -0
- package/build/contracts/IERC1155Errors.json +1687 -0
- package/build/contracts/IERC165.json +197 -0
- package/build/contracts/IERC20.json +1162 -0
- package/build/contracts/IERC20Errors.json +1662 -0
- package/build/contracts/IERC20Metadata.json +574 -0
- package/build/contracts/IERC20Permit.json +546 -0
- package/build/contracts/IERC5267.json +392 -0
- package/build/contracts/IERC721.json +1729 -0
- package/build/contracts/IERC721Errors.json +1694 -0
- package/build/contracts/IERC721Metadata.json +728 -0
- package/build/contracts/IERC721Receiver.json +296 -0
- package/build/contracts/IGuardian.json +215 -0
- package/build/contracts/ITrustRegistry.json +6767 -0
- package/build/contracts/IdentityVault.json +11584 -0
- package/build/contracts/Math.json +23115 -0
- package/build/contracts/MessageHashUtils.json +1668 -0
- package/build/contracts/Nonces.json +865 -0
- package/build/contracts/Ownable.json +1859 -0
- package/build/contracts/Panic.json +798 -0
- package/build/contracts/ReportingSystem.json +2787 -0
- package/build/contracts/SafeCast.json +21592 -0
- package/build/contracts/ScoringSystem.json +11245 -0
- package/build/contracts/SecureTransacSBT.json +18823 -0
- package/build/contracts/SecureTransacToken.json +19225 -0
- package/build/contracts/SecureVault.json +12890 -0
- package/build/contracts/ShortStrings.json +2852 -0
- package/build/contracts/SignedMath.json +1915 -0
- package/build/contracts/StorageSlot.json +1773 -0
- package/build/contracts/Strings.json +19001 -0
- package/build/contracts/TransactionLogger.json +5325 -0
- package/build/contracts/TrustDAO.json +23850 -0
- package/build/contracts/TrustRegistry.json +10948 -0
- package/build/contracts/VerificationRegistry.json +12811 -0
- package/build/contracts/ZKIdentityVerifier.json +13979 -0
- package/contracts/AccessControl.sol +34 -0
- package/contracts/CreditSystem.sol +48 -0
- package/contracts/Guardian.sol +33 -0
- package/contracts/IGuardian.sol +7 -0
- package/contracts/IdentityVault.sol +57 -0
- package/contracts/ReportingSystem.sol +14 -0
- package/contracts/ScoringSystem.sol +71 -0
- package/contracts/SecureTransacSBT.sol +72 -0
- package/contracts/SecureTransacToken.sol +20 -0
- package/contracts/SecureVault.sol +24 -0
- package/contracts/TransactionLogger.sol +12 -0
- package/contracts/TrustDAO.sol +158 -0
- package/contracts/TrustRegistry.sol +23 -0
- package/contracts/VerificationRegistry.sol +51 -0
- package/contracts/ZKIdentityVerifier.sol +38 -0
- package/contracts/ZKScoreVerifier.sol +175 -0
- package/package.json +32 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractName": "IERC20Permit",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"inputs": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "owner",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "spender",
|
|
14
|
+
"type": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256",
|
|
18
|
+
"name": "value",
|
|
19
|
+
"type": "uint256"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "deadline",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"internalType": "uint8",
|
|
28
|
+
"name": "v",
|
|
29
|
+
"type": "uint8"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"internalType": "bytes32",
|
|
33
|
+
"name": "r",
|
|
34
|
+
"type": "bytes32"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "bytes32",
|
|
38
|
+
"name": "s",
|
|
39
|
+
"type": "bytes32"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": "permit",
|
|
43
|
+
"outputs": [],
|
|
44
|
+
"stateMutability": "nonpayable",
|
|
45
|
+
"type": "function"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"internalType": "address",
|
|
51
|
+
"name": "owner",
|
|
52
|
+
"type": "address"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"name": "nonces",
|
|
56
|
+
"outputs": [
|
|
57
|
+
{
|
|
58
|
+
"internalType": "uint256",
|
|
59
|
+
"name": "",
|
|
60
|
+
"type": "uint256"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"stateMutability": "view",
|
|
64
|
+
"type": "function"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"inputs": [],
|
|
68
|
+
"name": "DOMAIN_SEPARATOR",
|
|
69
|
+
"outputs": [
|
|
70
|
+
{
|
|
71
|
+
"internalType": "bytes32",
|
|
72
|
+
"name": "",
|
|
73
|
+
"type": "bytes32"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"stateMutability": "view",
|
|
77
|
+
"type": "function"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[ERC-2612]. Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all. ==== Security Considerations There are two important considerations concerning the use of `permit`. The first is that a valid permit signature expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be considered as an intention to spend the allowance in any specific way. The second is that because permits have built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be generally recommended is: ```solidity function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} doThing(..., value); } function doThing(..., uint256 value) public { token.safeTransferFrom(msg.sender, address(this), value); ... } ``` Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also {SafeERC20-safeTransferFrom}). Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so contracts should have entry points that don't rely on permit.\",\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\"},\"nonces(address)\":{\"details\":\"Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":\"IERC20Permit\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"keccak256\":\"0x2fa0657dd7b8bc75475a47f64bc04a9adb42236b15d65e6781594ea69a46c3e4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7496f42681aed94bf0142a077324e50b86046610c1724e7c12e96cf1c365914a\",\"dweb:/ipfs/QmZvhNdSAAbN4PKPdheAqwpXukUiXp3Q3TdQccDMg2NDTV\"]}},\"version\":1}",
|
|
81
|
+
"bytecode": "0x",
|
|
82
|
+
"deployedBytecode": "0x",
|
|
83
|
+
"immutableReferences": {},
|
|
84
|
+
"generatedSources": [],
|
|
85
|
+
"deployedGeneratedSources": [],
|
|
86
|
+
"sourceMap": "",
|
|
87
|
+
"deployedSourceMap": "",
|
|
88
|
+
"source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n",
|
|
89
|
+
"sourcePath": "@openzeppelin\\contracts\\token\\ERC20\\extensions\\IERC20Permit.sol",
|
|
90
|
+
"ast": {
|
|
91
|
+
"absolutePath": "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol",
|
|
92
|
+
"exportedSymbols": {
|
|
93
|
+
"IERC20Permit": [
|
|
94
|
+
1118
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"id": 1119,
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"nodeType": "SourceUnit",
|
|
100
|
+
"nodes": [
|
|
101
|
+
{
|
|
102
|
+
"id": 1084,
|
|
103
|
+
"literals": [
|
|
104
|
+
"solidity",
|
|
105
|
+
">=",
|
|
106
|
+
"0.4",
|
|
107
|
+
".16"
|
|
108
|
+
],
|
|
109
|
+
"nodeType": "PragmaDirective",
|
|
110
|
+
"src": "123:25:7"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"abstract": false,
|
|
114
|
+
"baseContracts": [],
|
|
115
|
+
"canonicalName": "IERC20Permit",
|
|
116
|
+
"contractDependencies": [],
|
|
117
|
+
"contractKind": "interface",
|
|
118
|
+
"documentation": {
|
|
119
|
+
"id": 1085,
|
|
120
|
+
"nodeType": "StructuredDocumentation",
|
|
121
|
+
"src": "150:1965:7",
|
|
122
|
+
"text": " @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in\n https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].\n Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by\n presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n need to send a transaction, and thus is not required to hold Ether at all.\n ==== Security Considerations\n There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n considered as an intention to spend the allowance in any specific way. The second is that because permits have\n built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n generally recommended is:\n ```solidity\n function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n doThing(..., value);\n }\n function doThing(..., uint256 value) public {\n token.safeTransferFrom(msg.sender, address(this), value);\n ...\n }\n ```\n Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n {SafeERC20-safeTransferFrom}).\n Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n contracts should have entry points that don't rely on permit."
|
|
123
|
+
},
|
|
124
|
+
"fullyImplemented": false,
|
|
125
|
+
"id": 1118,
|
|
126
|
+
"linearizedBaseContracts": [
|
|
127
|
+
1118
|
|
128
|
+
],
|
|
129
|
+
"name": "IERC20Permit",
|
|
130
|
+
"nameLocation": "2126:12:7",
|
|
131
|
+
"nodeType": "ContractDefinition",
|
|
132
|
+
"nodes": [
|
|
133
|
+
{
|
|
134
|
+
"documentation": {
|
|
135
|
+
"id": 1086,
|
|
136
|
+
"nodeType": "StructuredDocumentation",
|
|
137
|
+
"src": "2145:850:7",
|
|
138
|
+
"text": " @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n given ``owner``'s signed approval.\n IMPORTANT: The same issues {IERC20-approve} has related to transaction\n ordering also apply here.\n Emits an {Approval} event.\n Requirements:\n - `spender` cannot be the zero address.\n - `deadline` must be a timestamp in the future.\n - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n over the EIP712-formatted function arguments.\n - the signature must use ``owner``'s current nonce (see {nonces}).\n For more information on the signature format, see the\n https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n section].\n CAUTION: See Security Considerations above."
|
|
139
|
+
},
|
|
140
|
+
"functionSelector": "d505accf",
|
|
141
|
+
"id": 1103,
|
|
142
|
+
"implemented": false,
|
|
143
|
+
"kind": "function",
|
|
144
|
+
"modifiers": [],
|
|
145
|
+
"name": "permit",
|
|
146
|
+
"nameLocation": "3009:6:7",
|
|
147
|
+
"nodeType": "FunctionDefinition",
|
|
148
|
+
"parameters": {
|
|
149
|
+
"id": 1101,
|
|
150
|
+
"nodeType": "ParameterList",
|
|
151
|
+
"parameters": [
|
|
152
|
+
{
|
|
153
|
+
"constant": false,
|
|
154
|
+
"id": 1088,
|
|
155
|
+
"mutability": "mutable",
|
|
156
|
+
"name": "owner",
|
|
157
|
+
"nameLocation": "3033:5:7",
|
|
158
|
+
"nodeType": "VariableDeclaration",
|
|
159
|
+
"scope": 1103,
|
|
160
|
+
"src": "3025:13:7",
|
|
161
|
+
"stateVariable": false,
|
|
162
|
+
"storageLocation": "default",
|
|
163
|
+
"typeDescriptions": {
|
|
164
|
+
"typeIdentifier": "t_address",
|
|
165
|
+
"typeString": "address"
|
|
166
|
+
},
|
|
167
|
+
"typeName": {
|
|
168
|
+
"id": 1087,
|
|
169
|
+
"name": "address",
|
|
170
|
+
"nodeType": "ElementaryTypeName",
|
|
171
|
+
"src": "3025:7:7",
|
|
172
|
+
"stateMutability": "nonpayable",
|
|
173
|
+
"typeDescriptions": {
|
|
174
|
+
"typeIdentifier": "t_address",
|
|
175
|
+
"typeString": "address"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"visibility": "internal"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"constant": false,
|
|
182
|
+
"id": 1090,
|
|
183
|
+
"mutability": "mutable",
|
|
184
|
+
"name": "spender",
|
|
185
|
+
"nameLocation": "3056:7:7",
|
|
186
|
+
"nodeType": "VariableDeclaration",
|
|
187
|
+
"scope": 1103,
|
|
188
|
+
"src": "3048:15:7",
|
|
189
|
+
"stateVariable": false,
|
|
190
|
+
"storageLocation": "default",
|
|
191
|
+
"typeDescriptions": {
|
|
192
|
+
"typeIdentifier": "t_address",
|
|
193
|
+
"typeString": "address"
|
|
194
|
+
},
|
|
195
|
+
"typeName": {
|
|
196
|
+
"id": 1089,
|
|
197
|
+
"name": "address",
|
|
198
|
+
"nodeType": "ElementaryTypeName",
|
|
199
|
+
"src": "3048:7:7",
|
|
200
|
+
"stateMutability": "nonpayable",
|
|
201
|
+
"typeDescriptions": {
|
|
202
|
+
"typeIdentifier": "t_address",
|
|
203
|
+
"typeString": "address"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"visibility": "internal"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"constant": false,
|
|
210
|
+
"id": 1092,
|
|
211
|
+
"mutability": "mutable",
|
|
212
|
+
"name": "value",
|
|
213
|
+
"nameLocation": "3081:5:7",
|
|
214
|
+
"nodeType": "VariableDeclaration",
|
|
215
|
+
"scope": 1103,
|
|
216
|
+
"src": "3073:13:7",
|
|
217
|
+
"stateVariable": false,
|
|
218
|
+
"storageLocation": "default",
|
|
219
|
+
"typeDescriptions": {
|
|
220
|
+
"typeIdentifier": "t_uint256",
|
|
221
|
+
"typeString": "uint256"
|
|
222
|
+
},
|
|
223
|
+
"typeName": {
|
|
224
|
+
"id": 1091,
|
|
225
|
+
"name": "uint256",
|
|
226
|
+
"nodeType": "ElementaryTypeName",
|
|
227
|
+
"src": "3073:7:7",
|
|
228
|
+
"typeDescriptions": {
|
|
229
|
+
"typeIdentifier": "t_uint256",
|
|
230
|
+
"typeString": "uint256"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"visibility": "internal"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"constant": false,
|
|
237
|
+
"id": 1094,
|
|
238
|
+
"mutability": "mutable",
|
|
239
|
+
"name": "deadline",
|
|
240
|
+
"nameLocation": "3104:8:7",
|
|
241
|
+
"nodeType": "VariableDeclaration",
|
|
242
|
+
"scope": 1103,
|
|
243
|
+
"src": "3096:16:7",
|
|
244
|
+
"stateVariable": false,
|
|
245
|
+
"storageLocation": "default",
|
|
246
|
+
"typeDescriptions": {
|
|
247
|
+
"typeIdentifier": "t_uint256",
|
|
248
|
+
"typeString": "uint256"
|
|
249
|
+
},
|
|
250
|
+
"typeName": {
|
|
251
|
+
"id": 1093,
|
|
252
|
+
"name": "uint256",
|
|
253
|
+
"nodeType": "ElementaryTypeName",
|
|
254
|
+
"src": "3096:7:7",
|
|
255
|
+
"typeDescriptions": {
|
|
256
|
+
"typeIdentifier": "t_uint256",
|
|
257
|
+
"typeString": "uint256"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"visibility": "internal"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"constant": false,
|
|
264
|
+
"id": 1096,
|
|
265
|
+
"mutability": "mutable",
|
|
266
|
+
"name": "v",
|
|
267
|
+
"nameLocation": "3128:1:7",
|
|
268
|
+
"nodeType": "VariableDeclaration",
|
|
269
|
+
"scope": 1103,
|
|
270
|
+
"src": "3122:7:7",
|
|
271
|
+
"stateVariable": false,
|
|
272
|
+
"storageLocation": "default",
|
|
273
|
+
"typeDescriptions": {
|
|
274
|
+
"typeIdentifier": "t_uint8",
|
|
275
|
+
"typeString": "uint8"
|
|
276
|
+
},
|
|
277
|
+
"typeName": {
|
|
278
|
+
"id": 1095,
|
|
279
|
+
"name": "uint8",
|
|
280
|
+
"nodeType": "ElementaryTypeName",
|
|
281
|
+
"src": "3122:5:7",
|
|
282
|
+
"typeDescriptions": {
|
|
283
|
+
"typeIdentifier": "t_uint8",
|
|
284
|
+
"typeString": "uint8"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"visibility": "internal"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"constant": false,
|
|
291
|
+
"id": 1098,
|
|
292
|
+
"mutability": "mutable",
|
|
293
|
+
"name": "r",
|
|
294
|
+
"nameLocation": "3147:1:7",
|
|
295
|
+
"nodeType": "VariableDeclaration",
|
|
296
|
+
"scope": 1103,
|
|
297
|
+
"src": "3139:9:7",
|
|
298
|
+
"stateVariable": false,
|
|
299
|
+
"storageLocation": "default",
|
|
300
|
+
"typeDescriptions": {
|
|
301
|
+
"typeIdentifier": "t_bytes32",
|
|
302
|
+
"typeString": "bytes32"
|
|
303
|
+
},
|
|
304
|
+
"typeName": {
|
|
305
|
+
"id": 1097,
|
|
306
|
+
"name": "bytes32",
|
|
307
|
+
"nodeType": "ElementaryTypeName",
|
|
308
|
+
"src": "3139:7:7",
|
|
309
|
+
"typeDescriptions": {
|
|
310
|
+
"typeIdentifier": "t_bytes32",
|
|
311
|
+
"typeString": "bytes32"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"visibility": "internal"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"constant": false,
|
|
318
|
+
"id": 1100,
|
|
319
|
+
"mutability": "mutable",
|
|
320
|
+
"name": "s",
|
|
321
|
+
"nameLocation": "3166:1:7",
|
|
322
|
+
"nodeType": "VariableDeclaration",
|
|
323
|
+
"scope": 1103,
|
|
324
|
+
"src": "3158:9:7",
|
|
325
|
+
"stateVariable": false,
|
|
326
|
+
"storageLocation": "default",
|
|
327
|
+
"typeDescriptions": {
|
|
328
|
+
"typeIdentifier": "t_bytes32",
|
|
329
|
+
"typeString": "bytes32"
|
|
330
|
+
},
|
|
331
|
+
"typeName": {
|
|
332
|
+
"id": 1099,
|
|
333
|
+
"name": "bytes32",
|
|
334
|
+
"nodeType": "ElementaryTypeName",
|
|
335
|
+
"src": "3158:7:7",
|
|
336
|
+
"typeDescriptions": {
|
|
337
|
+
"typeIdentifier": "t_bytes32",
|
|
338
|
+
"typeString": "bytes32"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"visibility": "internal"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"src": "3015:158:7"
|
|
345
|
+
},
|
|
346
|
+
"returnParameters": {
|
|
347
|
+
"id": 1102,
|
|
348
|
+
"nodeType": "ParameterList",
|
|
349
|
+
"parameters": [],
|
|
350
|
+
"src": "3182:0:7"
|
|
351
|
+
},
|
|
352
|
+
"scope": 1118,
|
|
353
|
+
"src": "3000:183:7",
|
|
354
|
+
"stateMutability": "nonpayable",
|
|
355
|
+
"virtual": false,
|
|
356
|
+
"visibility": "external"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"documentation": {
|
|
360
|
+
"id": 1104,
|
|
361
|
+
"nodeType": "StructuredDocumentation",
|
|
362
|
+
"src": "3189:294:7",
|
|
363
|
+
"text": " @dev Returns the current nonce for `owner`. This value must be\n included whenever a signature is generated for {permit}.\n Every successful call to {permit} increases ``owner``'s nonce by one. This\n prevents a signature from being used multiple times."
|
|
364
|
+
},
|
|
365
|
+
"functionSelector": "7ecebe00",
|
|
366
|
+
"id": 1111,
|
|
367
|
+
"implemented": false,
|
|
368
|
+
"kind": "function",
|
|
369
|
+
"modifiers": [],
|
|
370
|
+
"name": "nonces",
|
|
371
|
+
"nameLocation": "3497:6:7",
|
|
372
|
+
"nodeType": "FunctionDefinition",
|
|
373
|
+
"parameters": {
|
|
374
|
+
"id": 1107,
|
|
375
|
+
"nodeType": "ParameterList",
|
|
376
|
+
"parameters": [
|
|
377
|
+
{
|
|
378
|
+
"constant": false,
|
|
379
|
+
"id": 1106,
|
|
380
|
+
"mutability": "mutable",
|
|
381
|
+
"name": "owner",
|
|
382
|
+
"nameLocation": "3512:5:7",
|
|
383
|
+
"nodeType": "VariableDeclaration",
|
|
384
|
+
"scope": 1111,
|
|
385
|
+
"src": "3504:13:7",
|
|
386
|
+
"stateVariable": false,
|
|
387
|
+
"storageLocation": "default",
|
|
388
|
+
"typeDescriptions": {
|
|
389
|
+
"typeIdentifier": "t_address",
|
|
390
|
+
"typeString": "address"
|
|
391
|
+
},
|
|
392
|
+
"typeName": {
|
|
393
|
+
"id": 1105,
|
|
394
|
+
"name": "address",
|
|
395
|
+
"nodeType": "ElementaryTypeName",
|
|
396
|
+
"src": "3504:7:7",
|
|
397
|
+
"stateMutability": "nonpayable",
|
|
398
|
+
"typeDescriptions": {
|
|
399
|
+
"typeIdentifier": "t_address",
|
|
400
|
+
"typeString": "address"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"visibility": "internal"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"src": "3503:15:7"
|
|
407
|
+
},
|
|
408
|
+
"returnParameters": {
|
|
409
|
+
"id": 1110,
|
|
410
|
+
"nodeType": "ParameterList",
|
|
411
|
+
"parameters": [
|
|
412
|
+
{
|
|
413
|
+
"constant": false,
|
|
414
|
+
"id": 1109,
|
|
415
|
+
"mutability": "mutable",
|
|
416
|
+
"name": "",
|
|
417
|
+
"nameLocation": "-1:-1:-1",
|
|
418
|
+
"nodeType": "VariableDeclaration",
|
|
419
|
+
"scope": 1111,
|
|
420
|
+
"src": "3542:7:7",
|
|
421
|
+
"stateVariable": false,
|
|
422
|
+
"storageLocation": "default",
|
|
423
|
+
"typeDescriptions": {
|
|
424
|
+
"typeIdentifier": "t_uint256",
|
|
425
|
+
"typeString": "uint256"
|
|
426
|
+
},
|
|
427
|
+
"typeName": {
|
|
428
|
+
"id": 1108,
|
|
429
|
+
"name": "uint256",
|
|
430
|
+
"nodeType": "ElementaryTypeName",
|
|
431
|
+
"src": "3542:7:7",
|
|
432
|
+
"typeDescriptions": {
|
|
433
|
+
"typeIdentifier": "t_uint256",
|
|
434
|
+
"typeString": "uint256"
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"visibility": "internal"
|
|
438
|
+
}
|
|
439
|
+
],
|
|
440
|
+
"src": "3541:9:7"
|
|
441
|
+
},
|
|
442
|
+
"scope": 1118,
|
|
443
|
+
"src": "3488:63:7",
|
|
444
|
+
"stateMutability": "view",
|
|
445
|
+
"virtual": false,
|
|
446
|
+
"visibility": "external"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"documentation": {
|
|
450
|
+
"id": 1112,
|
|
451
|
+
"nodeType": "StructuredDocumentation",
|
|
452
|
+
"src": "3557:128:7",
|
|
453
|
+
"text": " @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}."
|
|
454
|
+
},
|
|
455
|
+
"functionSelector": "3644e515",
|
|
456
|
+
"id": 1117,
|
|
457
|
+
"implemented": false,
|
|
458
|
+
"kind": "function",
|
|
459
|
+
"modifiers": [],
|
|
460
|
+
"name": "DOMAIN_SEPARATOR",
|
|
461
|
+
"nameLocation": "3752:16:7",
|
|
462
|
+
"nodeType": "FunctionDefinition",
|
|
463
|
+
"parameters": {
|
|
464
|
+
"id": 1113,
|
|
465
|
+
"nodeType": "ParameterList",
|
|
466
|
+
"parameters": [],
|
|
467
|
+
"src": "3768:2:7"
|
|
468
|
+
},
|
|
469
|
+
"returnParameters": {
|
|
470
|
+
"id": 1116,
|
|
471
|
+
"nodeType": "ParameterList",
|
|
472
|
+
"parameters": [
|
|
473
|
+
{
|
|
474
|
+
"constant": false,
|
|
475
|
+
"id": 1115,
|
|
476
|
+
"mutability": "mutable",
|
|
477
|
+
"name": "",
|
|
478
|
+
"nameLocation": "-1:-1:-1",
|
|
479
|
+
"nodeType": "VariableDeclaration",
|
|
480
|
+
"scope": 1117,
|
|
481
|
+
"src": "3794:7:7",
|
|
482
|
+
"stateVariable": false,
|
|
483
|
+
"storageLocation": "default",
|
|
484
|
+
"typeDescriptions": {
|
|
485
|
+
"typeIdentifier": "t_bytes32",
|
|
486
|
+
"typeString": "bytes32"
|
|
487
|
+
},
|
|
488
|
+
"typeName": {
|
|
489
|
+
"id": 1114,
|
|
490
|
+
"name": "bytes32",
|
|
491
|
+
"nodeType": "ElementaryTypeName",
|
|
492
|
+
"src": "3794:7:7",
|
|
493
|
+
"typeDescriptions": {
|
|
494
|
+
"typeIdentifier": "t_bytes32",
|
|
495
|
+
"typeString": "bytes32"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
"visibility": "internal"
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
"src": "3793:9:7"
|
|
502
|
+
},
|
|
503
|
+
"scope": 1118,
|
|
504
|
+
"src": "3743:60:7",
|
|
505
|
+
"stateMutability": "view",
|
|
506
|
+
"virtual": false,
|
|
507
|
+
"visibility": "external"
|
|
508
|
+
}
|
|
509
|
+
],
|
|
510
|
+
"scope": 1119,
|
|
511
|
+
"src": "2116:1689:7",
|
|
512
|
+
"usedErrors": [],
|
|
513
|
+
"usedEvents": []
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"src": "123:3683:7"
|
|
517
|
+
},
|
|
518
|
+
"compiler": {
|
|
519
|
+
"name": "solc",
|
|
520
|
+
"version": "0.8.21+commit.d9974bed.Emscripten.clang"
|
|
521
|
+
},
|
|
522
|
+
"networks": {},
|
|
523
|
+
"schemaVersion": "3.4.16",
|
|
524
|
+
"updatedAt": "2026-01-24T20:23:03.918Z",
|
|
525
|
+
"devdoc": {
|
|
526
|
+
"details": "Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[ERC-2612]. Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all. ==== Security Considerations There are two important considerations concerning the use of `permit`. The first is that a valid permit signature expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be considered as an intention to spend the allowance in any specific way. The second is that because permits have built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be generally recommended is: ```solidity function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} doThing(..., value); } function doThing(..., uint256 value) public { token.safeTransferFrom(msg.sender, address(this), value); ... } ``` Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also {SafeERC20-safeTransferFrom}). Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so contracts should have entry points that don't rely on permit.",
|
|
527
|
+
"kind": "dev",
|
|
528
|
+
"methods": {
|
|
529
|
+
"DOMAIN_SEPARATOR()": {
|
|
530
|
+
"details": "Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}."
|
|
531
|
+
},
|
|
532
|
+
"nonces(address)": {
|
|
533
|
+
"details": "Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times."
|
|
534
|
+
},
|
|
535
|
+
"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": {
|
|
536
|
+
"details": "Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above."
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
"version": 1
|
|
540
|
+
},
|
|
541
|
+
"userdoc": {
|
|
542
|
+
"kind": "user",
|
|
543
|
+
"methods": {},
|
|
544
|
+
"version": 1
|
|
545
|
+
}
|
|
546
|
+
}
|