UNPKG

@etherisc/depeg-contracts

Version:

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

1,161 lines 34 kB
{ "abi": [ { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "decodeBundleData", "outputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "riskpoolId", "type": "uint256" }, { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "string", "name": "displayName", "type": "string" }, { "internalType": "uint256", "name": "expiryAt", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "decodeComponentData", "outputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "componentId", "type": "uint256" }, { "internalType": "address", "name": "token", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "decodeStakeData", "outputs": [ { "internalType": "uint96", "name": "target", "type": "uint96" }, { "internalType": "uint8", "name": "targetType", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "exists", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" }, { "internalType": "uint256", "name": "lifetimeExtension", "type": "uint256" } ], "name": "extendBundleLifetime", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "bundleId", "type": "uint256" } ], "name": "getBundleNftId", "outputs": [ { "internalType": "uint96", "name": "nftId", "type": "uint96" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "componentId", "type": "uint256" } ], "name": "getComponentNftId", "outputs": [ { "internalType": "uint96", "name": "nftId", "type": "uint96" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" } ], "name": "getInstanceNftId", "outputs": [ { "internalType": "uint96", "name": "nftId", "type": "uint96" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getNft", "outputs": [ { "internalType": "contract IChainNftFacade", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes5", "name": "chain", "type": "bytes5" }, { "internalType": "uint8", "name": "objectType", "type": "uint8" }, { "internalType": "uint256", "name": "idx", "type": "uint256" } ], "name": "getNftId", "outputs": [ { "internalType": "uint96", "name": "nftId", "type": "uint96" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "getNftInfo", "outputs": [ { "components": [ { "internalType": "uint96", "name": "id", "type": "uint96" }, { "internalType": "bytes5", "name": "chain", "type": "bytes5" }, { "internalType": "uint8", "name": "objectType", "type": "uint8" }, { "internalType": "enum IChainRegistryFacadeExt.ObjectState", "name": "state", "type": "uint8" }, { "internalType": "string", "name": "uri", "type": "string" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "uint32", "name": "mintedIn", "type": "uint32" }, { "internalType": "uint32", "name": "updatedIn", "type": "uint32" }, { "internalType": "uint48", "name": "version", "type": "uint48" } ], "internalType": "struct IChainRegistryFacadeExt.NftInfo", "name": "", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes5", "name": "chain", "type": "bytes5" }, { "internalType": "uint8", "name": "objectType", "type": "uint8" } ], "name": "objects", "outputs": [ { "internalType": "uint256", "name": "numberOfObjects", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "nftOwner", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "riskpoolId", "type": "uint256" }, { "internalType": "uint256", "name": "bundleId", "type": "uint256" }, { "internalType": "string", "name": "displayName", "type": "string" }, { "internalType": "uint256", "name": "expiryAt", "type": "uint256" } ], "name": "registerBundle", "outputs": [ { "internalType": "uint96", "name": "nftId", "type": "uint96" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "instanceId", "type": "bytes32" }, { "internalType": "uint256", "name": "componentId", "type": "uint256" }, { "internalType": "string", "name": "uri", "type": "string" } ], "name": "registerComponent", "outputs": [ { "internalType": "uint96", "name": "id", "type": "uint96" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "chainId", "type": "uint256" } ], "name": "toChain", "outputs": [ { "internalType": "bytes5", "name": "chain", "type": "bytes5" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "version", "outputs": [ { "internalType": "uint48", "name": "", "type": "uint48" } ], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "versionParts", "outputs": [ { "internalType": "uint16", "name": "major", "type": "uint16" }, { "internalType": "uint16", "name": "minor", "type": "uint16" }, { "internalType": "uint16", "name": "patch", "type": "uint16" } ], "stateMutability": "view", "type": "function" } ], "allSourcePaths": { "59": "contracts/registry/IChainNftFacade.sol", "60": "contracts/registry/IChainRegistryFacade.sol", "61": "contracts/registry/IChainRegistryFacadeExt.sol" }, "ast": { "absolutePath": "contracts/registry/IChainRegistryFacadeExt.sol", "exportedSymbols": { "IChainRegistryFacade": [ 7497 ], "IChainRegistryFacadeExt": [ 7550 ] }, "id": 7551, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 7499, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:61" }, { "absolutePath": "contracts/registry/IChainRegistryFacade.sol", "file": "./IChainRegistryFacade.sol", "id": 7501, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 7551, "sourceUnit": 7498, "src": "267:64:61", "symbolAliases": [ { "foreign": { "id": 7500, "name": "IChainRegistryFacade", "nodeType": "Identifier", "overloadedDeclarations": [], "src": "275:20:61", "typeDescriptions": {} }, "nameLocation": "-1:-1:-1" } ], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 7502, "name": "IChainRegistryFacade", "nodeType": "IdentifierPath", "referencedDeclaration": 7497, "src": "374:20:61" }, "id": 7503, "nodeType": "InheritanceSpecifier", "src": "374:20:61" } ], "contractDependencies": [ 7497 ], "contractKind": "interface", "fullyImplemented": false, "id": 7550, "linearizedBaseContracts": [ 7550, 7497 ], "name": "IChainRegistryFacadeExt", "nameLocation": "343:23:61", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "IChainRegistryFacadeExt.ObjectState", "id": 7510, "members": [ { "id": 7504, "name": "Undefined", "nameLocation": "429:9:61", "nodeType": "EnumValue", "src": "429:9:61" }, { "id": 7505, "name": "Proposed", "nameLocation": "448:8:61", "nodeType": "EnumValue", "src": "448:8:61" }, { "id": 7506, "name": "Approved", "nameLocation": "466:8:61", "nodeType": "EnumValue", "src": "466:8:61" }, { "id": 7507, "name": "Suspended", "nameLocation": "484:9:61", "nodeType": "EnumValue", "src": "484:9:61" }, { "id": 7508, "name": "Archived", "nameLocation": "503:8:61", "nodeType": "EnumValue", "src": "503:8:61" }, { "id": 7509, "name": "Burned", "nameLocation": "521:6:61", "nodeType": "EnumValue", "src": "521:6:61" } ], "name": "ObjectState", "nameLocation": "407:11:61", "nodeType": "EnumDefinition", "src": "402:131:61" }, { "canonicalName": "IChainRegistryFacadeExt.NftInfo", "id": 7530, "members": [ { "constant": false, "id": 7512, "mutability": "mutable", "name": "id", "nameLocation": "572:2:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "565:9:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" }, "typeName": { "id": 7511, "name": "uint96", "nodeType": "ElementaryTypeName", "src": "565:6:61", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" } }, "visibility": "internal" }, { "constant": false, "id": 7514, "mutability": "mutable", "name": "chain", "nameLocation": "591:5:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "584:12:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes5", "typeString": "bytes5" }, "typeName": { "id": 7513, "name": "bytes5", "nodeType": "ElementaryTypeName", "src": "584:6:61", "typeDescriptions": { "typeIdentifier": "t_bytes5", "typeString": "bytes5" } }, "visibility": "internal" }, { "constant": false, "id": 7516, "mutability": "mutable", "name": "objectType", "nameLocation": "612:10:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "606:16:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 7515, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "606:5:61", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "visibility": "internal" }, { "constant": false, "id": 7519, "mutability": "mutable", "name": "state", "nameLocation": "644:5:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "632:17:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_ObjectState_$7510", "typeString": "enum IChainRegistryFacadeExt.ObjectState" }, "typeName": { "id": 7518, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 7517, "name": "ObjectState", "nodeType": "IdentifierPath", "referencedDeclaration": 7510, "src": "632:11:61" }, "referencedDeclaration": 7510, "src": "632:11:61", "typeDescriptions": { "typeIdentifier": "t_enum$_ObjectState_$7510", "typeString": "enum IChainRegistryFacadeExt.ObjectState" } }, "visibility": "internal" }, { "constant": false, "id": 7521, "mutability": "mutable", "name": "uri", "nameLocation": "666:3:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "659:10:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" }, "typeName": { "id": 7520, "name": "string", "nodeType": "ElementaryTypeName", "src": "659:6:61", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" }, { "constant": false, "id": 7523, "mutability": "mutable", "name": "data", "nameLocation": "685:4:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "679:10:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" }, "typeName": { "id": 7522, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "679:5:61", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" }, { "constant": false, "id": 7525, "mutability": "mutable", "name": "mintedIn", "nameLocation": "706:8:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "699:15:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 7524, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "699:6:61", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "visibility": "internal" }, { "constant": false, "id": 7527, "mutability": "mutable", "name": "updatedIn", "nameLocation": "731:9:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "724:16:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 7526, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "724:6:61", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "visibility": "internal" }, { "constant": false, "id": 7529, "mutability": "mutable", "name": "version", "nameLocation": "757:7:61", "nodeType": "VariableDeclaration", "scope": 7530, "src": "750:14:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint48", "typeString": "uint48" }, "typeName": { "id": 7528, "name": "uint48", "nodeType": "ElementaryTypeName", "src": "750:6:61", "typeDescriptions": { "typeIdentifier": "t_uint48", "typeString": "uint48" } }, "visibility": "internal" } ], "name": "NftInfo", "nameLocation": "547:7:61", "nodeType": "StructDefinition", "scope": 7550, "src": "540:231:61", "visibility": "public" }, { "functionSelector": "86ae3c7d", "id": 7541, "implemented": false, "kind": "function", "modifiers": [], "name": "registerComponent", "nameLocation": "787:17:61", "nodeType": "FunctionDefinition", "parameters": { "id": 7537, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7532, "mutability": "mutable", "name": "instanceId", "nameLocation": "822:10:61", "nodeType": "VariableDeclaration", "scope": 7541, "src": "814:18:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 7531, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "814:7:61", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 7534, "mutability": "mutable", "name": "componentId", "nameLocation": "850:11:61", "nodeType": "VariableDeclaration", "scope": 7541, "src": "842:19:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7533, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "842:7:61", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 7536, "mutability": "mutable", "name": "uri", "nameLocation": "885:3:61", "nodeType": "VariableDeclaration", "scope": 7541, "src": "871:17:61", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 7535, "name": "string", "nodeType": "ElementaryTypeName", "src": "871:6:61", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "804:90:61" }, "returnParameters": { "id": 7540, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7539, "mutability": "mutable", "name": "id", "nameLocation": "935:2:61", "nodeType": "VariableDeclaration", "scope": 7541, "src": "928:9:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" }, "typeName": { "id": 7538, "name": "uint96", "nodeType": "ElementaryTypeName", "src": "928:6:61", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" } }, "visibility": "internal" } ], "src": "927:11:61" }, "scope": 7550, "src": "778:161:61", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "functionSelector": "fb8bec0c", "id": 7549, "implemented": false, "kind": "function", "modifiers": [], "name": "getNftInfo", "nameLocation": "955:10:61", "nodeType": "FunctionDefinition", "parameters": { "id": 7544, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7543, "mutability": "mutable", "name": "id", "nameLocation": "973:2:61", "nodeType": "VariableDeclaration", "scope": 7549, "src": "966:9:61", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" }, "typeName": { "id": 7542, "name": "uint96", "nodeType": "ElementaryTypeName", "src": "966:6:61", "typeDescriptions": { "typeIdentifier": "t_uint96", "typeString": "uint96" } }, "visibility": "internal" } ], "src": "965:11:61" }, "returnParameters": { "id": 7548, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7547, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 7549, "src": "999:14:61", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_NftInfo_$7530_memory_ptr", "typeString": "struct IChainRegistryFacadeExt.NftInfo" }, "typeName": { "id": 7546, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 7545, "name": "NftInfo", "nodeType": "IdentifierPath", "referencedDeclaration": 7530, "src": "999:7:61" }, "referencedDeclaration": 7530, "src": "999:7:61", "typeDescriptions": { "typeIdentifier": "t_struct$_NftInfo_$7530_storage_ptr", "typeString": "struct IChainRegistryFacadeExt.NftInfo" } }, "visibility": "internal" } ], "src": "998:16:61" }, "scope": 7550, "src": "946:69:61", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 7551, "src": "333:684:61" } ], "src": "39:978:61" }, "bytecode": "", "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "compiler": { "evm_version": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "version": "0.8.2+commit.661d1103" }, "contractName": "IChainRegistryFacadeExt", "coverageMap": { "branches": {}, "statements": {} }, "dependencies": [ "IChainNftFacade", "IChainRegistryFacade" ], "deployedBytecode": "", "deployedSourceMap": "", "language": "Solidity", "natspec": { "kind": "dev", "methods": {}, "version": 1 }, "offset": [ 333, 1017 ], "opcodes": "", "pcMap": {}, "sha1": "aa5a11e23e2e761e40d1ab0b31e5c599d79d1a28", "source": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.2;\n\n/**\n * @dev local extension to better support get_setup, get_bundle\n * NOT automatically monitored against registry-contracts repo\n * consider to integrate into IChainRegistryFacade at a later stage\n */\n\nimport {IChainRegistryFacade} from \"./IChainRegistryFacade.sol\";\n\ninterface IChainRegistryFacadeExt is\n IChainRegistryFacade\n{\n\n enum ObjectState {\n Undefined,\n Proposed,\n Approved,\n Suspended,\n Archived,\n Burned\n }\n\n\n struct NftInfo {\n uint96 id;\n bytes5 chain;\n uint8 objectType;\n ObjectState state;\n string uri;\n bytes data;\n uint32 mintedIn;\n uint32 updatedIn;\n uint48 version;\n }\n\n\n function registerComponent(\n bytes32 instanceId,\n uint256 componentId,\n string memory uri\n )\n external\n returns(uint96 id);\n\n\n function getNftInfo(uint96 id) external view returns(NftInfo memory);\n}", "sourceMap": "", "sourcePath": "contracts/registry/IChainRegistryFacadeExt.sol", "type": "interface" }