UNPKG

@etherisc/depeg-contracts

Version:

Etherisc's smart contracts for a depeg insurance for stable coins.

1,594 lines (1,593 loc) 1.64 MB
{ "abi": [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "capacity", "type": "uint256" } ], "name": "LogBundleCapitalProvided", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "capacity", "type": "uint256" } ], "name": "LogBundleCapitalWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "riskpoolId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": false, "internalType": "enum IBundle.BundleState", "name": "state", "type": "uint8" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "LogBundleCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "LogBundlePayoutProcessed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "capacity", "type": "uint256" } ], "name": "LogBundlePolicyCollateralized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "capacity", "type": "uint256" } ], "name": "LogBundlePolicyReleased", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "indexed": false, "internalType": "enum IBundle.BundleState", "name": "oldState", "type": "uint8" }, { "indexed": false, "internalType": "enum IBundle.BundleState", "name": "newState", "type": "uint8" } ], "name": "LogBundleStateChanged", "type": "event" }, { "inputs": [], "name": "bundles", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "close", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "collateralizePolicy", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner_", "type": "address" }, { "internalType": "uint256", "name": "riskpoolId_", "type": "uint256" }, { "internalType": "bytes", "name": "filter_", "type": "bytes" }, { "internalType": "uint256", "name": "amount_", "type": "uint256" } ], "name": "create", "outputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "defund", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "fund", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getBalance", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getBundle", "outputs": [ { "components": [ { "internalType": "uint256", "name": "id", "type": "uint256" }, { "internalType": "uint256", "name": "riskpoolId", "type": "uint256" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "enum IBundle.BundleState", "name": "state", "type": "uint8" }, { "internalType": "bytes", "name": "filter", "type": "bytes" }, { "internalType": "uint256", "name": "capital", "type": "uint256" }, { "internalType": "uint256", "name": "lockedCapital", "type": "uint256" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "createdAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" } ], "internalType": "struct IBundle.Bundle", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getCapacity", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getFilter", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getOwner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getState", "outputs": [ { "internalType": "enum IBundle.BundleState", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getToken", "outputs": [ { "internalType": "contract BundleToken", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getTotalValueLocked", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "registry", "type": "address" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "lock", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "processPayout", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "processPremium", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "releasePolicy", "outputs": [ { "internalType": "uint256", "name": "remainingCollateralAmount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "riskpoolId", "type": "uint256" } ], "name": "unburntBundles", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "unlock", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "allSourcePaths": { "0": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/access/Ownable.sol", "1": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/proxy/utils/Initializable.sol", "10": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Address.sol", "11": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Context.sol", "12": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Strings.sol", "14": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/ERC165.sol", "15": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/IERC165.sol", "16": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/structs/EnumerableSet.sol", "17": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/BundleController.sol", "18": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/ComponentController.sol", "19": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/PolicyController.sol", "20": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/PoolController.sol", "22": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/shared/CoreController.sol", "24": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/tokens/BundleToken.sol", "27": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IComponent.sol", "29": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IProduct.sol", "30": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IRiskpool.sol", "33": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IAccess.sol", "34": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IBundle.sol", "35": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IComponentEvents.sol", "36": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPolicy.sol", "37": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPool.sol", "38": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IRegistry.sol", "46": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol", "6": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/ERC721.sol", "7": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721.sol", "8": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721Receiver.sol", "9": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/extensions/IERC721Metadata.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/BundleController.sol", "exportedSymbols": { "Address": [ 24852 ], "BundleController": [ 17412 ], "BundleToken": [ 23505 ], "ComponentController": [ 18412 ], "Context": [ 15648 ], "CoreController": [ 21649 ], "ERC165": [ 24921 ], "ERC721": [ 24557 ], "EnumerableSet": [ 10109 ], "IAccess": [ 22927 ], "IBundle": [ 13382 ], "IBundleToken": [ 13428 ], "IComponent": [ 11675 ], "IComponentEvents": [ 22980 ], "IERC165": [ 22864 ], "IERC721": [ 13932 ], "IERC721Metadata": [ 24897 ], "IERC721Receiver": [ 24870 ], "IOracle": [ 23539 ], "IPolicy": [ 12649 ], "IPool": [ 23131 ], "IProduct": [ 21878 ], "IRegistry": [ 21976 ], "IRiskpool": [ 14585 ], "Initializable": [ 23690 ], "Ownable": [ 9476 ], "PolicyController": [ 20323 ], "PoolController": [ 21513 ], "Strings": [ 16154 ] }, "id": 17413, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 16156, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:17" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/PolicyController.sol", "file": "./PolicyController.sol", "id": 16157, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 20324, "src": "63:32:17", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/shared/CoreController.sol", "file": "../shared/CoreController.sol", "id": 16158, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 21650, "src": "96:38:17", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/tokens/BundleToken.sol", "file": "../tokens/BundleToken.sol", "id": 16159, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 23506, "src": "135:35:17", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IProduct.sol", "file": "@etherisc/gif-interface/contracts/components/IProduct.sol", "id": 16160, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 21879, "src": "172:67:17", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IBundle.sol", "file": "@etherisc/gif-interface/contracts/modules/IBundle.sol", "id": 16161, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 13383, "src": "240:63:17", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-contracts@b58fd27/contracts/modules/PoolController.sol", "file": "./PoolController.sol", "id": 16162, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17413, "sourceUnit": 21514, "src": "304:30:17", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 16163, "name": "IBundle", "nodeType": "IdentifierPath", "referencedDeclaration": 13382, "src": "371:7:17" }, "id": 16164, "nodeType": "InheritanceSpecifier", "src": "371:7:17" }, { "baseName": { "id": 16165, "name": "CoreController", "nodeType": "IdentifierPath", "referencedDeclaration": 21649, "src": "384:14:17" }, "id": 16166, "nodeType": "InheritanceSpecifier", "src": "384:14:17" } ], "contractDependencies": [ 13382, 15648, 21649, 23690 ], "contractKind": "contract", "fullyImplemented": true, "id": 17412, "linearizedBaseContracts": [ 17412, 21649, 23690, 15648, 13382 ], "name": "BundleController", "nameLocation": "346:16:17", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 16169, "mutability": "mutable", "name": "_policy", "nameLocation": "431:7:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "406:32:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$20323", "typeString": "contract PolicyController" }, "typeName": { "id": 16168, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 16167, "name": "PolicyController", "nodeType": "IdentifierPath", "referencedDeclaration": 20323, "src": "406:16:17" }, "referencedDeclaration": 20323, "src": "406:16:17", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$20323", "typeString": "contract PolicyController" } }, "visibility": "private" }, { "constant": false, "id": 16172, "mutability": "mutable", "name": "_token", "nameLocation": "464:6:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "444:26:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_BundleToken_$23505", "typeString": "contract BundleToken" }, "typeName": { "id": 16171, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 16170, "name": "BundleToken", "nodeType": "IdentifierPath", "referencedDeclaration": 23505, "src": "444:11:17" }, "referencedDeclaration": 23505, "src": "444:11:17", "typeDescriptions": { "typeIdentifier": "t_contract$_BundleToken_$23505", "typeString": "contract BundleToken" } }, "visibility": "private" }, { "constant": false, "id": 16177, "mutability": "mutable", "name": "_bundles", "nameLocation": "541:8:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "478:71:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Bundle_$13298_storage_$", "typeString": "mapping(uint256 => struct IBundle.Bundle)" }, "typeName": { "id": 16176, "keyType": { "id": 16173, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "486:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", "src": "478:54:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Bundle_$13298_storage_$", "typeString": "mapping(uint256 => struct IBundle.Bundle)" }, "valueType": { "id": 16175, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 16174, "name": "Bundle", "nodeType": "IdentifierPath", "referencedDeclaration": 13298, "src": "512:6:17" }, "referencedDeclaration": 13298, "src": "512:6:17", "typeDescriptions": { "typeIdentifier": "t_struct$_Bundle_$13298_storage_ptr", "typeString": "struct IBundle.Bundle" } } }, "visibility": "private" }, { "constant": false, "id": 16181, "mutability": "mutable", "name": "_activePolicies", "nameLocation": "630:15:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "555:90:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" }, "typeName": { "id": 16180, "keyType": { "id": 16178, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "563:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", "src": "555:66:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" }, "valueType": { "id": 16179, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "589:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "visibility": "private" }, { "constant": false, "id": 16187, "mutability": "mutable", "name": "_valueLockedPerPolicy", "nameLocation": "764:21:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "651:134:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_mapping$_t_bytes32_$_t_uint256_$_$", "typeString": "mapping(uint256 => mapping(bytes32 => uint256))" }, "typeName": { "id": 16186, "keyType": { "id": 16182, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "659:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", "src": "651:104:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_mapping$_t_bytes32_$_t_uint256_$_$", "typeString": "mapping(uint256 => mapping(bytes32 => uint256))" }, "valueType": { "id": 16185, "keyType": { "id": 16183, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "693:7:17", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "685:69:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 16184, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "720:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } } }, "visibility": "private" }, { "constant": false, "id": 16191, "mutability": "mutable", "name": "_unburntBundlesForRiskpoolId", "nameLocation": "873:28:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "791:110:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" }, "typeName": { "id": 16190, "keyType": { "id": 16188, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "799:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", "src": "791:73:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" }, "valueType": { "id": 16189, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "827:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "visibility": "private" }, { "constant": false, "id": 16193, "mutability": "mutable", "name": "_bundleCount", "nameLocation": "929:12:17", "nodeType": "VariableDeclaration", "scope": 17412, "src": "913:28:17", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 16192, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "913:7:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "private" }, { "body": { "id": 16206, "nodeType": "Block", "src": "979:163:17", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 16201, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 16196, "name": "_msgSender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15638, "src": "1010:10:17", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 16197, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1010:12:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "arguments": [ { "hexValue": "5269736b706f6f6c53657276696365", "id": 16199, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1046:17:17", "typeDescriptions": { "typeIdentifier": "t_stringliteral_e85801e7370f8299b20de95f253b0d76ea9617d54202cf651cae4bfb65abf86a", "typeString": "literal_string \"RiskpoolService\"" }, "value": "RiskpoolService" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_e85801e7370f8299b20de95f253b0d76ea9617d54202cf651cae4bfb65abf86a", "typeString": "literal_string \"RiskpoolService\"" } ], "id": 16198, "name": "_getContractAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 21648, "src": "1026:19:17", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32) view returns (address)" } }, "id": 16200, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1026:38:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1010:54:17", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4552524f523a4255432d3030313a4e4f545f5249534b504f4f4c5f53455256494345", "id": 16202, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1078:36:17", "typeDescriptions": { "typeIdentifier": "t_stringliteral_476d7bdb29f083f2ebfc1b7face76d9f76a751b84204921dae4a5245b351756d", "typeString": "literal_string \"ERROR:BUC-001:NOT_RISKPOOL_SERVICE\"" }, "value": "ERROR:BUC-001:NOT_RISKPOOL_SERVICE" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_476d7bdb29f083f2ebfc1b7face76d9f76a751b84204921dae4a5245b351756d", "typeString": "literal_string \"ERROR:BUC-001:NOT_RISKPOOL_SERVICE\"" } ], "id": 16195, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "989:7:17", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 16203, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "989:135:17", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 16204, "nodeType": "ExpressionStatement", "src": "989:135:17" }, { "id": 16205, "nodeType": "PlaceholderStatement", "src": "1134:1:17" } ] }, "id": 16207, "name": "onlyRiskpoolService", "nameLocation": "957:19:17", "nodeType": "ModifierDefinition", "parameters": { "id": 16194, "nodeType": "ParameterList", "parameters": [], "src": "976:2:17" }, "src": "948:194:17", "virtual": false, "visibility": "internal" }, { "body": { "id": 16244, "nodeType": "Block", "src": "1194:331:17", "statements": [ { "assignments": [ 16213 ], "declarations": [ { "constant": false, "id": 16213, "mutability": "mutable", "name": "bundle", "nameLocation": "1219:6:17", "nodeType": "VariableDeclaration", "scope": 16244, "src": "1204:21:17", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_Bundle_$13298_storage_ptr", "typeString": "struct IBundle.Bundle" }, "typeName": { "id": 16212, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 16211, "name": "Bundle", "nodeType": "IdentifierPath", "referencedDeclaration": 13298, "src": "1204:6:17" }, "referencedDeclaration": 13298, "src": "1204:6:17", "typeDescriptions": { "typeIdentifier": "t_struct$_Bundle_$13298_storage_ptr", "typeString": "struct IBundle.Bundle" } }, "visibility": "internal" } ], "id": 16217, "initialValue": { "baseExpression": { "id": 16214, "name": "_bundles", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16177, "src": "1228:8:17", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Bundle_$13298_storage_$", "typeString": "mapping(uint256 => struct IBundle.Bundle storage ref)" } }, "id": 16216, "indexExpression": { "id": 16215, "name": "bundleId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16209, "src": "1237:8:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1228:18:17", "typeDescriptions": { "typeIdentifier": "t_struct$_Bundle_$13298_storage", "typeString": "struct IBundle.Bundle storage ref" } }, "nodeType": "VariableDeclarationStatement", "src": "1204:42:17" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 16222, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "id": 16219, "name": "bundle", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16213, "src": "1264:6:17", "typeDescriptions": { "typeIdentifier": "t_struct$_Bundle_$13298_storage_ptr", "typeString": "struct IBundle.Bundle storage pointer" } }, "id": 16220, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "createdAt", "nodeType": "MemberAccess", "referencedDeclaration": 13295, "src": "1264:16:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 16221, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1283:1:17", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1264:20:17", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4552524f523a4255432d3030323a42554e444c455f444f45535f4e4f545f4558495354", "id": 16223, "isConstant": false, "isLValue": false, "isPure": true,