From 1d096e790c87571e7d4442fa3380eb657f43d389 Mon Sep 17 00:00:00 2001 From: Sowmayjain Date: Mon, 11 Mar 2019 01:11:29 +0530 Subject: [PATCH] renaming logic proxy file. --- LogicProxyRegistry.sol => LogicRegistry.sol | 2 +- UserProxy.sol | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) rename LogicProxyRegistry.sol => LogicRegistry.sol (96%) diff --git a/LogicProxyRegistry.sol b/LogicRegistry.sol similarity index 96% rename from LogicProxyRegistry.sol rename to LogicRegistry.sol index a836cfd..16eaeef 100644 --- a/LogicProxyRegistry.sol +++ b/LogicRegistry.sol @@ -22,7 +22,7 @@ contract AddressRegistry { } } -contract LogicProxyRegistry is AddressRegistry { +contract LogicRegistry is AddressRegistry { event DefaultLogicSet(address logicAddr); event LogicSet(address logicAddr, bool isLogic); diff --git a/UserProxy.sol b/UserProxy.sol index 0bb3fc3..f6a98c2 100644 --- a/UserProxy.sol +++ b/UserProxy.sol @@ -22,7 +22,8 @@ contract UserAuth { mapping(uint => address) public guardians; address public owner; uint public lastActivity; // timestamp - uint public activePeriod; // timestamp // guardians can set owner after owner stay inactive for certain period + // guardians can set owner after owner stay inactive for certain period + uint public activePeriod; // timestamp constructor() public { owner = msg.sender; @@ -92,9 +93,9 @@ interface LogicRegistry { } // checking if the logic proxy is authorised -contract LogicProxy { +contract UserLogic { address public logicProxyAddr; - function isAuthLogic(address logicAddr) internal view returns(bool) { + function isAuthorisedLogic(address logicAddr) internal view returns(bool) { LogicRegistry logicProxy = LogicRegistry(logicProxyAddr); return logicProxy.getLogic(logicAddr); } @@ -105,7 +106,7 @@ contract LogicProxy { // useful to execute a sequence of atomic actions. Since the owner of // the proxy can be changed, this allows for dynamic ownership models // i.e. a multisig -contract UserProxy is UserAuth, UserNote, LogicProxy { +contract UserProxy is UserAuth, UserNote, UserLogic { constructor(address logicProxyAddr_, uint activePeriod_) public { logicProxyAddr = logicProxyAddr_; @@ -123,7 +124,7 @@ contract UserProxy is UserAuth, UserNote, LogicProxy { returns (bytes memory response) { require(_target != address(0), "user-proxy-target-address-required"); - require(isAuthLogic(_target), "logic-proxy-address-not-allowed"); + require(isAuthorisedLogic(_target), "logic-proxy-address-not-allowed"); lastActivity = block.timestamp; // call contract in current context assembly {