UNPKG

@gooddollar/goodcontracts

Version:
833 lines 156 kB
{ "contractName": "ChangeHomeBridge", "abi": [ { "inputs": [ { "internalType": "contract Avatar", "name": "_avatar", "type": "address" }, { "internalType": "address", "name": "_bridgeContract", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "_homeBridge", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_homeValidators", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_token", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_blockNumber", "type": "uint256" } ], "name": "HomeBridgeDeployed", "type": "event" }, { "constant": true, "inputs": [], "name": "bridgeContract", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "setBridge", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract Avatar\",\"name\":\"_avatar\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_bridgeContract\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_homeBridge\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_homeValidators\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"HomeBridgeDeployed\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"bridgeContract\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"setBridge\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/dao/schemes/proposals/ChangeHomeBridge.sol\":\"ChangeHomeBridge\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/dao/schemes/proposals/ChangeHomeBridge.sol\":{\"keccak256\":\"0x0b406746a1dd101d71ad134ad7427fa7e6ce5deb73631fc6de673fcce9e1494e\",\"urls\":[\"bzz-raw://704aa70b23b49680b7d1ea3bb54ea39f42d6f197d30ef70ac35cf69a225582a0\",\"dweb:/ipfs/QmZZWR7ksqsnkzGb1yCCVSVzGcYdcmxeCXxJwTAFWaxWmv\"]},\"@daostack/arc/contracts/controller/Avatar.sol\":{\"keccak256\":\"0x4e4fb9d3bc21f42fbfc6a01e9f8aa483a59e9f447b0d604f55b587a81ec09ef4\",\"urls\":[\"bzz-raw://9d3c1c7575cf6075ea1d89921f09b9b8e322b208dacaf0446cd4f64506c999f0\",\"dweb:/ipfs/QmVGDDHAR2ByuQpbgV7BBKXGEAcbaWvejpEZYzHgaagBFK\"]},\"@daostack/arc/contracts/controller/ControllerInterface.sol\":{\"keccak256\":\"0x933e92612c90f292c7b59908958b003f1a13d90b97bed0572b566353c20974dc\",\"urls\":[\"bzz-raw://ce1fcf85b744fcce2dbd4205e3943e9b4ec36a5f0330d4bbf61e65f1a3e0e470\",\"dweb:/ipfs/QmUWiLkBDdekhpy93nTzBtxDHL6yNh6sTUM9G8VbsHcBzy\"]},\"@daostack/arc/contracts/controller/DAOToken.sol\":{\"keccak256\":\"0x9b213e4e3ceeffcfc1c962a43b70b8d763d8091a2dd713fc1989b97bb68786e6\",\"urls\":[\"bzz-raw://51d1d6e85fd90f45395a16b7a3c703c4636e836041f2a13f806e4222ef2e59c1\",\"dweb:/ipfs/QmQjeCeFf7TJzsYjT5scyZUDDixBA8Yy8YppgBuxcKPDnP\"]},\"@daostack/arc/contracts/globalConstraints/GlobalConstraintInterface.sol\":{\"keccak256\":\"0xc006c4591ec10b845a56e13f6791db2c428610953034686d52b2a934b6c8f36f\",\"urls\":[\"bzz-raw://19495cd88280e54d7ddcd043ffeff75e6d3777a0c42debcd61cae448e9497ea0\",\"dweb:/ipfs/QmYxWz7CgFmmddrcVXJKfob5Ktwykc2imNVUwLSR5WR8bJ\"]},\"@daostack/arc/contracts/libs/SafeERC20.sol\":{\"keccak256\":\"0xf6727d432f67046145b078f40c1cc4f6be7b0d12a6678ecaf457edf7550d244c\",\"urls\":[\"bzz-raw://5dba7734c4fed446c084a707761cbc66ba22b8b93ef53c8d4a22a76b6e271690\",\"dweb:/ipfs/QmP2VpPKUqLh4ZZs6LaxHVpCN1zCmiorygL9bMub4mbYCw\"]},\"@daostack/infra/contracts/Reputation.sol\":{\"keccak256\":\"0x3d226dac0fe7d758f0287fb28bc25fcec1f69d19888ae3a550fa49856d61c482\",\"urls\":[\"bzz-raw://8856852c8fe0ba1c9aab326f0a9a6e7f31a238de2778fa5188e6fc399f7eb352\",\"dweb:/ipfs/QmVH4ppR9Dk7v8yxaSgeArdMv9gBBVoQxEf4E3UsqQ4rY2\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0x980de387a1a020a498f53d00f89fecebb12c949a17e8f160093c0303ede2b786\",\"urls\":[\"bzz-raw://f07a2c393caa85f62f0aaa461e3edd50aa59371d4209778ba0558d7f8b4b856c\",\"dweb:/ipfs/QmeN3ZiYGSjCnQFeYaJNgoXjF9eDue1g3e9pqManRkeBtV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xba431353cb4fe70777ac026231eb5468e41aa1e81240a2b8136917acc5fff4dc\",\"urls\":[\"bzz-raw://f40c91ca270bdc9b156f339081a0fc2bbcf73cf5f62b8c73ba555df753ff6619\",\"dweb:/ipfs/QmT8y2VVjGaFdGphpcXrgvdPi2EgF9LuCDgJiJ89LvpFRV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol\":{\"keccak256\":\"0xa3e68fd7f987c8fbdaf4867d428a69a15f3cf2f69709a5b0a0fbef750b0e6fbc\",\"urls\":[\"bzz-raw://50b1ff986d3b2793850a66c8429d9886fdfb134b1509b3e98714e3e2a71e24f5\",\"dweb:/ipfs/QmSQBYPeY9tbR3ciGRNQqvcWKnNiuxtVMq2MsPWpLwuGGm\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5060405161079c38038061079c8339818101604052604081101561003357600080fd5b5080516020909101516001600160a01b038116610097576040805162461bcd60e51b815260206004820152601860248201527f466163746f7279206d757374206e6f74206265206e756c6c0000000000000000604482015290519081900360640190fd5b600080546001600160a01b039283166001600160a01b031991821617909155600180549390921692169190911790556106c7806100d56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b886b2b01461003b578063cd59658314610045575b600080fd5b610043610069565b005b61004d610683565b604080516001600160a01b039092168252519081900360200190f35b60015460408051638da5cb5b60e01b815290516000926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d60208110156100d857600080fd5b505160015460408051631c2eb17b60e31b815290519293506000926001600160a01b038086169363d1b7089a9391169163e1758bd891600480820192602092909190829003018186803b15801561012e57600080fd5b505afa158015610142573d6000803e3d6000fd5b505050506040513d602081101561015857600080fd5b505160008054604080516001600160a01b03928316602480830191909152825180830382018152604492830184526020810180516001600160e01b0316634c1d96ab60e11b178152600154945160e08a901b6001600160e01b031916815286891660048201908152959096169386018490526064860187905260809286019283528151608487015281519196939593949360a40191808383885b8381101561020a5781810151838201526020016101f2565b50505050905090810190601f1680156102375780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561025957600080fd5b505af115801561026d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561029657600080fd5b8151602083018051604051929492938301929190846401000000008211156102bd57600080fd5b9083019060208201858111156102d257600080fd5b82516401000000008111828201881017156102ec57600080fd5b82525081516020918201929091019080838360005b83811015610319578181015183820152602001610301565b50505050905090810190601f1680156103465780820380516001836020036101000a031916815260200191505b50604052505050509050806103a2576040805162461bcd60e51b815260206004820152601e60248201527f416464696e6720427269646765206173206d696e746572206661696c65640000604482015290519081900360640190fd5b6000826001600160a01b031663d1b7089a600160009054906101000a90046001600160a01b03166001600160a01b031663e1758bd86040518163ffffffff1660e01b815260040160206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d602081101561042b57600080fd5b505160008054604080516001600160a01b03928316602480830191909152825180830382018152604492830184526020810180516001600160e01b031663059367b360e11b178152600154945160e08a901b6001600160e01b031916815286891660048201908152959096169386018490526064860187905260809286019283528151608487015281519196939593949360a40191808383885b838110156104dd5781810151838201526020016104c5565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561052c57600080fd5b505af1158015610540573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561056957600080fd5b81516020830180516040519294929383019291908464010000000082111561059057600080fd5b9083019060208201858111156105a557600080fd5b82516401000000008111828201881017156105bf57600080fd5b82525081516020918201929091019080838360005b838110156105ec5781810151838201526020016105d4565b50505050905090810190601f1680156106195780820380516001836020036101000a031916815260200191505b5060405250505050905080610675576040805162461bcd60e51b815260206004820181905260248201527f43616c6c696e6720736574427269646765436f6e7472616374206661696c6564604482015290519081900360640190fd5b6001546001600160a01b0316ff5b6000546001600160a01b03168156fea265627a7a723158201180f882592423eef2903f3b5a94bbb8379e9fc266120e5523700cba3a8aa15e64736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b886b2b01461003b578063cd59658314610045575b600080fd5b610043610069565b005b61004d610683565b604080516001600160a01b039092168252519081900360200190f35b60015460408051638da5cb5b60e01b815290516000926001600160a01b031691638da5cb5b916004808301926020929190829003018186803b1580156100ae57600080fd5b505afa1580156100c2573d6000803e3d6000fd5b505050506040513d60208110156100d857600080fd5b505160015460408051631c2eb17b60e31b815290519293506000926001600160a01b038086169363d1b7089a9391169163e1758bd891600480820192602092909190829003018186803b15801561012e57600080fd5b505afa158015610142573d6000803e3d6000fd5b505050506040513d602081101561015857600080fd5b505160008054604080516001600160a01b03928316602480830191909152825180830382018152604492830184526020810180516001600160e01b0316634c1d96ab60e11b178152600154945160e08a901b6001600160e01b031916815286891660048201908152959096169386018490526064860187905260809286019283528151608487015281519196939593949360a40191808383885b8381101561020a5781810151838201526020016101f2565b50505050905090810190601f1680156102375780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561025957600080fd5b505af115801561026d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561029657600080fd5b8151602083018051604051929492938301929190846401000000008211156102bd57600080fd5b9083019060208201858111156102d257600080fd5b82516401000000008111828201881017156102ec57600080fd5b82525081516020918201929091019080838360005b83811015610319578181015183820152602001610301565b50505050905090810190601f1680156103465780820380516001836020036101000a031916815260200191505b50604052505050509050806103a2576040805162461bcd60e51b815260206004820152601e60248201527f416464696e6720427269646765206173206d696e746572206661696c65640000604482015290519081900360640190fd5b6000826001600160a01b031663d1b7089a600160009054906101000a90046001600160a01b03166001600160a01b031663e1758bd86040518163ffffffff1660e01b815260040160206040518083038186803b15801561040157600080fd5b505afa158015610415573d6000803e3d6000fd5b505050506040513d602081101561042b57600080fd5b505160008054604080516001600160a01b03928316602480830191909152825180830382018152604492830184526020810180516001600160e01b031663059367b360e11b178152600154945160e08a901b6001600160e01b031916815286891660048201908152959096169386018490526064860187905260809286019283528151608487015281519196939593949360a40191808383885b838110156104dd5781810151838201526020016104c5565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561052c57600080fd5b505af1158015610540573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561056957600080fd5b81516020830180516040519294929383019291908464010000000082111561059057600080fd5b9083019060208201858111156105a557600080fd5b82516401000000008111828201881017156105bf57600080fd5b82525081516020918201929091019080838360005b838110156105ec5781810151838201526020016105d4565b50505050905090810190601f1680156106195780820380516001836020036101000a031916815260200191505b5060405250505050905080610675576040805162461bcd60e51b815260206004820181905260248201527f43616c6c696e6720736574427269646765436f6e7472616374206661696c6564604482015290519081900360640190fd5b6001546001600160a01b0316ff5b6000546001600160a01b03168156fea265627a7a723158201180f882592423eef2903f3b5a94bbb8379e9fc266120e5523700cba3a8aa15e64736f6c63430005100032", "sourceMap": "200:1567:39:-;;;613:211;8:9:-1;5:2;;;30:1;27;20:12;5:2;613:211:39;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;613:211:39;;;;;;;-1:-1:-1;;;;;691:29:39;;683:66;;;;;-1:-1:-1;;;683:66:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;759:14;:32;;-1:-1:-1;;;;;759:32:39;;;-1:-1:-1;;;;;;759:32:39;;;;;;;;801:16;;;;;;;;;;;;;;200:1567;;;;;;", "deployedSourceMap": "200:1567:39:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;200:1567:39;;;;;;;;;;;;;;;;;;;;;;;;1059:706;;;:::i;:::-;;409:29;;;:::i;:::-;;;;-1:-1:-1;;;;;409:29:39;;;;;;;;;;;;;;1059:706;1150:6;;:14;;;-1:-1:-1;;;1150:14:39;;;;1097:30;;-1:-1:-1;;;;;1150:6:39;;:12;;:14;;;;;;;;;;;;;;:6;:14;;;5:2:-1;;;;30:1;27;20:12;5:2;1150:14:39;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1150:14:39;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1150:14:39;1233:6;;:20;;;-1:-1:-1;;;1233:20:39;;;;1150:14;;-1:-1:-1;1176:7:39;;-1:-1:-1;;;;;1189:22:39;;;;;;1233:6;;;:18;;:20;;;;;1150:14;;1233:20;;;;;;;;:6;:20;;;5:2:-1;;;;30:1;27;20:12;5:2;1233:20:39;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1233:20:39;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1233:20:39;1314:14;;;1268:61;;;-1:-1:-1;;;;;1314:14:39;;;1268:61;;;;;;;;;;26:21:-1;;;22:32;;6:49;;1268:61:39;;;;;;1233:20;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;1314:14:39;1343:6;1189:185;;;;;;-1:-1:-1;;;;;;1189:185:39;;;;;;;;;;;;1343:6;;;;1189:185;;;;;;;;;;;;;;;;;;;;;;;;;;;1268:61;;1343:6;;1314:14;;1189:185;;;;;;25:18:-1;1314:14:39;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1189:185:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1189:185:39;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1189:185:39;;;;;;39:16:-1;36:1;17:17;2:54;101:4;1189:185:39;80:15:-1;;;-1:-1;;76:31;65:43;;120:4;113:20;;;5:11;;2:2;;;29:1;26;19:12;2:2;1189:185:39;;;;;;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;213:10;;261:11;244:29;;285:43;;;282:58;-1:-1;233:115;230:2;;;361:1;358;351:12;230:2;372:25;;-1:-1;1189:185:39;;420:4:-1;411:14;;;;1189:185:39;;;;;411:14:-1;1189:185:39;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1189:185:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1175:199;;;1393:2;1385:45;;;;;-1:-1:-1;;;1385:45:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;1442:13;1461:10;-1:-1:-1;;;;;1461:22:39;;1505:6;;;;;;;;;-1:-1:-1;;;;;1505:6:39;-1:-1:-1;;;;;1505:18:39;;:20;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1505:20:39;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1505:20:39;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1505:20:39;1594:14;;;1540:69;;;-1:-1:-1;;;;;1594:14:39;;;1540:69;;;;;;;;;;26:21:-1;;;22:32;;6:49;;1540:69:39;;;;;;1505:20;25:18:-1;;61:17;;-1:-1;;;;;182:15;-1:-1;;;179:29;160:49;;1594:14:39;1623:6;1461:193;;;;;;-1:-1:-1;;;;;;1461:193:39;;;;;;;;;;;;1623:6;;;;1461:193;;;;;;;;;;;;;;;;;;;;;;;;;;;1540:69;;1623:6;;1594:14;;1461:193;;;;;;25:18:-1;1594:14:39;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1461:193:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1461:193:39;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1461:193:39;;;;;;39:16:-1;36:1;17:17;2:54;101:4;1461:193:39;80:15:-1;;;-1:-1;;76:31;65:43;;120:4;113:20;;;5:11;;2:2;;;29:1;26;19:12;2:2;1461:193:39;;;;;;;;;;;;;;;;;;;19:11:-1;11:20;;8:2;;;44:1;41;34:12;8:2;62:21;;;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;213:10;;261:11;244:29;;285:43;;;282:58;-1:-1;233:115;230:2;;;361:1;358;351:12;230:2;372:25;;-1:-1;1461:193:39;;420:4:-1;411:14;;;;1461:193:39;;;;;411:14:-1;1461:193:39;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;1461:193:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1441:213;;;1673:8;1665:53;;;;;-1:-1:-1;;;1665:53:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1750:6;;-1:-1:-1;;;;;1750:6:39;1729:29;409;;;-1:-1:-1;;;;;409:29:39;;:::o", "source": "pragma solidity >0.5.4;\n\nimport \"@daostack/arc/contracts/controller/Avatar.sol\";\nimport \"@daostack/arc/contracts/controller/ControllerInterface.sol\";\n\n/* @title Scheme for switching to AMB bridge\n */\ncontract ChangeHomeBridge {\n event HomeBridgeDeployed(\n address indexed _homeBridge,\n address indexed _homeValidators,\n address indexed _token,\n uint256 _blockNumber\n );\n\n address public bridgeContract;\n Avatar avatar;\n\n /* @dev constructor. Sets the factory address. Reverts if given address is null\n * @param _factory The address of the bridge factory\n */\n constructor(Avatar _avatar, address _bridgeContract) public {\n require(_bridgeContract != address(0), \"Factory must not be null\");\n bridgeContract = _bridgeContract;\n avatar = _avatar;\n }\n\n /* @dev Adds the bridge address to minters, deploys the home bridge on\n * current network, and then self-destructs, transferring any ether on the\n * contract to the avatar. Reverts if scheme is not registered\n */\n function setBridge() public {\n ControllerInterface controller = ControllerInterface(avatar.owner());\n (bool ok, ) = controller.genericCall(\n address(avatar.nativeToken()),\n abi.encodeWithSignature(\"addMinter(address)\", bridgeContract),\n avatar,\n 0\n );\n\n require(ok, \"Adding Bridge as minter failed\");\n\n (bool deployOk, ) = controller.genericCall(\n address(avatar.nativeToken()),\n abi.encodeWithSignature(\"setBridgeContract(address)\", bridgeContract),\n avatar,\n 0\n );\n\n require(deployOk, \"Calling setBridgeContract failed\");\n\n selfdestruct(address(avatar));\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/dao/schemes/proposals/ChangeHomeBridge.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/stakingModel/contracts/dao/schemes/proposals/ChangeHomeBridge.sol", "exportedSymbols": { "ChangeHomeBridge": [ 11490 ] }, "id": 11491, "nodeType": "SourceUnit", "nodes": [ { "id": 11384, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:39" }, { "absolutePath": "@daostack/arc/contracts/controller/Avatar.sol", "file": "@daostack/arc/contracts/controller/Avatar.sol", "id": 11385, "nodeType": "ImportDirective", "scope": 11491, "sourceUnit": 12706, "src": "25:55:39", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@daostack/arc/contracts/controller/ControllerInterface.sol", "file": "@daostack/arc/contracts/controller/ControllerInterface.sol", "id": 11386, "nodeType": "ImportDirective", "scope": 11491, "sourceUnit": 14395, "src": "81:68:39", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 11490, "linearizedBaseContracts": [ 11490 ], "name": "ChangeHomeBridge", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 11396, "name": "HomeBridgeDeployed", "nodeType": "EventDefinition", "parameters": { "id": 11395, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11388, "indexed": true, "name": "_homeBridge", "nodeType": "VariableDeclaration", "scope": 11396, "src": "266:27:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11387, "name": "address", "nodeType": "ElementaryTypeName", "src": "266:7:39", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11390, "indexed": true, "name": "_homeValidators", "nodeType": "VariableDeclaration", "scope": 11396, "src": "303:31:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11389, "name": "address", "nodeType": "ElementaryTypeName", "src": "303:7:39", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11392, "indexed": true, "name": "_token", "nodeType": "VariableDeclaration", "scope": 11396, "src": "344:22:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11391, "name": "address", "nodeType": "ElementaryTypeName", "src": "344:7:39", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11394, "indexed": false, "name": "_blockNumber", "nodeType": "VariableDeclaration", "scope": 11396, "src": "376:20:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 11393, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "376:7:39", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "256:146:39" }, "src": "232:171:39" }, { "constant": false, "id": 11398, "name": "bridgeContract", "nodeType": "VariableDeclaration", "scope": 11490, "src": "409:29:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11397, "name": "address", "nodeType": "ElementaryTypeName", "src": "409:7:39", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 11400, "name": "avatar", "nodeType": "VariableDeclaration", "scope": 11490, "src": "444:13:39", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 11399, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 12705, "src": "444:6:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "value": null, "visibility": "internal" }, { "body": { "id": 11424, "nodeType": "Block", "src": "673:151:39", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 11412, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 11408, "name": "_bridgeContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11404, "src": "691:15:39", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 11410, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "718:1:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 11409, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "710:7:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 11411, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "710:10:39", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "691:29:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "466163746f7279206d757374206e6f74206265206e756c6c", "id": 11413, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "722:26:39", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_dd66b900ac570a0000d18bfb0b967614b578f0c4430d71a4383331d6ce7106ca", "typeString": "literal_string \"Factory must not be null\"" }, "value": "Factory must not be null" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_dd66b900ac570a0000d18bfb0b967614b578f0c4430d71a4383331d6ce7106ca", "typeString": "literal_string \"Factory must not be null\"" } ], "id": 11407, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "683:7:39", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 11414, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "683:66:39", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 11415, "nodeType": "ExpressionStatement", "src": "683:66:39" }, { "expression": { "argumentTypes": null, "id": 11418, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11416, "name": "bridgeContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11398, "src": "759:14:39", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11417, "name": "_bridgeContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11404, "src": "776:15:39", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "759:32:39", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 11419, "nodeType": "ExpressionStatement", "src": "759:32:39" }, { "expression": { "argumentTypes": null, "id": 11422, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 11420, "name": "avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11400, "src": "801:6:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 11421, "name": "_avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11402, "src": "810:7:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "src": "801:16:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "id": 11423, "nodeType": "ExpressionStatement", "src": "801:16:39" } ] }, "documentation": null, "id": 11425, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 11405, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 11402, "name": "_avatar", "nodeType": "VariableDeclaration", "scope": 11425, "src": "625:14:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" }, "typeName": { "contractScope": null, "id": 11401, "name": "Avatar", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 12705, "src": "625:6:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 11404, "name": "_bridgeContract", "nodeType": "VariableDeclaration", "scope": 11425, "src": "641:23:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 11403, "name": "address", "nodeType": "ElementaryTypeName", "src": "641:7:39", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "624:41:39" }, "returnParameters": { "id": 11406, "nodeType": "ParameterList", "parameters": [], "src": "673:0:39" }, "scope": 11490, "src": "613:211:39", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 11488, "nodeType": "Block", "src": "1087:678:39", "statements": [ { "assignments": [ 11429 ], "declarations": [ { "constant": false, "id": 11429, "name": "controller", "nodeType": "VariableDeclaration", "scope": 11488, "src": "1097:30:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_ControllerInterface_$14394", "typeString": "contract ControllerInterface" }, "typeName": { "contractScope": null, "id": 11428, "name": "ControllerInterface", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 14394, "src": "1097:19:39", "typeDescriptions": { "typeIdentifier": "t_contract$_ControllerInterface_$14394", "typeString": "contract ControllerInterface" } }, "value": null, "visibility": "internal" } ], "id": 11435, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 11431, "name": "avatar", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11400, "src": "1150:6:39", "typeDescriptions": { "typeIdentifier": "t_contract$_Avatar_$12705", "typeString": "contract Avatar" } }, "id": 11432, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "owner", "nodeType": "MemberAccess", "referencedDeclaration": 21342, "src": "1150:12:39", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_address_$", "typeString": "function () view external returns (address)" } }, "id": 11433, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1150:14:39", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 11430, "name": "ControllerInterface", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14394, "src": "1130:19:39", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ControllerInterface_$14394_$", "typeString": "type(contract ControllerInterface)" } }, "id": 11434, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1130:35:39", "typeDescriptions": { "typeIdentifier": "t_contract$_ControllerInterface_$14394", "typeString": "contract ControllerInterface" } }, "nodeType": "VariableDeclarationStatement", "src": "1097:68:39" }, { "assignments": [ 11437, null ], "declarations": [ { "constant": false, "id": 11437, "name": "ok", "nodeType": "VariableDeclaration", "scope": 11488, "src": "1176:7:39", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 11436, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1176:4:39", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" }, null ], "id": 11453, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 11441, "name": "avatar", "nodeType": "Identifier", "overloadedDecla