Skip to content

Commit

Permalink
Better variable names in createSubsidiary
Browse files Browse the repository at this point in the history
  • Loading branch information
kvakes committed Jun 7, 2020
1 parent 877c42f commit 5c17de8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions contracts/OrgId.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,34 @@ contract OrgId is OrgIdInterface, Ownable, ERC165, Initializable {

/**
* @dev Create organizational unit
* @param orgId Parent ORG.ID hash
* @param subsidiaryDirector Unit's director address
* @param orgJsonUri Unit's ORG.JSON URI
* @param orgJsonHash ORG.JSON's keccak256 hash
* @param parentOrgId Parent ORG.ID hash
* @param director Unit director address
* @param orgJsonUri Unit ORG.JSON URI
* @param orgJsonHash ORG.JSON keccak256 hash
*/
function createSubsidiary(
bytes32 orgId,
address subsidiaryDirector,
bytes32 parentOrgId,
address director,
string calldata orgJsonUri,
bytes32 orgJsonHash
)
external
orgIdMustExist(orgId)
mustBeCalledByOwner(orgId)
returns (bytes32 id)
orgIdMustExist(parentOrgId)
mustBeCalledByOwner(parentOrgId)
returns (bytes32 newUnitOrgId)
{
id = _createOrganization(
orgId,
subsidiaryDirector,
newUnitOrgId = _createOrganization(
parentOrgId,
director,
orgJsonUri,
orgJsonHash
);
emit SubsidiaryCreated(orgId, id, subsidiaryDirector);
emit SubsidiaryCreated(parentOrgId, newUnitOrgId, director);

// If parent ORG.ID owner indicates their address as director,
// their directorship is automatically confirmed
if (subsidiaryDirector == msg.sender) {
emit DirectorOwnershipConfirmed(id, msg.sender);
if (director == msg.sender) {
emit DirectorOwnershipConfirmed(newUnitOrgId, msg.sender);
}
}

Expand Down
12 changes: 6 additions & 6 deletions contracts/OrgIdInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ contract OrgIdInterface {

/**
* @dev Create organizational unit
* @param orgId Parent ORG.ID hash
* @param subsidiaryDirector Unit's director address
* @param orgJsonUri Unit's ORG.JSON URI
* @param orgJsonHash ORG.JSON's keccak256 hash
* @param parentOrgId Parent ORG.ID hash
* @param director Unit director address
* @param orgJsonUri Unit ORG.JSON URI
* @param orgJsonHash ORG.JSON keccak256 hash
*/
function createSubsidiary(
bytes32 orgId,
address subsidiaryDirector,
bytes32 parentOrgId,
address director,
string calldata orgJsonUri,
bytes32 orgJsonHash
) external returns (bytes32 id);
Expand Down

0 comments on commit 5c17de8

Please sign in to comment.