UNPKG

@gooddollar/goodcontracts

Version:
895 lines (894 loc) 219 kB
{ "contractName": "UpgradeImplScheme", "abi": [ { "inputs": [ { "internalType": "contract Avatar", "name": "_avatar", "type": "address" }, { "internalType": "address", "name": "_newImpl", "type": "address" }, { "internalType": "address", "name": "_proxy", "type": "address" }, { "internalType": "address", "name": "_proxyAdmin", "type": "address" }, { "internalType": "bytes", "name": "_callData", "type": "bytes" }, { "internalType": "uint256", "name": "_timeLockHours", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "proxy", "type": "address" }, { "indexed": false, "internalType": "address", "name": "impl", "type": "address" } ], "name": "UpgradedImpl", "type": "event" }, { "inputs": [], "name": "avatar", "outputs": [ { "internalType": "contract Avatar", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "callData", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "controller", "outputs": [ { "internalType": "contract Controller", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "newImpl", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxy", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxyAdmin", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "timeLockEnd", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "timeLockHours", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "upgrade", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract Avatar\",\"name\":\"_avatar\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_newImpl\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_proxyAdmin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_timeLockHours\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"impl\",\"type\":\"address\"}],\"name\":\"UpgradedImpl\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"avatar\",\"outputs\":[{\"internalType\":\"contract Avatar\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"callData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contract Controller\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newImpl\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxy\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxyAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timeLockEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"timeLockHours\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"upgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/UpgradeImplScheme.sol\":\"UpgradeImplScheme\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/DAOStackInterfaces.sol\":{\"keccak256\":\"0xec80b6f0ad18a184cc23b1e172a0d6bf1f1bb5404b086fef56d5beafc46aad04\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0ccc376680a6b45520d6158996e9c0e634c05cb374de1c6a27796afa3356bdb2\",\"dweb:/ipfs/QmZEUGR5HjF4Me6U9oXsEBeJ5PTvXe1HNNiVjVZbmhYf29\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/UpgradeImplScheme.sol\":{\"keccak256\":\"0x002ee43c65eeeb0827647b5f457e841eb6b97ad514009e053c0de60be3419250\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://266da6dc0d0cd205687ebe942361af60115113ac2cb4ebdbfc9d442388152513\",\"dweb:/ipfs/QmbLaKtZVsrqGv2sY8PxM9DtARziGAQRWJ4LwnEvDPHiSn\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50604051610b4b380380610b4b833981810160405260c081101561003357600080fd5b815160208301516040808501516060860151608087018051935195979496929591949193928201928464010000000082111561006e57600080fd5b90830190602082018581111561008357600080fd5b825164010000000081118282018810171561009d57600080fd5b82525081516020918201929091019080838360005b838110156100ca5781810151838201526020016100b2565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b50604052602090810151600280546001600160a01b03808b166001600160a01b031992831617909255600080548c8416908316179055600380548a8416908316179055600480549289169290911691909117905584519093506101609250600591850190610208565b5060008054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156101af57600080fd5b505af11580156101c3573d6000803e3d6000fd5b505050506040513d60208110156101d957600080fd5b5051600180546001600160a01b0319166001600160a01b039092169190911790556006555061029b9350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061024957805160ff1916838001178555610276565b82800160010185558215610276579182015b8281111561027657825182559160200191906001019061025b565b50610282929150610286565b5090565b5b808211156102825760008155600101610287565b6108a1806102aa6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80635aef7de6116100665780635aef7de61461015b578063778d462314610163578063d55ec6971461016b578063ec55688914610175578063f77c47911461017d57610093565b806301207ac0146100985780633dddd0a5146100bc5780633e47158c146100d65780634e417a98146100de575b600080fd5b6100a0610185565b604080516001600160a01b039092168252519081900360200190f35b6100c4610194565b60408051918252519081900360200190f35b6100a061019a565b6100e66101a9565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610120578181015183820152602001610108565b50505050905090810190601f16801561014d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100a0610237565b6100c4610246565b61017361024c565b005b6100a061084d565b6100a061085c565b6002546001600160a01b031681565b60075481565b6004546001600160a01b031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561022f5780601f106102045761010080835404028352916020019161022f565b820191906000526020600020905b81548152906001019060200180831161021257829003601f168201915b505050505081565b6000546001600160a01b031681565b60065481565b60075461026057600654610e100242016007555b42600754101561026f5761084b565b60055460026000196101006001841615020190911604156105915760018054600454600354600280546040516001600160a01b039384166024820181815292851660448301819052606060648401908152600580546000199b811615610100029b909b01909a1695909504608484018190526000999887169863d1b7089a989097169692959194929360a401908490801561034b5780601f106103205761010080835404028352916020019161034b565b820191906000526020600020905b81548152906001019060200180831161032e57829003601f168201915b505060408051601f198184030181529181526020820180516001600160e01b0316639623609d60e01b17815260008054925160e08c901b6001600160e01b03191681526001600160a01b038b81166004830190815294166044820181905260648201839052608060248301908152865160848401528651969b50909950919750929550935060a490910191808383885b838110156103f35781810151838201526020016103db565b50505050905090810190601f1680156104205780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561044257600080fd5b505af1158015610456573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561047f57600080fd5b8151602083018051604051929492938301929190846401000000008211156104a657600080fd5b9083019060208201858111156104bb57600080fd5b82516401000000008111828201881017156104d557600080fd5b82525081516020918201929091019080838360005b838110156105025781810151838201526020016104ea565b50505050905090810190601f16801561052f5780820380516001836020036101000a031916815260200191505b506040525050505090508061058b576040805162461bcd60e51b815260206004820152601d60248201527f43616c6c696e672075706772616465416e6443616c6c206661696c6564000000604482015290519081900360640190fd5b506107f4565b60015460048054600354600254604080516001600160a01b03938416602480830191909152928416604480830191909152825180830382018152606492830184526020810180516001600160e01b031663266a23b160e21b1781526000805495516368db844d60e11b81529888169989018a815295881693890184905293880184905260809588019586528151608489015281519399969096169763d1b7089a979096919592948a9490939260a49092019190808383885b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156106b057600080fd5b505af11580156106c4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156106ed57600080fd5b81516020830180516040519294929383019291908464010000000082111561071457600080fd5b90830190602082018581111561072957600080fd5b825164010000000081118282018810171561074357600080fd5b82525081516020918201929091019080838360005b83811015610770578181015183820152602001610758565b50505050905090810190601f16801561079d5780820380516001836020036101000a031916815260200191505b50604052505050509050806107f2576040805162461bcd60e51b815260206004820152601660248201527510d85b1b1a5b99c81d5c19dc9859194819985a5b195960521b604482015290519081900360640190fd5b505b600354600254604080516001600160a01b039283168152905191909216917fc69e3537454c1af28229b342a18d794c932f252035cdb0856136d46a1520aac4919081900360200190a26000546001600160a01b0316ff5b565b6003546001600160a01b031681565b6001546001600160a01b03168156fea26469706673582212200690ada8ff2f5aa59eab995dfe6c62869f5819db721f7bc0d6358f8d69431d0064736f6c634300060c0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c80635aef7de6116100665780635aef7de61461015b578063778d462314610163578063d55ec6971461016b578063ec55688914610175578063f77c47911461017d57610093565b806301207ac0146100985780633dddd0a5146100bc5780633e47158c146100d65780634e417a98146100de575b600080fd5b6100a0610185565b604080516001600160a01b039092168252519081900360200190f35b6100c4610194565b60408051918252519081900360200190f35b6100a061019a565b6100e66101a9565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610120578181015183820152602001610108565b50505050905090810190601f16801561014d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100a0610237565b6100c4610246565b61017361024c565b005b6100a061084d565b6100a061085c565b6002546001600160a01b031681565b60075481565b6004546001600160a01b031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561022f5780601f106102045761010080835404028352916020019161022f565b820191906000526020600020905b81548152906001019060200180831161021257829003601f168201915b505050505081565b6000546001600160a01b031681565b60065481565b60075461026057600654610e100242016007555b42600754101561026f5761084b565b60055460026000196101006001841615020190911604156105915760018054600454600354600280546040516001600160a01b039384166024820181815292851660448301819052606060648401908152600580546000199b811615610100029b909b01909a1695909504608484018190526000999887169863d1b7089a989097169692959194929360a401908490801561034b5780601f106103205761010080835404028352916020019161034b565b820191906000526020600020905b81548152906001019060200180831161032e57829003601f168201915b505060408051601f198184030181529181526020820180516001600160e01b0316639623609d60e01b17815260008054925160e08c901b6001600160e01b03191681526001600160a01b038b81166004830190815294166044820181905260648201839052608060248301908152865160848401528651969b50909950919750929550935060a490910191808383885b838110156103f35781810151838201526020016103db565b50505050905090810190601f1680156104205780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561044257600080fd5b505af1158015610456573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561047f57600080fd5b8151602083018051604051929492938301929190846401000000008211156104a657600080fd5b9083019060208201858111156104bb57600080fd5b82516401000000008111828201881017156104d557600080fd5b82525081516020918201929091019080838360005b838110156105025781810151838201526020016104ea565b50505050905090810190601f16801561052f5780820380516001836020036101000a031916815260200191505b506040525050505090508061058b576040805162461bcd60e51b815260206004820152601d60248201527f43616c6c696e672075706772616465416e6443616c6c206661696c6564000000604482015290519081900360640190fd5b506107f4565b60015460048054600354600254604080516001600160a01b03938416602480830191909152928416604480830191909152825180830382018152606492830184526020810180516001600160e01b031663266a23b160e21b1781526000805495516368db844d60e11b81529888169989018a815295881693890184905293880184905260809588019586528151608489015281519399969096169763d1b7089a979096919592948a9490939260a49092019190808383885b83811015610661578181015183820152602001610649565b50505050905090810190601f16801561068e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156106b057600080fd5b505af11580156106c4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156106ed57600080fd5b81516020830180516040519294929383019291908464010000000082111561071457600080fd5b90830190602082018581111561072957600080fd5b825164010000000081118282018810171561074357600080fd5b82525081516020918201929091019080838360005b83811015610770578181015183820152602001610758565b50505050905090810190601f16801561079d5780820380516001836020036101000a031916815260200191505b50604052505050509050806107f2576040805162461bcd60e51b815260206004820152601660248201527510d85b1b1a5b99c81d5c19dc9859194819985a5b195960521b604482015290519081900360640190fd5b505b600354600254604080516001600160a01b039283168152905191909216917fc69e3537454c1af28229b342a18d794c932f252035cdb0856136d46a1520aac4919081900360200190a26000546001600160a01b0316ff5b565b6003546001600160a01b031681565b6001546001600160a01b03168156fea26469706673582212200690ada8ff2f5aa59eab995dfe6c62869f5819db721f7bc0d6358f8d69431d0064736f6c634300060c0033", "immutableReferences": {}, "sourceMap": "195:1640:2:-:0;;;639:346;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;639:346:2;;;;;;;;;;-1:-1:-1;639:346:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;639:346:2;;;;;;;796:7;:18;;-1:-1:-1;;;;;796:18:2;;;-1:-1:-1;;;;;;796:18:2;;;;;;;:7;818:16;;;;;;;;;;;838:5;:14;;;;;;;;;;;856:10;:24;;;;;;;;;;;;;;;884:20;;639:346;;-1:-1:-1;884:20:2;;-1:-1:-1;884:8:2;;:20;;;;:::i;:::-;;932:6;;;;;;;;-1:-1:-1;;;;;932:6:2;-1:-1:-1;;;;;932:12:2;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;932:14:2;908:10;:39;;-1:-1:-1;;;;;;908:39:2;-1:-1:-1;;;;;908:39:2;;;;;;;;;951:13;:30;-1:-1:-1;195:1640:2;;-1:-1:-1;;;;195:1640:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;195:1640:2;;;-1:-1:-1;195:1640:2;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "195:1640:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;338:22;;;:::i;:::-;;;;-1:-1:-1;;;;;338:22:2;;;;;;;;;;;;;;469:26;;;:::i;:::-;;;;;;;;;;;;;;;;386:25;;;:::i;414:21::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;284:20;;;:::i;438:28::-;;;:::i;1047:786::-;;;:::i;:::-;;363:20;;;:::i;307:28::-;;;:::i;338:22::-;;;-1:-1:-1;;;;;338:22:2;;:::o;469:26::-;;;;:::o;386:25::-;;;-1:-1:-1;;;;;386:25:2;;:::o;414:21::-;;;;;;;;;;;;;;;-1:-1:-1;;414:21:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;284:20::-;;;-1:-1:-1;;;;;284:20:2;;:::o;438:28::-;;;;:::o;1047:786::-;1081:11;;1077:89;;1137:13;;1153:7;1137:23;1118:15;:43;1104:11;:57;1077:89;1187:15;1173:11;;:29;1169:42;;;1204:7;;1169:42;1218:8;:15;;-1:-1:-1;;1218:15:2;;;;;;;;;;;:19;1214:537;;1262:10;;;1291;;1386:5;;1399:7;;;1308:121;;-1:-1:-1;;;;;1386:5:2;;;1308:121;;;;;;1399:7;;;1308:121;;;;;;;;;;;;;1414:8;1308:121;;-1:-1:-1;;1308:121:2;;;;1262:10;1308:121;;;;;;;;;;;;;;;;;;1245:7;;1262:10;;;;:22;;1291:10;;;;1386:5;;1399:7;;1414:8;;1308:121;;;1414:8;;1308:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1308:121:2;;;-1:-1:-1;;1308:121:2;;;;;;;;;;;;;;-1:-1:-1;;;;;1308:121:2;-1:-1:-1;;;1308:121:2;;;-1:-1:-1;1436:6:2;;1262:194;;;;;;-1:-1:-1;;;;;;1262:194:2;;;-1:-1:-1;;;;;1262:194:2;;;;;;;;;1436:6;;1262:194;;;;;;;;;;;;;;;;;;;;;;;;;;;1308:121;;-1:-1:-1;1436:6:2;;-1:-1:-1;;;;1262:194:2;;-1:-1:-1;1262:194:2;-1:-1:-1;1262:194:2;;;;;;;1308:121;-1:-1:-1;1262:194:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1262:194:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1262:194:2;;;;;;;;;;-1:-1:-1;1262:194:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1244:212;;;1469:2;1461:44;;;;;-1:-1:-1;;;1461:44:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1214:537;;;;1539:10;;1568;;;1650:5;;1663:7;;1585:92;;;-1:-1:-1;;;;;1650:5:2;;;1585:92;;;;;;;;1663:7;;;1585:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1585:92:2;-1:-1:-1;;;1585:92:2;;;1522:7;1684:6;;1539:165;;-1:-1:-1;;;1539:165:2;;1568:10;;;1539:165;;;;;;1684:6;;;1539:165;;;;;;;;;;;;;;;;;;;;;;;;;;;1522:7;;1539:10;;;;;:22;;1568:10;;1585:92;;1684:6;;1522:7;;1539:165;;;;;;;;1585:92;1539:165;;1585:92;1522:7;1539:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1539:165:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1539:165:2;;;;;;;;;;-1:-1:-1;1539:165:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1521:183;;;1717:2;1709:37;;;;;-1:-1:-1;;;1709:37:2;;;;;;;;;;;;-1:-1:-1;;;1709:37:2;;;;;;;;;;;;;;;1214:537;;1772:5;;1779:7;;1759:28;;;-1:-1:-1;;;;;1779:7:2;;;1759:28;;;;1772:5;;;;;1759:28;;;;;;;;;;1820:6;;-1:-1:-1;;;;;1820:6:2;1791:38;1047:786;:::o;363:20::-;;;-1:-1:-1;;;;;363:20:2;;:::o;307:28::-;;;-1:-1:-1;;;;;307:28:2;;:::o", "source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6;\n\nimport \"./DAOStackInterfaces.sol\";\n\n/* @title Scheme for upgrading an upgradable contract to new impl\n * see openzeppelin upgradables\n */\ncontract UpgradeImplScheme {\n\tevent UpgradedImpl(address indexed proxy, address impl);\n\n\tAvatar public avatar;\n\tController public controller;\n\taddress public newImpl;\n\taddress public proxy;\n\taddress public proxyAdmin;\n\tbytes public callData;\n\tuint256 public timeLockHours;\n\tuint256 public timeLockEnd;\n\n\t/* @dev constructor. Sets the factory address. Reverts if given address is null\n\t * @param _factory The address of the bridge factory\n\t */\n\tconstructor(\n\t\tAvatar _avatar,\n\t\taddress _newImpl,\n\t\taddress _proxy,\n\t\taddress _proxyAdmin,\n\t\tbytes memory _callData,\n\t\tuint256 _timeLockHours\n\t) public {\n\t\tnewImpl = _newImpl;\n\t\tavatar = _avatar;\n\t\tproxy = _proxy;\n\t\tproxyAdmin = _proxyAdmin;\n\t\tcallData = _callData;\n\t\tcontroller = Controller(avatar.owner());\n\t\ttimeLockHours = _timeLockHours;\n\t}\n\n\t/* @dev\n\t * calls upgrade on the proxyadmin contract\n\t */\n\tfunction upgrade() public {\n\t\tif (timeLockEnd == 0) {\n\t\t\ttimeLockEnd = block.timestamp + (timeLockHours * 1 hours);\n\t\t}\n\t\tif (timeLockEnd < block.timestamp) return;\n\t\tif (callData.length > 0) {\n\t\t\t(bool ok, ) =\n\t\t\t\tcontroller.genericCall(\n\t\t\t\t\tproxyAdmin,\n\t\t\t\t\tabi.encodeWithSignature(\n\t\t\t\t\t\t\"upgradeAndCall(address,address,bytes)\",\n\t\t\t\t\t\tproxy,\n\t\t\t\t\t\tnewImpl,\n\t\t\t\t\t\tcallData\n\t\t\t\t\t),\n\t\t\t\t\tavatar,\n\t\t\t\t\t0\n\t\t\t\t);\n\t\t\trequire(ok, \"Calling upgradeAndCall failed\");\n\t\t} else {\n\t\t\t(bool ok, ) =\n\t\t\t\tcontroller.genericCall(\n\t\t\t\t\tproxyAdmin,\n\t\t\t\t\tabi.encodeWithSignature(\n\t\t\t\t\t\t\"upgrade(address,address)\",\n\t\t\t\t\t\tproxy,\n\t\t\t\t\t\tnewImpl\n\t\t\t\t\t),\n\t\t\t\t\tavatar,\n\t\t\t\t\t0\n\t\t\t\t);\n\t\t\trequire(ok, \"Calling upgrade failed\");\n\t\t}\n\t\temit UpgradedImpl(proxy, newImpl);\n\t\tselfdestruct(payable(address(avatar)));\n\t}\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/UpgradeImplScheme.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/UpgradeImplScheme.sol", "exportedSymbols": { "UpgradeImplScheme": [ 713 ] }, "id": 714, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 553, "literals": [ "solidity", ">=", "0.6" ], "nodeType": "PragmaDirective", "src": "33:22:2" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/upgradables/contracts/DAOStackInterfaces.sol", "file": "./DAOStackInterfaces.sol", "id": 554, "nodeType": "ImportDirective", "scope": 714, "sourceUnit": 257, "src": "57:34:2", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 713, "linearizedBaseContracts": [ 713 ], "name": "UpgradeImplScheme", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 560, "name": "UpgradedImpl", "nodeType": "EventDefinition", "parameters": { "id": 559, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 556, "indexed": true, "mutability": "mutable", "name": "proxy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 560, "src": "244:21:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 555, "name": "address", "nodeType": "ElementaryTypeName", "src": "244:7:2", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 558, "indexed": false, "mutability": "mutable", "name": "impl", "nodeType": "VariableDeclaration", "overrides": null, "scope": 560, "src": "267:12:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 557, "name": "address", "nodeType": "ElementaryTypeName", "src": "267:7:2", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "243:37:2" }, "src": "225:56:2" }, { "constant": false, "functionSelector": "5aef7de6", "id": 562, "mutability": "mutable", "name": "avatar", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "284:20:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 561, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 12, "src": "284:6:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "f77c4791", "id": 564, "mutability": "mutable", "name": "controller", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "307:28:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Controller_$51", "typeString": "contract Controller" }, "typeName": { "contractScope": null, "id": 563, "name": "Controller", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 51, "src": "307:10:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Controller_$51", "typeString": "contract Controller" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "01207ac0", "id": 566, "mutability": "mutable", "name": "newImpl", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "338:22:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 565, "name": "address", "nodeType": "ElementaryTypeName", "src": "338:7:2", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "ec556889", "id": 568, "mutability": "mutable", "name": "proxy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "363:20:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 567, "name": "address", "nodeType": "ElementaryTypeName", "src": "363:7:2", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "3e47158c", "id": 570, "mutability": "mutable", "name": "proxyAdmin", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "386:25:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 569, "name": "address", "nodeType": "ElementaryTypeName", "src": "386:7:2", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "4e417a98", "id": 572, "mutability": "mutable", "name": "callData", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "414:21:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes" }, "typeName": { "id": 571, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "414:5:2", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "778d4623", "id": 574, "mutability": "mutable", "name": "timeLockHours", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "438:28:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 573, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "438:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "3dddd0a5", "id": 576, "mutability": "mutable", "name": "timeLockEnd", "nodeType": "VariableDeclaration", "overrides": null, "scope": 713, "src": "469:26:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 575, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "469:7:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 623, "nodeType": "Block", "src": "792:193:2", "statements": [ { "expression": { "argumentTypes": null, "id": 593, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 591, "name": "newImpl", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 566, "src": "796:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 592, "name": "_newImpl", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 580, "src": "806:8:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "796:18:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 594, "nodeType": "ExpressionStatement", "src": "796:18:2" }, { "expression": { "argumentTypes": null, "id": 597, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 595, "name": "avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 562, "src": "818:6:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 596, "name": "_avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 578, "src": "827:7:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" } }, "src": "818:16:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" } }, "id": 598, "nodeType": "ExpressionStatement", "src": "818:16:2" }, { "expression": { "argumentTypes": null, "id": 601, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 599, "name": "proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 568, "src": "838:5:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 600, "name": "_proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 582, "src": "846:6:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "838:14:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 602, "nodeType": "ExpressionStatement", "src": "838:14:2" }, { "expression": { "argumentTypes": null, "id": 605, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 603, "name": "proxyAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 570, "src": "856:10:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 604, "name": "_proxyAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 584, "src": "869:11:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "856:24:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 606, "nodeType": "ExpressionStatement", "src": "856:24:2" }, { "expression": { "argumentTypes": null, "id": 609, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 607, "name": "callData", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 572, "src": "884:8:2", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes storage ref" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 608, "name": "_callData", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 586, "src": "895:9:2", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "src": "884:20:2", "typeDescriptions": { "typeIdentifier": "t_bytes_storage", "typeString": "bytes storage ref" } }, "id": 610, "nodeType": "ExpressionStatement", "src": "884:20:2" }, { "expression": { "argumentTypes": null, "id": 617, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 611, "name": "controller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 564, "src": "908:10:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Controller_$51", "typeString": "contract Controller" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 613, "name": "avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 562, "src": "932:6:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12", "typeString": "contract Avatar" } }, "id": 614, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "owner", "nodeType": "MemberAccess", "referencedDeclaration": 11, "src": "932:12:2", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$_t_address_$", "typeString": "function () external returns (address)" } }, "id": 615, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "932:14:2", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 612, "name": "Controller", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 51, "src": "921:10:2", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Controller_$51_$", "typeString": "type(contract Controller)" } }, "id": 616, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "921:26:2", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_Controller_$51", "typeString": "contract Controller" } }, "src": "908:39:2", "typeDescriptions": { "typeIdentifier": "t_contract$_Controller_$51", "typeString": "contract Controller" } }, "id": 618, "nodeType": "ExpressionStatement", "src": "908:39:2" }, { "expression": { "argumentTypes": null,