Skip to content

Commit

Permalink
Remove use of package keyword (#720)
Browse files Browse the repository at this point in the history
* Remoce use of package keyword

* Add decision to executed event

* Update UpgradeScheme.sol
  • Loading branch information
ben-kaufman authored Mar 23, 2020
1 parent cc6be2f commit 31f4882
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 33 deletions.
15 changes: 8 additions & 7 deletions contracts/schemes/UpgradeScheme.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init

event ProposalExecuted(
address indexed _avatar,
bytes32 indexed _proposalId
bytes32 indexed _proposalId,
bool _decision
);

event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId);
Expand All @@ -45,7 +46,7 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init
IntVoteInterface public votingMachine;
bytes32 public voteParams;
Avatar public avatar;
Package public package;
Package public arcPackage;

/**
* @dev initialize
Expand All @@ -66,7 +67,7 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init
avatar = _avatar;
votingMachine = _votingMachine;
voteParams = _voteParams;
package = _package;
arcPackage = _package;
}

/**
Expand All @@ -89,7 +90,7 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init
bytes32 contractNameBytes = proposal.contractsNames[i];
string memory contractName = contractNameBytes.toStr();
address updatedImp = ImplementationProvider(
package.getContract(proposal.packageVersion)
arcPackage.getContract(proposal.packageVersion)
).getImplementation(contractName);

Controller controller = Controller(avatar.owner());
Expand All @@ -103,7 +104,7 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init

delete organizationProposals[_proposalId];
emit ProposalDeleted(address(avatar), _proposalId);
emit ProposalExecuted(address(avatar), _proposalId);
emit ProposalExecuted(address(avatar), _proposalId, _decision == 1);
return true;
}

Expand All @@ -129,11 +130,11 @@ contract UpgradeScheme is VotingMachineCallbacks, ProposalExecuteInterface, Init
_contractsNames.length == _contractsToUpgrade.length,
"upgrade name and address arrays must have equal lengths"
);
require(package.hasVersion(_packageVersion), "Specified version doesn't exist in the Package");
require(arcPackage.hasVersion(_packageVersion), "Specified version doesn't exist in the Package");
for (uint256 i = 0; i < _contractsToUpgrade.length; i++) {
require(
ImplementationProvider(
package.getContract(_packageVersion)
arcPackage.getContract(_packageVersion)
).getImplementation(_contractsNames[i].toStr()) != address(0),
"Contract name does not exist in ArcHive package"
);
Expand Down
89 changes: 64 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daostack/arc-experimental",
"version": "0.1.1-rc.6",
"version": "0.1.1-rc.7",
"description": "A platform for building DAOs",
"files": [
"contracts/",
Expand Down

0 comments on commit 31f4882

Please sign in to comment.