renaming logic proxy file.

This commit is contained in:
Sowmayjain 2019-03-11 01:11:29 +05:30
parent e8aaa197c9
commit 1d096e790c
2 changed files with 7 additions and 6 deletions

View File

@ -22,7 +22,7 @@ contract AddressRegistry {
} }
} }
contract LogicProxyRegistry is AddressRegistry { contract LogicRegistry is AddressRegistry {
event DefaultLogicSet(address logicAddr); event DefaultLogicSet(address logicAddr);
event LogicSet(address logicAddr, bool isLogic); event LogicSet(address logicAddr, bool isLogic);

View File

@ -22,7 +22,8 @@ contract UserAuth {
mapping(uint => address) public guardians; mapping(uint => address) public guardians;
address public owner; address public owner;
uint public lastActivity; // timestamp 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 { constructor() public {
owner = msg.sender; owner = msg.sender;
@ -92,9 +93,9 @@ interface LogicRegistry {
} }
// checking if the logic proxy is authorised // checking if the logic proxy is authorised
contract LogicProxy { contract UserLogic {
address public logicProxyAddr; address public logicProxyAddr;
function isAuthLogic(address logicAddr) internal view returns(bool) { function isAuthorisedLogic(address logicAddr) internal view returns(bool) {
LogicRegistry logicProxy = LogicRegistry(logicProxyAddr); LogicRegistry logicProxy = LogicRegistry(logicProxyAddr);
return logicProxy.getLogic(logicAddr); return logicProxy.getLogic(logicAddr);
} }
@ -105,7 +106,7 @@ contract LogicProxy {
// useful to execute a sequence of atomic actions. Since the owner of // useful to execute a sequence of atomic actions. Since the owner of
// the proxy can be changed, this allows for dynamic ownership models // the proxy can be changed, this allows for dynamic ownership models
// i.e. a multisig // i.e. a multisig
contract UserProxy is UserAuth, UserNote, LogicProxy { contract UserProxy is UserAuth, UserNote, UserLogic {
constructor(address logicProxyAddr_, uint activePeriod_) public { constructor(address logicProxyAddr_, uint activePeriod_) public {
logicProxyAddr = logicProxyAddr_; logicProxyAddr = logicProxyAddr_;
@ -123,7 +124,7 @@ contract UserProxy is UserAuth, UserNote, LogicProxy {
returns (bytes memory response) returns (bytes memory response)
{ {
require(_target != address(0), "user-proxy-target-address-required"); 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; lastActivity = block.timestamp;
// call contract in current context // call contract in current context
assembly { assembly {