UNPKG

@alice-network/zos-lib

Version:

JavaScript library for the ZeppelinOS smart contract platform

885 lines (884 loc) 134 kB
{ "contractName": "ImplementationDirectory", "abi": [ { "constant": true, "inputs": [], "name": "frozen", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "contractName", "type": "string" }, { "indexed": true, "name": "implementation", "type": "address" } ], "name": "ImplementationChanged", "type": "event" }, { "anonymous": false, "inputs": [], "name": "Frozen", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" } ], "name": "OwnershipRenounced", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "constant": false, "inputs": [], "name": "freeze", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "contractName", "type": "string" } ], "name": "getImplementation", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "contractName", "type": "string" }, { "name": "implementation", "type": "address" } ], "name": "setImplementation", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "contractName", "type": "string" } ], "name": "unsetImplementation", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d7b806100536000396000f30060806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461009357806306419fe5146100c257806330b7be291461014b57806362a5af3b146101b45780636b683896146101cb578063715018a6146102745780638da5cb5b1461028b578063f2fde38b146102e2575b600080fd5b34801561009f57600080fd5b506100a8610325565b604051808215151515815260200191505060405180910390f35b3480156100ce57600080fd5b50610149600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610338565b005b34801561015757600080fd5b506101b2600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610668565b005b3480156101c057600080fd5b506101c96108d0565b005b3480156101d757600080fd5b50610232600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610a1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028057600080fd5b50610289610ab4565b005b34801561029757600080fd5b506102a0610bb6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ee57600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bdb565b005b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561039357600080fd5b600260009054906101000a900460ff1615151561043e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b61044781610c42565b1515610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260428152602001807f43616e6e6f742073657420696d706c656d656e746174696f6e20696e2064697281526020017f6563746f727920776974682061206e6f6e2d636f6e747261637420616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b806001836040518082805190602001908083835b602083101515610540578051825260208201915060208101905060208303925061051b565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fd46d20dadc2a85a470fddb00aee90ec2cc1f302e7e2dbf61ffaef72527f3c659836040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062a57808201518184015260208101905061060f565b50505050905090810190601f1680156106575780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c357600080fd5b600260009054906101000a900460ff1615151561076e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b60006001826040518082805190602001908083835b6020831015156107a85780518252602082019150602081019050602083039250610783565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff167fd46d20dadc2a85a470fddb00aee90ec2cc1f302e7e2dbf61ffaef72527f3c659826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610893578082015181840152602081019050610878565b50505050905090810190601f1680156108c05780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092b57600080fd5b600260009054906101000a900460ff161515156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b6001600260006101000a81548160ff0219169083151502179055507fa8cab3d1893ed53071b052fafa843143492f25d1d6b0170d460789f7ab1954be60405160405180910390a1565b60006001826040518082805190602001908083835b602083101515610a595780518252602082019150602081019050602083039250610a34565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3657600080fd5b610c3f81610c55565b50565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e89c953a785a4c68b64fc87b517a5257dd527d769fa975356e55e38669de0d190029", "deployedBytecode": "0x60806040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461009357806306419fe5146100c257806330b7be291461014b57806362a5af3b146101b45780636b683896146101cb578063715018a6146102745780638da5cb5b1461028b578063f2fde38b146102e2575b600080fd5b34801561009f57600080fd5b506100a8610325565b604051808215151515815260200191505060405180910390f35b3480156100ce57600080fd5b50610149600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610338565b005b34801561015757600080fd5b506101b2600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610668565b005b3480156101c057600080fd5b506101c96108d0565b005b3480156101d757600080fd5b50610232600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610a1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028057600080fd5b50610289610ab4565b005b34801561029757600080fd5b506102a0610bb6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ee57600080fd5b50610323600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bdb565b005b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561039357600080fd5b600260009054906101000a900460ff1615151561043e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b61044781610c42565b1515610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260428152602001807f43616e6e6f742073657420696d706c656d656e746174696f6e20696e2064697281526020017f6563746f727920776974682061206e6f6e2d636f6e747261637420616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b806001836040518082805190602001908083835b602083101515610540578051825260208201915060208101905060208303925061051b565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fd46d20dadc2a85a470fddb00aee90ec2cc1f302e7e2dbf61ffaef72527f3c659836040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062a57808201518184015260208101905061060f565b50505050905090810190601f1680156106575780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c357600080fd5b600260009054906101000a900460ff1615151561076e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b60006001826040518082805190602001908083835b6020831015156107a85780518252602082019150602081019050602083039250610783565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff167fd46d20dadc2a85a470fddb00aee90ec2cc1f302e7e2dbf61ffaef72527f3c659826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610893578082015181840152602081019050610878565b50505050905090810190601f1680156108c05780820380516001836020036101000a031916815260200191505b509250505060405180910390a250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561092b57600080fd5b600260009054906101000a900460ff161515156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a81526020017f656e20696d706c656d656e746174696f6e206469726563746f7279000000000081525060400191505060405180910390fd5b6001600260006101000a81548160ff0219169083151502179055507fa8cab3d1893ed53071b052fafa843143492f25d1d6b0170d460789f7ab1954be60405160405180910390a1565b60006001826040518082805190602001908083835b602083101515610a595780518252602082019150602081019050602083039250610a34565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3657600080fd5b610c3f81610c55565b50565b600080823b905060008111915050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610c9157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e89c953a785a4c68b64fc87b517a5257dd527d769fa975356e55e38669de0d190029", "sourceMap": "314:2251:2:-;;;575:10:29;567:5;;:18;;;;;;;;;;;;;;;;;;314:2251:2;;;;;;", "deployedSourceMap": "314:2251:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;933:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;933:18:2;;;;;;;;;;;;;;;;;;;;;;;;;;;1883:346;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1883:346:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2371:192;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2371:192:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1297:92;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1297:92:2;;;;;;1556:125;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1556:125:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;827:111:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;827:111:29;;;;;;238:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;238:20:29;;;;;;;;;;;;;;;;;;;;;;;;;;;1100:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1100:103:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;933:18:2;;;;;;;;;;;;;:::o;1883:346::-;719:5:29;;;;;;;;;;;705:19;;:10;:19;;;697:28;;;;;;;;1098:6:2;;;;;;;;;;;1097:7;1089:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2000:39;2024:14;2000:23;:39::i;:::-;1992:118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2148:14;2116:15;2132:12;2116:29;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2116:29:2;;;;;;;;;;;;;;;;;;;;;;:46;;;;;;;;;;;;;;;;;;2209:14;2173:51;;;2195:12;2173:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;2173:51:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1883:346;;:::o;2371:192::-;719:5:29;;;;;;;;;;;705:19;;:10;:19;;;697:28;;;;;;;;1098:6:2;;;;;;;;;;;1097:7;1089:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2498:1;2458:15;2474:12;2458:29;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2458:29:2;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;;;;;;;;;;;;;2555:1;2511:47;;;2533:12;2511:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;2511:47:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2371:192;:::o;1297:92::-;719:5:29;;;;;;;;;;;705:19;;:10;:19;;;697:28;;;;;;;;1098:6:2;;;;;;;;;;;1097:7;1089:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1361:4;1352:6;;:13;;;;;;;;;;;;;;;;;;1376:8;;;;;;;;;;1297:92::o;1556:125::-;1625:7;1647:15;1663:12;1647:29;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1647:29:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1640:36;;1556:125;;;:::o;827:111:29:-;719:5;;;;;;;;;;;705:19;;:10;:19;;;697:28;;;;;;;;903:5;;;;;;;;;;;884:25;;;;;;;;;;;;931:1;915:5;;:18;;;;;;;;;;;;;;;;;;827:111::o;238:20::-;;;;;;;;;;;;;:::o;1100:103::-;719:5;;;;;;;;;;;705:19;;:10;:19;;;697:28;;;;;;;;1169:29;1188:9;1169:18;:29::i;:::-;1100:103;:::o;438:576:28:-;495:4;507:12;982:4;970:17;962:25;;1008:1;1001:4;:8;994:15;;438:576;;;;:::o;1338:171:29:-;1429:1;1408:23;;:9;:23;;;;1400:32;;;;;;;;1471:9;1443:38;;1464:5;;;;;;;;;;;1443:38;;;;;;;;;;;;1495:9;1487:5;;:17;;;;;;;;;;;;;;;;;;1338:171;:::o", "source": "pragma solidity ^0.4.24;\n\nimport \"./ImplementationProvider.sol\";\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport 'openzeppelin-solidity/contracts/AddressUtils.sol';\n\n/**\n * @title ImplementationDirectory\n * @dev Implementation provider that stores contract implementations in a mapping.\n */\ncontract ImplementationDirectory is ImplementationProvider, Ownable {\n /**\n * @dev Emitted when the implementation of a contract is changed.\n * @param contractName Name of the contract.\n * @param implementation Address of the added implementation.\n */\n event ImplementationChanged(string contractName, address indexed implementation);\n\n /**\n * @dev Emitted when the implementation directory is frozen.\n */\n event Frozen();\n\n /// @dev Mapping where the addresses of the implementations are stored.\n mapping (string => address) internal implementations;\n\n /// @dev Mutability state of the directory.\n bool public frozen;\n\n /**\n * @dev Modifier that allows functions to be called only before the contract is frozen.\n */\n modifier whenNotFrozen() {\n require(!frozen, \"Cannot perform action for a frozen implementation directory\");\n _;\n }\n\n /**\n * @dev Makes the directory irreversibly immutable.\n * It can only be called once, by the owner.\n */\n function freeze() onlyOwner whenNotFrozen public {\n frozen = true;\n emit Frozen();\n }\n\n /**\n * @dev Returns the implementation address of a contract.\n * @param contractName Name of the contract.\n * @return Address of the implementation.\n */\n function getImplementation(string contractName) public view returns (address) {\n return implementations[contractName];\n }\n\n /**\n * @dev Sets the address of the implementation of a contract in the directory.\n * @param contractName Name of the contract.\n * @param implementation Address of the implementation.\n */\n function setImplementation(string contractName, address implementation) public onlyOwner whenNotFrozen {\n require(AddressUtils.isContract(implementation), \"Cannot set implementation in directory with a non-contract address\");\n implementations[contractName] = implementation;\n emit ImplementationChanged(contractName, implementation);\n }\n\n /**\n * @dev Removes the address of a contract implementation from the directory.\n * @param contractName Name of the contract.\n */\n function unsetImplementation(string contractName) public onlyOwner whenNotFrozen {\n implementations[contractName] = address(0);\n emit ImplementationChanged(contractName, address(0));\n }\n}\n", "sourcePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/application/ImplementationDirectory.sol", "ast": { "absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/application/ImplementationDirectory.sol", "exportedSymbols": { "ImplementationDirectory": [ 425 ] }, "id": 426, "nodeType": "SourceUnit", "nodes": [ { "id": 310, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:2" }, { "absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/application/ImplementationProvider.sol", "file": "./ImplementationProvider.sol", "id": 311, "nodeType": "ImportDirective", "scope": 426, "sourceUnit": 436, "src": "26:38:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "file": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "id": 312, "nodeType": "ImportDirective", "scope": 426, "sourceUnit": 3143, "src": "65:63:2", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/AddressUtils.sol", "file": "openzeppelin-solidity/contracts/AddressUtils.sol", "id": 313, "nodeType": "ImportDirective", "scope": 426, "sourceUnit": 3057, "src": "129:58:2", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 314, "name": "ImplementationProvider", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 435, "src": "350:22:2", "typeDescriptions": { "typeIdentifier": "t_contract$_ImplementationProvider_$435", "typeString": "contract ImplementationProvider" } }, "id": 315, "nodeType": "InheritanceSpecifier", "src": "350:22:2" }, { "arguments": null, "baseName": { "contractScope": null, "id": 316, "name": "Ownable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3142, "src": "374:7:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Ownable_$3142", "typeString": "contract Ownable" } }, "id": 317, "nodeType": "InheritanceSpecifier", "src": "374:7:2" } ], "contractDependencies": [ 435, 3142 ], "contractKind": "contract", "documentation": "@title ImplementationDirectory\n@dev Implementation provider that stores contract implementations in a mapping.", "fullyImplemented": true, "id": 425, "linearizedBaseContracts": [ 425, 3142, 435 ], "name": "ImplementationDirectory", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": "@dev Emitted when the implementation of a contract is changed.\n@param contractName Name of the contract.\n@param implementation Address of the added implementation.", "id": 323, "name": "ImplementationChanged", "nodeType": "EventDefinition", "parameters": { "id": 322, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 319, "indexed": false, "name": "contractName", "nodeType": "VariableDeclaration", "scope": 323, "src": "605:19:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 318, "name": "string", "nodeType": "ElementaryTypeName", "src": "605:6:2", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 321, "indexed": true, "name": "implementation", "nodeType": "VariableDeclaration", "scope": 323, "src": "626:30:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 320, "name": "address", "nodeType": "ElementaryTypeName", "src": "626:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "604:53:2" }, "src": "577:81:2" }, { "anonymous": false, "documentation": "@dev Emitted when the implementation directory is frozen.", "id": 325, "name": "Frozen", "nodeType": "EventDefinition", "parameters": { "id": 324, "nodeType": "ParameterList", "parameters": [], "src": "749:2:2" }, "src": "737:15:2" }, { "constant": false, "id": 329, "name": "implementations", "nodeType": "VariableDeclaration", "scope": 425, "src": "830:52:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$", "typeString": "mapping(string => address)" }, "typeName": { "id": 328, "keyType": { "id": 326, "name": "string", "nodeType": "ElementaryTypeName", "src": "839:6:2", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "nodeType": "Mapping", "src": "830:27:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$", "typeString": "mapping(string => address)" }, "valueType": { "id": 327, "name": "address", "nodeType": "ElementaryTypeName", "src": "849:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 331, "name": "frozen", "nodeType": "VariableDeclaration", "scope": 425, "src": "933:18:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 330, "name": "bool", "nodeType": "ElementaryTypeName", "src": "933:4:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "body": { "id": 340, "nodeType": "Block", "src": "1083:97:2", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 335, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "1097:7:2", "subExpression": { "argumentTypes": null, "id": 334, "name": "frozen", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 331, "src": "1098:6:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "43616e6e6f7420706572666f726d20616374696f6e20666f7220612066726f7a656e20696d706c656d656e746174696f6e206469726563746f7279", "id": 336, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1106:61:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_d0d7da8818714c48acc93a148424f682c2ef689209261fbd5d6549d76596a141", "typeString": "literal_string \"Cannot perform action for a frozen implementation directory\"" }, "value": "Cannot perform action for a frozen implementation directory" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_d0d7da8818714c48acc93a148424f682c2ef689209261fbd5d6549d76596a141", "typeString": "literal_string \"Cannot perform action for a frozen implementation directory\"" } ], "id": 333, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3160, 3161 ], "referencedDeclaration": 3161, "src": "1089:7:2", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 337, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1089:79:2", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 338, "nodeType": "ExpressionStatement", "src": "1089:79:2" }, { "id": 339, "nodeType": "PlaceholderStatement", "src": "1174:1:2" } ] }, "documentation": "@dev Modifier that allows functions to be called only before the contract is frozen.", "id": 341, "name": "whenNotFrozen", "nodeType": "ModifierDefinition", "parameters": { "id": 332, "nodeType": "ParameterList", "parameters": [], "src": "1080:2:2" }, "src": "1058:122:2", "visibility": "internal" }, { "body": { "id": 355, "nodeType": "Block", "src": "1346:43:2", "statements": [ { "expression": { "argumentTypes": null, "id": 350, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 348, "name": "frozen", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 331, "src": "1352:6:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 349, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1361:4:2", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "1352:13:2", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 351, "nodeType": "ExpressionStatement", "src": "1352:13:2" }, { "eventCall": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 352, "name": "Frozen", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 325, "src": "1376:6:2", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 353, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1376:8:2", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 354, "nodeType": "EmitStatement", "src": "1371:13:2" } ] }, "documentation": "@dev Makes the directory irreversibly immutable.\nIt can only be called once, by the owner.", "id": 356, "implemented": true, "isConstructor": false, "isDeclaredConst": false, "modifiers": [ { "arguments": null, "id": 344, "modifierName": { "argumentTypes": null, "id": 343, "name": "onlyOwner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3090, "src": "1315:9:2", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1315:9:2" }, { "arguments": null, "id": 346, "modifierName": { "argumentTypes": null, "id": 345, "name": "whenNotFrozen", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 341, "src": "1325:13:2", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1325:13:2" } ], "name": "freeze", "nodeType": "FunctionDefinition", "parameters": { "id": 342, "nodeType": "ParameterList", "parameters": [], "src": "1312:2:2" }, "payable": false, "returnParameters": { "id": 347, "nodeType": "ParameterList", "parameters": [], "src": "1346:0:2" }, "scope": 425, "src": "1297:92:2", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 367, "nodeType": "Block", "src": "1634:47:2", "statements": [ { "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 363, "name": "implementations", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 329, "src": "1647:15:2", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_address_$", "typeString": "mapping(string memory => address)" } }, "id": 365, "indexExpression": { "argumentTypes": null, "id": 364, "name": "contractName", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 358, "src": "1663:12:2", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1647:29:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 362, "id": 366, "nodeType": "Return", "src": "1640:36:2" } ] }, "documentation": "@dev Returns the implementation address of a contract.\n@param contractName Name of the contract.\n@return Address of the implementation.", "id": 368, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getImplementation", "nodeType": "FunctionDefinition", "parameters": { "id": 359, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 358, "name": "contractName", "nodeType": "VariableDeclaration", "scope": 368, "src": "1583:19:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 357, "name": "string", "nodeType": "ElementaryTypeName", "src": "1583:6:2", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "1582:21:2" }, "payable": false, "returnParameters": { "id": 362, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 361, "name": "", "nodeType": "VariableDeclaration", "scope": 368, "src": "1625:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 360, "name": "address", "nodeType": "ElementaryTypeName", "src": "1625:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1624:9:2" }, "scope": 425, "src": "1556:125:2", "stateMutability": "view", "superFunction": 434, "visibility": "public" }, { "body": { "id": 398, "nodeType": "Block", "src": "1986:243:2", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 382, "name": "implementation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 372, "src": "2024:14:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address"