Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Identity recovery Identity recovery
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MemriMemri
  • Identity recoveryIdentity recovery
  • Merge requests
  • !1

Fix proxy

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Bijun Li requested to merge fix-proxy into dev 3 years ago
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 12
Compare
  • dev (base)

and
  • latest version
    dd7e377a
    2 commits, 3 years ago

12 files
+ 51
- 411

    Preferences

    File browser
    Compare changes
cont‎racts‎
inter‎faces‎
IIdentityR‎ecovery.sol‎ +2 -2
IMast‎er.sol‎ +0 -6
IMemberR‎oles.sol‎ +2 -9
man‎age‎
Manag‎ed.sol‎ +0 -30
pr‎oxy‎
OwnedUpgrade‎ableProxy.sol‎ +6 -19
Prox‎y.sol‎ +2 -2
Upgradeabl‎eProxy.sol‎ +7 -10
IdentityRe‎covery.sol‎ +13 -30
ManageBlock‎sMaster.sol‎ +0 -21
Maste‎r.sol‎ +0 -197
MemberR‎oles.sol‎ +19 -59
Upgrade‎able.sol‎ +0 -26
contracts/interfaces/IIdentityRecovery.sol
+ 2
- 2
  • View file @ dd7e377a

  • Edit in single-file editor

  • Open in Web IDE


// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IIdentityRecovery {
event UpdateCreated(address keyOwner, string pubKey, uint256 publicKeyNumber);
contracts/interfaces/IMaster.sol deleted 100644 → 0
+ 0
- 6
  • View file @ e429cd10

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
interface IMaster {
function getLatestAddress(bytes2 _module) external view returns(address);
}
\ No newline at end of file
contracts/interfaces/IMemberRoles.sol
+ 2
- 9
  • View file @ dd7e377a

  • Edit in single-file editor

  • Open in Web IDE


// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IMemberRoles {
event MemberRole(uint256 indexed roleId, bytes32 roleName, string roleDescription, bool isLimited);
@@ -40,13 +40,6 @@ interface IMemberRoles {
*/
function members(uint _memberRoleId) external view returns(uint, address[] memory allMemberAddress);
/**
* @dev Gets all members' length
* @param _memberRoleId Member role id
* @return memberRoleData[_memberRoleId].memberCounter Member length
*/
function numberOfMembers(uint _memberRoleId) external view returns(uint);
/**
* @dev Return member address who holds the right to add/remove any member from specific role.
*/
contracts/manage/Managed.sol deleted 100644 → 0
+ 0
- 30
  • View file @ e429cd10

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
interface IMaster {
function getLatestAddress(bytes2 _module) external view returns(address);
}
contract Managed {
address public masterAddress; // Name of the dApp, needs to be set by contracts inhering this contract
/**
* @dev Modifier that allows only the authorized addresses to execute the function
*/
modifier onlyAuthorizedToManage() {
IMaster ms = IMaster(masterAddress);
require(ms.getLatestAddress("IR") == msg.sender, "Not authorized");
_;
}
/**
* @dev Checks if an address is authorized to manage
* @return isAuthorized if authorized to manage
*/
function isAuthorizedToManage(address _toCheck) public view returns(bool) {
IMaster ms = IMaster(masterAddress);
return (ms.getLatestAddress("IR") == _toCheck);
}
}
contracts/proxy/OwnedUpgradeabilityProxy.sol → contracts/proxy/OwnedUpgradeableProxy.sol
+ 6
- 19
  • View file @ dd7e377a

  • Edit in single-file editor

  • Open in Web IDE


// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.3;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import './UpgradeabilityProxy.sol';
import './UpgradeableProxy.sol';
/**
* @title OwnedUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with basic authorization control functionality
* @title OwnedUpgradeableProxy
* @dev This contract combines an upgradeable proxy with basic authorization control functionality
*/
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy {
contract OwnedUpgradeableProxy is UpgradeableProxy {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
@@ -63,19 +63,6 @@ contract OwnedUpgradeabilityProxy is UpgradeabilityProxy {
_upgradeTo(_implementation);
}
// /**
// * @dev Allows the proxy owner to upgrade the current version of the proxy and call the new implementation
// * to initialize whatever is needed through a low level call.
// * @param _implementation representing the address of the new implementation to be set.
// * @param _data represents the msg.data to bet sent in the low level call. This parameter may include the function
// * signature of the implementation to be called with the needed payload
// */
// function upgradeToAndCall(address _implementation, bytes memory _data) payable public onlyProxyOwner {
// _upgradeTo(_implementation);
// (bool success, ) = address(this).call{value:msg.value}(_data);
// require(success, "Transfer failed.");
// }
/**
* @dev Sets the address of the owner
*/
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
1
1 participant
Bijun Li
Reference:
Source branch: fix-proxy

Menu

Explore Projects Groups Snippets