UNPKG

@kollateral/kollateral-contracts

Version:

715 lines 31.3 kB
{ "contractName": "KollateralAuth", "abi": [ { "inputs": [ { "internalType": "address", "name": "invokerAddress", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"invokerAddress\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/kbrizzle/code/kollateral/protocol/contracts/helpers/KollateralAuth.sol\":\"KollateralAuth\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol\":{\"keccak256\":\"0x9b4a67b1242134b64f557613259bfb51268d488cbc7b27cb2bc72c2f21f2b71f\",\"urls\":[\"bzz-raw://47bc3f04cddcbbe7a0373a074d50bbc1720ef7d73266532aab07474ea426ab43\",\"dweb:/ipfs/QmdPdivc8yXbmvDL1nG8xXHJF7qcfx6JqQoCFBv1ohDmdP\"]},\"/Users/kbrizzle/code/kollateral/protocol/contracts/Invoker.sol\":{\"keccak256\":\"0xc6c6e31ef43758db90ef5f21ff27519ea736f40088abf4b635ac29ba658eb784\",\"urls\":[\"bzz-raw://50968c9a288e9c44d61a1912fc3a44c57fc6c07ab564be99e1b3395c89583b0d\",\"dweb:/ipfs/QmNeN8jTLcwx31J6vyxdgS2e5uyToZNstWWQ28xAK6kEAU\"]},\"/Users/kbrizzle/code/kollateral/protocol/contracts/KToken.sol\":{\"keccak256\":\"0x748a3edca97018638a9ed18f3484977c124517f2261af8a7be3e1b8ee2fbe8a8\",\"urls\":[\"bzz-raw://9b5d42beda89cdf788e79cec733d96c4c4eaf896694948ee2c0fa5bb46d3972c\",\"dweb:/ipfs/Qmc9sGpHe3CTiEG9gzrdHtCgsuHBfAToTBGYmL8a4JL3J1\"]},\"/Users/kbrizzle/code/kollateral/protocol/contracts/helpers/KollateralAuth.sol\":{\"keccak256\":\"0xb465f5099217ea79d85bbc3675401f66228e749c16d3192307866efd178e4375\",\"urls\":[\"bzz-raw://90c6a584e167acab4c64af7a8aacabb1fdb220e3e754f5fa3fb1d4f360c4f27f\",\"dweb:/ipfs/QmVjffhEDTXZVPpdRHUWfViiUwcADkKvEDZVChSS4XGSFB\"]},\"/Users/kbrizzle/code/kollateral/protocol/contracts/interfaces/IInvoker.sol\":{\"keccak256\":\"0x8ad397e0611b31884a19bed7b27712530efb95ecf032fc8b8e0c25f4d3190569\",\"urls\":[\"bzz-raw://b23aa7fa654935abb0286ceac8eaf281589b866b75f0cc5b2d8971e1378e98c1\",\"dweb:/ipfs/QmVqYaxBEQVGfXUXVSFXaG6ZfFz5dEwkjDoMprZqbLAnyN\"]},\"/Users/kbrizzle/code/kollateral/protocol/contracts/interfaces/IKToken.sol\":{\"keccak256\":\"0x5b03d279a41856eef739da4ee50155425bbd95d99d80e4b910ec5abb91a99e40\",\"urls\":[\"bzz-raw://4ef7259b5604ef20e62b2503bc34d4052f99b85a18a80b072b8883bb7f9559de\",\"dweb:/ipfs/QmUsVQH9M3FoB4rpJGZJpZrbk2kcDFyRg5E5WfAKqHYkok\"]},\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0x90a3995645af7562d84b9d69363ffa5ae7217714ab61e951bf7bc450f40e4061\",\"urls\":[\"bzz-raw://216ef9d6b614db4eb46970b4e84903f2534a45572dd30a79f0041f1a5830f436\",\"dweb:/ipfs/QmNPrJ4MWKUAWzKXpUqeyKRUfosaoANZAqXgvepdrCwZAG\"]},\"@openzeppelin/contracts/access/Roles.sol\":{\"keccak256\":\"0xb002c378d7b82a101bd659c341518953ca0919d342c0a400196982c0e7e7bcdb\",\"urls\":[\"bzz-raw://00a788c4631466c220b385bdd100c571d24b2deccd657615cfbcef6cadf669a4\",\"dweb:/ipfs/QmTEwDbjJNxmMNCDMqtuou3dyM8Wtp8Q9NFvn7SAVM7Jf3\"]},\"@openzeppelin/contracts/access/roles/PauserRole.sol\":{\"keccak256\":\"0xd1b5c934bab36d753c22987ad98c7614cb50ebf641371a83c96f8138619d7c30\",\"urls\":[\"bzz-raw://69c4bb822caae3d1bfd38e81f03b6d618d4d83cbb8e9f8236d28e1c4fe1d0d81\",\"dweb:/ipfs/QmWamstbFhdySmocF2TSKYVLLZF24JG4aXMvHiRdWKv3RA\"]},\"@openzeppelin/contracts/lifecycle/Pausable.sol\":{\"keccak256\":\"0xd3e5a49edfb74654d122962cc60b917d1c60461e669a7262fd7aba201fac1260\",\"urls\":[\"bzz-raw://0307a3cae4df037aee16fb0b0d94849cb4d9b20d7d7182c185f3efac6d2caec0\",\"dweb:/ipfs/QmezTANBfrJmCvxfmfyfcfFGtbcUEUtoJCjfxKnAePiNoE\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"@openzeppelin/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0xecd8ab29d9a5771c3964d0cd1788c4a5098a0081b20fb275da850a22b1c59806\",\"urls\":[\"bzz-raw://696a75bc2c55407ce8251ccc7d19ecb1b7b2be1796a160a6524312babcc7e3d4\",\"dweb:/ipfs/QmQViKEp3y99h9uhRssE29TmjBKRnFMaoz3eJZ4eggggg2\"]},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0x65a4078c03875c25413a068ce9cfdd7e68a90f8786612d1189c89341e6e3b802\",\"urls\":[\"bzz-raw://45c0d95495b944fbb1aa09d900b0ab530903a432125ab8fddfa05064a7988991\",\"dweb:/ipfs/Qma2VeknkKA1THeubGzshWFk44BktXkXP1UKp9Un2uDSsu\"]},\"@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol\":{\"keccak256\":\"0x4a3a810b7ebe742e897e1fd428b3eeed2196d3acea58eaf9c566ed10d545d2ed\",\"urls\":[\"bzz-raw://28d03f328e19e4099d5013de0649afaeaabac1a614e130767ab1cb4aca9775b6\",\"dweb:/ipfs/Qmb9iW7yNuYehB2NfhRMs9TakqbLVQhBhmGMkaDZ5g1Eb4\"]},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]},\"@openzeppelin/contracts/utils/ReentrancyGuard.sol\":{\"keccak256\":\"0xe86fdc15fbc379ecf14d6aa4f51b87c0be8476e114e23c171b790a6717230655\",\"urls\":[\"bzz-raw://81905037f66d37ed211a4e3430af74f36e18b3a5d5b688e6d7d5ee199824a41a\",\"dweb:/ipfs/QmTcpgNKqLVRbcgNSUHazAbVf2bz5uh5mPkAijGeYW7Sqb\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.5.0;\n\nimport \"../Invoker.sol\";\n\ncontract KollateralAuth {\n address internal _invokerAddress;\n\n constructor (address invokerAddress) internal {\n _invokerAddress = invokerAddress;\n }\n\n modifier onlyInvoker() {\n require(msg.sender == _invokerAddress, \"KollateralAuth: not invoker\");\n _;\n }\n}\n", "sourcePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/helpers/KollateralAuth.sol", "ast": { "absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/helpers/KollateralAuth.sol", "exportedSymbols": { "KollateralAuth": [ 1641 ] }, "id": 1642, "nodeType": "SourceUnit", "nodes": [ { "id": 1615, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:6" }, { "absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/Invoker.sol", "file": "../Invoker.sol", "id": 1616, "nodeType": "ImportDirective", "scope": 1642, "sourceUnit": 422, "src": "25:24:6", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1641, "linearizedBaseContracts": [ 1641 ], "name": "KollateralAuth", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 1618, "name": "_invokerAddress", "nodeType": "VariableDeclaration", "scope": 1641, "src": "81:32:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1617, "name": "address", "nodeType": "ElementaryTypeName", "src": "81:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "body": { "id": 1627, "nodeType": "Block", "src": "166:49:6", "statements": [ { "expression": { "argumentTypes": null, "id": 1625, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 1623, "name": "_invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1618, "src": "176:15:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 1624, "name": "invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1620, "src": "194:14:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "176:32:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 1626, "nodeType": "ExpressionStatement", "src": "176:32:6" } ] }, "documentation": null, "id": 1628, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1621, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1620, "name": "invokerAddress", "nodeType": "VariableDeclaration", "scope": 1628, "src": "133:22:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1619, "name": "address", "nodeType": "ElementaryTypeName", "src": "133:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "132:24:6" }, "returnParameters": { "id": 1622, "nodeType": "ParameterList", "parameters": [], "src": "166:0:6" }, "scope": 1641, "src": "120:95:6", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1639, "nodeType": "Block", "src": "244:97:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 1634, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1631, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3596, "src": "262:3:6", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1632, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "262:10:6", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 1633, "name": "_invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1618, "src": "276:15:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "262:29:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4b6f6c6c61746572616c417574683a206e6f7420696e766f6b6572", "id": 1635, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "293:29:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a9d11766e335ae2cf5c92504e73c546d2cd4c44abcabc692a4a201c3c84770aa", "typeString": "literal_string \"KollateralAuth: not invoker\"" }, "value": "KollateralAuth: not invoker" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_a9d11766e335ae2cf5c92504e73c546d2cd4c44abcabc692a4a201c3c84770aa", "typeString": "literal_string \"KollateralAuth: not invoker\"" } ], "id": 1630, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3599, 3600 ], "referencedDeclaration": 3600, "src": "254:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "254:69:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1637, "nodeType": "ExpressionStatement", "src": "254:69:6" }, { "id": 1638, "nodeType": "PlaceholderStatement", "src": "333:1:6" } ] }, "documentation": null, "id": 1640, "name": "onlyInvoker", "nodeType": "ModifierDefinition", "parameters": { "id": 1629, "nodeType": "ParameterList", "parameters": [], "src": "241:2:6" }, "src": "221:120:6", "visibility": "internal" } ], "scope": 1642, "src": "51:292:6" } ], "src": "0:344:6" }, "legacyAST": { "absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/helpers/KollateralAuth.sol", "exportedSymbols": { "KollateralAuth": [ 1641 ] }, "id": 1642, "nodeType": "SourceUnit", "nodes": [ { "id": 1615, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:6" }, { "absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/Invoker.sol", "file": "../Invoker.sol", "id": 1616, "nodeType": "ImportDirective", "scope": 1642, "sourceUnit": 422, "src": "25:24:6", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1641, "linearizedBaseContracts": [ 1641 ], "name": "KollateralAuth", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 1618, "name": "_invokerAddress", "nodeType": "VariableDeclaration", "scope": 1641, "src": "81:32:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1617, "name": "address", "nodeType": "ElementaryTypeName", "src": "81:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "body": { "id": 1627, "nodeType": "Block", "src": "166:49:6", "statements": [ { "expression": { "argumentTypes": null, "id": 1625, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 1623, "name": "_invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1618, "src": "176:15:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 1624, "name": "invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1620, "src": "194:14:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "176:32:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 1626, "nodeType": "ExpressionStatement", "src": "176:32:6" } ] }, "documentation": null, "id": 1628, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1621, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1620, "name": "invokerAddress", "nodeType": "VariableDeclaration", "scope": 1628, "src": "133:22:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1619, "name": "address", "nodeType": "ElementaryTypeName", "src": "133:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "132:24:6" }, "returnParameters": { "id": 1622, "nodeType": "ParameterList", "parameters": [], "src": "166:0:6" }, "scope": 1641, "src": "120:95:6", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1639, "nodeType": "Block", "src": "244:97:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 1634, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1631, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3596, "src": "262:3:6", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1632, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "262:10:6", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 1633, "name": "_invokerAddress", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1618, "src": "276:15:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "262:29:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4b6f6c6c61746572616c417574683a206e6f7420696e766f6b6572", "id": 1635, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "293:29:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_a9d11766e335ae2cf5c92504e73c546d2cd4c44abcabc692a4a201c3c84770aa", "typeString": "literal_string \"KollateralAuth: not invoker\"" }, "value": "KollateralAuth: not invoker" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_a9d11766e335ae2cf5c92504e73c546d2cd4c44abcabc692a4a201c3c84770aa", "typeString": "literal_string \"KollateralAuth: not invoker\"" } ], "id": 1630, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3599, 3600 ], "referencedDeclaration": 3600, "src": "254:7:6", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "254:69:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1637, "nodeType": "ExpressionStatement", "src": "254:69:6" }, { "id": 1638, "nodeType": "PlaceholderStatement", "src": "333:1:6" } ] }, "documentation": null, "id": 1640, "name": "onlyInvoker", "nodeType": "ModifierDefinition", "parameters": { "id": 1629, "nodeType": "ParameterList", "parameters": [], "src": "241:2:6" }, "src": "221:120:6", "visibility": "internal" } ], "scope": 1642, "src": "51:292:6" } ], "src": "0:344:6" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.20", "updatedAt": "2020-02-01T23:51:00.342Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }