From 57007bba75598e908ff05f048f4a3a96e3af4e45 Mon Sep 17 00:00:00 2001 From: satyam Date: Mon, 4 Mar 2019 11:45:42 +0530 Subject: [PATCH 1/2] remove msg.sender restriction in setController function --- contracts/tokens/SecurityToken.sol | 4 ---- 1 file changed, 4 deletions(-) diff --git a/contracts/tokens/SecurityToken.sol b/contracts/tokens/SecurityToken.sol index 99aa375e9..59e529575 100644 --- a/contracts/tokens/SecurityToken.sol +++ b/contracts/tokens/SecurityToken.sol @@ -577,10 +577,6 @@ contract SecurityToken is ERC20, ERC20Detailed, Ownable, ReentrancyGuard, Securi */ function setController(address _controller) public onlyOwner { require(_isControllable()); - // Below condition is to restrict the owner/issuer to become the controller(In an ideal world). - // But for non ideal case issuer could set another address which is not the owner of the token - // but issuer holds its private key. - require(_controller != msg.sender); emit SetController(controller, _controller); controller = _controller; } From d7e566fe5afc024fa955ae924e8678eadd9719ef Mon Sep 17 00:00:00 2001 From: satyam Date: Mon, 4 Mar 2019 15:35:35 +0530 Subject: [PATCH 2/2] fix test --- test/c_checkpoints.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test/c_checkpoints.js b/test/c_checkpoints.js index 168e1e8e3..2526539f6 100644 --- a/test/c_checkpoints.js +++ b/test/c_checkpoints.js @@ -140,13 +140,7 @@ contract("Checkpoints", async function(accounts) { assert.equal(web3.utils.toAscii(log.args._name).replace(/\u0000/g, ""), "GeneralTransferManager"); }); - it("Should set controller to token owner --failed not allowed", async () => { - await catchRevert( - I_SecurityToken.setController(token_owner, { from: token_owner }) - ); - }); - - it("Should set the tcontroller", async() => { + it("Should set the controller", async() => { await I_SecurityToken.setController(account_controller, {from: token_owner}); })