@etherisc/depeg-contracts
Version:
Etherisc's smart contracts for a depeg insurance for stable coins.
1,360 lines • 314 kB
JSON
{
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "EIP712_DOMAIN_NAME",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EIP712_DOMAIN_VERSION",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EIP712_POLICY_TYPE",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EIP712_TYPE_HASH",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "policyHolder",
"type": "address"
},
{
"internalType": "address",
"name": "protectedWallet",
"type": "address"
},
{
"internalType": "uint256",
"name": "protectedBalance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bundleId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "signatureId",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"name": "checkAndRegisterSignature",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "digest",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"name": "getSigner",
"outputs": [
{
"internalType": "address",
"name": "signer",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "protectedWallet",
"type": "address"
},
{
"internalType": "uint256",
"name": "protectedBalance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "duration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bundleId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "signatureId",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"name": "getSignerFromDigestAndSignature",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "structHash",
"type": "bytes32"
}
],
"name": "getTypedDataV4Hash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
}
],
"allSourcePaths": {
"12": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Strings.sol",
"13": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/cryptography/ECDSA.sol",
"51": "contracts/DepegMessageHelper.sol",
"54": "contracts/EIP712.sol"
},
"ast": {
"absolutePath": "contracts/DepegMessageHelper.sol",
"exportedSymbols": {
"DepegMessageHelper": [
773
],
"ECDSA": [
13816
],
"EIP712": [
4683
]
},
"id": 774,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 614,
"literals": [
"solidity",
"0.8",
".2"
],
"nodeType": "PragmaDirective",
"src": "39:22:51"
},
{
"absolutePath": "contracts/EIP712.sol",
"file": "./EIP712.sol",
"id": 615,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 774,
"sourceUnit": 4684,
"src": "63:22:51",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 616,
"name": "EIP712",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4683,
"src": "124:6:51"
},
"id": 617,
"nodeType": "InheritanceSpecifier",
"src": "124:6:51"
}
],
"contractDependencies": [
4683
],
"contractKind": "contract",
"fullyImplemented": true,
"id": 773,
"linearizedBaseContracts": [
773,
4683
],
"name": "DepegMessageHelper",
"nameLocation": "97:18:51",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"functionSelector": "fd070296",
"id": 620,
"mutability": "constant",
"name": "EIP712_DOMAIN_NAME",
"nameLocation": "191:18:51",
"nodeType": "VariableDeclaration",
"scope": 773,
"src": "168:59:51",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 618,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "168:6:51",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"hexValue": "45746865726973634465706567",
"id": 619,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "212:15:51",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_55d9572bc870968148d64559e3f054afe52848f22a50302a667bf2b58a0c131b",
"typeString": "literal_string \"EtheriscDepeg\""
},
"value": "EtheriscDepeg"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "5cc33321",
"id": 623,
"mutability": "constant",
"name": "EIP712_DOMAIN_VERSION",
"nameLocation": "256:21:51",
"nodeType": "VariableDeclaration",
"scope": 773,
"src": "233:50:51",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 621,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "233:6:51",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"hexValue": "31",
"id": 622,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "280:3:51",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
"typeString": "literal_string \"1\""
},
"value": "1"
},
"visibility": "public"
},
{
"constant": true,
"functionSelector": "3e52fa7d",
"id": 626,
"mutability": "constant",
"name": "EIP712_POLICY_TYPE",
"nameLocation": "313:18:51",
"nodeType": "VariableDeclaration",
"scope": 773,
"src": "290:147:51",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 624,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "290:6:51",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": {
"hexValue": "506f6c69637928616464726573732077616c6c65742c75696e743235362070726f74656374656442616c616e63652c75696e74323536206475726174696f6e2c75696e743235362062756e646c6549642c62797465733332207369676e6174757265496429",
"id": 625,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "334:103:51",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b6dd538ff87d5c91deec48f5de8217be49503aae080311a8c657fadf3bc6e9ba",
"typeString": "literal_string \"Policy(address wallet,uint256 protectedBalance,uint256 duration,uint256 bundleId,bytes32 signatureId)\""
},
"value": "Policy(address wallet,uint256 protectedBalance,uint256 duration,uint256 bundleId,bytes32 signatureId)"
},
"visibility": "public"
},
{
"constant": true,
"id": 634,
"mutability": "constant",
"name": "EIP712_POLICY_TYPE_HASH",
"nameLocation": "468:23:51",
"nodeType": "VariableDeclaration",
"scope": 773,
"src": "443:98:51",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 627,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "443:7:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"arguments": [
{
"arguments": [
{
"id": 631,
"name": "EIP712_POLICY_TYPE",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 626,
"src": "521:18:51",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"expression": {
"id": 629,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "504:3:51",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 630,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"src": "504:16:51",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 632,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "504:36:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 628,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "494:9:51",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 633,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "494:47:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "private"
},
{
"constant": false,
"id": 638,
"mutability": "mutable",
"name": "_signatureIsUsed",
"nameLocation": "643:16:51",
"nodeType": "VariableDeclaration",
"scope": 773,
"src": "578:81:51",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$",
"typeString": "mapping(bytes32 => bool)"
},
"typeName": {
"id": 637,
"keyType": {
"id": 635,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "586:7:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "578:56:51",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$",
"typeString": "mapping(bytes32 => bool)"
},
"valueType": {
"id": 636,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "618:4:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"visibility": "private"
},
{
"body": {
"id": 645,
"nodeType": "Block",
"src": "743:3:51",
"statements": []
},
"id": 646,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [
{
"id": 641,
"name": "EIP712_DOMAIN_NAME",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 620,
"src": "696:18:51",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"id": 642,
"name": "EIP712_DOMAIN_VERSION",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 623,
"src": "716:21:51",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"id": 643,
"modifierName": {
"id": 640,
"name": "EIP712",
"nodeType": "IdentifierPath",
"referencedDeclaration": 4683,
"src": "689:6:51"
},
"nodeType": "ModifierInvocation",
"src": "689:49:51"
}
],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 639,
"nodeType": "ParameterList",
"parameters": [],
"src": "678:2:51"
},
"returnParameters": {
"id": 644,
"nodeType": "ParameterList",
"parameters": [],
"src": "743:0:51"
},
"scope": 773,
"src": "667:79:51",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 704,
"nodeType": "Block",
"src": "1028:493:51",
"statements": [
{
"assignments": [
664
],
"declarations": [
{
"constant": false,
"id": 664,
"mutability": "mutable",
"name": "signatureHash",
"nameLocation": "1046:13:51",
"nodeType": "VariableDeclaration",
"scope": 704,
"src": "1038:21:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 663,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1038:7:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"id": 671,
"initialValue": {
"arguments": [
{
"arguments": [
{
"id": 668,
"name": "signature",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1083:9:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
],
"expression": {
"id": 666,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1072:3:51",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 667,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encode",
"nodeType": "MemberAccess",
"src": "1072:10:51",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 669,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1072:21:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 665,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "1062:9:51",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 670,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1062:32:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1038:56:51"
},
{
"expression": {
"arguments": [
{
"id": 676,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "1112:32:51",
"subExpression": {
"baseExpression": {
"id": 673,
"name": "_signatureIsUsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 638,
"src": "1113:16:51",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$",
"typeString": "mapping(bytes32 => bool)"
}
},
"id": 675,
"indexExpression": {
"id": 674,
"name": "signatureHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 664,
"src": "1130:13:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1113:31:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4552524f523a444d482d3030313a5349474e41545552455f55534544",
"id": 677,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1146:30:51",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_8e53c88cc77be3290241c20586460c6c59763706498c6a6505712649ae69e75c",
"typeString": "literal_string \"ERROR:DMH-001:SIGNATURE_USED\""
},
"value": "ERROR:DMH-001:SIGNATURE_USED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_8e53c88cc77be3290241c20586460c6c59763706498c6a6505712649ae69e75c",
"typeString": "literal_string \"ERROR:DMH-001:SIGNATURE_USED\""
}
],
"id": 672,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1104:7:51",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 678,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1104:73:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 679,
"nodeType": "ExpressionStatement",
"src": "1104:73:51"
},
{
"assignments": [
681
],
"declarations": [
{
"constant": false,
"id": 681,
"mutability": "mutable",
"name": "signer",
"nameLocation": "1196:6:51",
"nodeType": "VariableDeclaration",
"scope": 704,
"src": "1188:14:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 680,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1188:7:51",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"id": 690,
"initialValue": {
"arguments": [
{
"id": 683,
"name": "protectedWallet",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 650,
"src": "1250:15:51",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 684,
"name": "protectedBalance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 652,
"src": "1279:16:51",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"id": 685,
"name": "duration",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 654,
"src": "1309:8:51",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"id": 686,
"name": "bundleId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 656,
"src": "1331:8:51",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"id": 687,
"name": "signatureId",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 658,
"src": "1353:11:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 688,
"name": "signature",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 660,
"src": "1378:9:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
],
"id": 682,
"name": "getSignerFromDigestAndSignature",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 738,
"src": "1205:31:51",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bytes32_$_t_bytes_calldata_ptr_$returns$_t_address_$",
"typeString": "function (address,uint256,uint256,uint256,bytes32,bytes calldata) view returns (address)"
}
},
"id": 689,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1205:183:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1188:200:51"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 694,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 692,
"name": "policyHolder",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 648,
"src": "1407:12:51",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 693,
"name": "signer",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 681,
"src": "1423:6:51",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1407:22:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4552524f523a444d482d3030323a5349474e41545552455f494e56414c4944",
"id": 695,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1431:33:51",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_8b27aaec7de31e49e9b26ba7b77713fb4abf609e8173566afc0f2ab28c206d9e",
"typeString": "literal_string \"ERROR:DMH-002:SIGNATURE_INVALID\""
},
"value": "ERROR:DMH-002:SIGNATURE_INVALID"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_8b27aaec7de31e49e9b26ba7b77713fb4abf609e8173566afc0f2ab28c206d9e",
"typeString": "literal_string \"ERROR:DMH-002:SIGNATURE_INVALID\""
}
],
"id": 691,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1399:7:51",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 696,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1399:66:51",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 697,
"nodeType": "ExpressionStatement",
"src": "1399:66:51"
},
{
"expression": {
"id": 702,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 698,
"name": "_signatureIsUsed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 638,
"src": "1476:16:51",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_bool_$",
"typeString": "mapping(bytes32 => bool)"
}
},
"id": 700,
"indexExpression": {
"id": 699,
"name": "signatureHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 664,
"src": "1493:13:51",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "1476:31:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"hexValue": "74727565",
"id": 701,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1510:4:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1476:38:51",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 703,
"nodeType": "ExpressionStatement",
"src": "1476:38:51"
}
]
},
"functionSelector": "12435abc",
"id": 705,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "checkAndRegisterSignature",
"nameLocation": "761:25:51",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 661,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 648,
"mutability": "mutable",
"name": "policyHolder",
"nameLocation": "805:12:51",
"nodeType": "VariableDeclaration",
"scope": 705,
"src": "797:20:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 647,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "797:7:51",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 650,
"mutability": "mutable",
"name": "protectedWallet",
"nameLocation": "835:15:51",
"nodeType": "VariableDeclaration",
"scope": 705,
"src": "827:23:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 649,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "827:7:51",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 652,
"mutability": "mutable",
"name": "protectedBalance",
"nameLocation": "868:16:51",
"nodeType": "VariableDeclaration",
"scope": 705,
"src": "860:24:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 651,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "860:7:51",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 654,
"mutability": "mutable",
"name": "duration",
"nameLocation": "902:8:51",
"nodeType": "VariableDeclaration",
"scope": 705,
"src": "894:16:51",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 653,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "894:7:51",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"