From e6f7582392829c4964b77b6710b47ed2fd074cc1 Mon Sep 17 00:00:00 2001 From: Oren Date: Thu, 7 Feb 2019 10:04:32 +0200 Subject: [PATCH 1/2] fix uController newOrganization --- contracts/controller/UController.sol | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contracts/controller/UController.sol b/contracts/controller/UController.sol index 72ceebec..f397edcf 100644 --- a/contracts/controller/UController.sol +++ b/contracts/controller/UController.sol @@ -93,15 +93,17 @@ contract UController is ControllerInterface { { require(!organizations[address(_avatar)].exist); require(_avatar.owner() == address(this)); + DAOToken nativeToken = _avatar.nativeToken(); + Reputation nativeReputation = _avatar.nativeReputation(); //To guaranty uniqueness for the reputation systems. - require(!reputations[address(_avatar.nativeReputation())]); + require(!reputations[address(nativeReputation)]); //To guaranty uniqueness for the reputation systems. - require(!tokens[address(_avatar.nativeToken())]); + require(!tokens[address(nativeToken)]); organizations[address(_avatar)].exist = true; - organizations[address(_avatar)].nativeToken = _avatar.nativeToken(); - organizations[address(_avatar)].nativeReputation = _avatar.nativeReputation(); - reputations[address(_avatar.nativeReputation())] = true; - tokens[address(_avatar.nativeToken())] = true; + organizations[address(_avatar)].nativeToken = nativeToken; + organizations[address(_avatar)].nativeReputation = nativeReputation; + reputations[address(nativeReputation)] = true; + tokens[address(nativeToken)] = true; organizations[address(_avatar)].schemes[msg.sender] = Scheme({paramsHash: bytes32(0), permissions: bytes4(0x0000001f)}); emit RegisterScheme(msg.sender, msg.sender, address(_avatar)); From 7752c223e446347ce28a026b2882ea1cc1a2eaf9 Mon Sep 17 00:00:00 2001 From: Oren Date: Thu, 7 Feb 2019 10:09:42 +0200 Subject: [PATCH 2/2] comment --- contracts/controller/UController.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/controller/UController.sol b/contracts/controller/UController.sol index f397edcf..016ccc47 100644 --- a/contracts/controller/UController.sol +++ b/contracts/controller/UController.sol @@ -97,7 +97,7 @@ contract UController is ControllerInterface { Reputation nativeReputation = _avatar.nativeReputation(); //To guaranty uniqueness for the reputation systems. require(!reputations[address(nativeReputation)]); - //To guaranty uniqueness for the reputation systems. + //To guaranty uniqueness for the nativeToken. require(!tokens[address(nativeToken)]); organizations[address(_avatar)].exist = true; organizations[address(_avatar)].nativeToken = nativeToken;