mirror of https://github.com/poanetwork/quorum.git
update permission abi and contract with latest
This commit is contained in:
parent
389c07fd30
commit
a3ee9a62f4
|
@ -0,0 +1,71 @@
|
|||
pragma solidity ^0.5.3;
|
||||
|
||||
import "./PermissionsInterface.sol";
|
||||
|
||||
contract PermissionsUpgradable {
|
||||
|
||||
address private custodian;
|
||||
address private permImpl;
|
||||
address private permInterface;
|
||||
|
||||
// sets the custodian account as part of constructor
|
||||
// only this account will be able to change the implementation contract address
|
||||
constructor (address _custodian) public
|
||||
{
|
||||
custodian = _custodian;
|
||||
}
|
||||
|
||||
modifier onlyCustodian {
|
||||
require(msg.sender == custodian);
|
||||
_;
|
||||
}
|
||||
|
||||
// executed by custodian, links interface and implementation contract addresses
|
||||
function init(address _permInterface, address _permImpl) external
|
||||
onlyCustodian
|
||||
{
|
||||
permImpl = _permImpl;
|
||||
permInterface = _permInterface;
|
||||
setImpl(permImpl);
|
||||
}
|
||||
|
||||
|
||||
// custodian can potentially become a contract
|
||||
// implementation change and custodian change are sending from custodian
|
||||
function confirmImplChange(address _proposedImpl) public
|
||||
onlyCustodian
|
||||
{
|
||||
// read the details from current implementation
|
||||
(string memory adminOrg, string memory adminRole, string memory orgAdminRole, bool bootStatus) = PermissionsImplementation(permImpl).getPolicyDetails();
|
||||
setPolicy(_proposedImpl, adminOrg, adminRole, orgAdminRole, bootStatus);
|
||||
// set these values in new implementation
|
||||
permImpl = _proposedImpl;
|
||||
setImpl(permImpl);
|
||||
}
|
||||
|
||||
function getCustodian() public view returns (address)
|
||||
{
|
||||
return custodian;
|
||||
}
|
||||
|
||||
function getPermImpl() public view returns (address)
|
||||
{
|
||||
return permImpl;
|
||||
}
|
||||
|
||||
function getPermInterface() public view returns (address)
|
||||
{
|
||||
return permInterface;
|
||||
}
|
||||
|
||||
function setPolicy(address _permImpl, string memory _adminOrg, string memory _adminRole, string memory _orgAdminRole, bool _bootStatus) private
|
||||
{
|
||||
PermissionsImplementation(_permImpl).setMigrationPolicy(_adminOrg, _adminRole, _orgAdminRole, _bootStatus);
|
||||
}
|
||||
|
||||
function setImpl(address _permImpl) private
|
||||
{
|
||||
PermissionsInterface(permInterface).setPermImplementation(_permImpl);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
[{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_action","type":"uint256"}],"name":"updateOrg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getOrgIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_action","type":"uint256"}],"name":"approveOrgStatusUpdate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getUltimateParent","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgIndex","type":"uint256"}],"name":"getSubOrgIndexLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_pOrg","type":"string"},{"name":"_orgId","type":"string"}],"name":"addSubOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgIndex","type":"uint256"},{"name":"_subOrgIndex","type":"uint256"}],"name":"getSubOrgIndexLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgIndex","type":"uint256"}],"name":"getOrgInfo","outputs":[{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNumberOfOrgs","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"},{"name":"_orgStatus","type":"uint256"}],"name":"checkOrgStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"},{"name":"_breadth","type":"uint256"},{"name":"_depth","type":"uint256"}],"name":"setUpOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgIndex","type":"uint256"}],"name":"getSubOrgInfo","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getImpl","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"}],"name":"approveOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orgId","type":"string"}],"name":"addOrg","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"getOrgStatus","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_orgId","type":"string"}],"name":"checkOrgExists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_permUpgradable","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_porgId","type":"string"},{"indexed":false,"name":"_ultParent","type":"string"},{"indexed":false,"name":"_level","type":"uint256"},{"indexed":false,"name":"_status","type":"uint256"}],"name":"OrgApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_porgId","type":"string"},{"indexed":false,"name":"_ultParent","type":"string"},{"indexed":false,"name":"_level","type":"uint256"},{"indexed":false,"name":"_status","type":"uint256"}],"name":"OrgPendingApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_porgId","type":"string"},{"indexed":false,"name":"_ultParent","type":"string"},{"indexed":false,"name":"_level","type":"uint256"}],"name":"OrgSuspended","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_orgId","type":"string"},{"indexed":false,"name":"_porgId","type":"string"},{"indexed":false,"name":"_ultParent","type":"string"},{"indexed":false,"name":"_level","type":"uint256"}],"name":"OrgSuspensionRevoked","type":"event"}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue