Skip to content

Commit

Permalink
Apply suggestions from @izqui
Browse files Browse the repository at this point in the history
Co-Authored-By: Jorge Izquierdo <izqui97@gmail.com>
  • Loading branch information
facuspagnuolo and izqui committed May 17, 2019
1 parent 6ab5f69 commit ff52bb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions contracts/apps/AragonApp.sol
Expand Up @@ -39,7 +39,8 @@ contract AragonApp is AppStorage, Autopetrified, VaultRecoverable, ReentrancyGua
bytes memory callData = abi.encodeWithSelector(selector, appId(), address(this));
bool success = address(_kernel).call(callData);

// perform a check only if kernel supports "shouldDenyCallingApp" method
// if the call to `kernel.shouldDenyCallingApp` reverts (using an old Kernel) we consider that
// there is no kill switch and the call should be allowed to continue
if (success) {
uint256 _outputLength;
assembly { _outputLength := returndatasize }
Expand All @@ -49,8 +50,8 @@ contract AragonApp is AppStorage, Autopetrified, VaultRecoverable, ReentrancyGua
bool _shouldDenyCall;
assembly {
let ptr := mload(0x40) // get next free memory pointer
mstore(0x40, add(ptr, returndatasize)) // set next free memory pointer
returndatacopy(ptr, 0, returndatasize) // copy call return value
mstore(0x40, add(ptr, 0x20)) // set next free memory pointer
returndatacopy(ptr, 0, 0x20) // copy call return value
_shouldDenyCall := mload(ptr) // read data
}
require(!_shouldDenyCall, ERROR_CONTRACT_CALL_NOT_ALLOWED);
Expand Down
2 changes: 1 addition & 1 deletion contracts/factory/DAOFactory.sol
Expand Up @@ -122,7 +122,7 @@ contract DAOFactory {
acl.removePermissionManager(killSwitch, setAllowedInstancesRole);
}

function _setupNewDaoPermissions(Kernel _dao, address _root) internal {
function _setupEVMScriptRegistry(Kernel _dao, address _root) internal {
// grant permissions to script registry factory
_grantCreatePermissionsRole(_dao, scriptsRegistryFactory);
_createAppManagerRole(_dao, scriptsRegistryFactory);
Expand Down

0 comments on commit ff52bb7

Please sign in to comment.