From 7991b6a0fdfca35b2847c61912f73f67d9d513f6 Mon Sep 17 00:00:00 2001 From: nishant-sachdeva Date: Wed, 26 Oct 2022 13:56:18 +0530 Subject: [PATCH] changed usage of code as identifier. Code is to be a reserved keyword in upcoming changes in solidity --- contracts/common/DomainRoles.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/common/DomainRoles.sol b/contracts/common/DomainRoles.sol index ad518d3ef9..c74d9f0640 100644 --- a/contracts/common/DomainRoles.sol +++ b/contracts/common/DomainRoles.sol @@ -45,15 +45,15 @@ contract DomainRoles is DSRoles { return bytes32(0) != roles & shifted; } - function canCall(address caller, uint256 where, address code, bytes4 sig) public view returns (bool) { + function canCall(address caller, uint256 where, address codeAddress, bytes4 sig) public view returns (bool) { bytes32 hasRoles = getUserRoles(caller, where); - bytes32 needsOneOf = getCapabilityRoles(code, sig); + bytes32 needsOneOf = getCapabilityRoles(codeAddress, sig); return bytes32(0) != hasRoles & needsOneOf; } - function canCallOnlyBecause(address caller, uint256 where, uint8 role, address code, bytes4 sig) public view returns (bool) { + function canCallOnlyBecause(address caller, uint256 where, uint8 role, address codeAddress, bytes4 sig) public view returns (bool) { bytes32 hasRoles = getUserRoles(caller, where); - bytes32 needsOneOf = getCapabilityRoles(code, sig); + bytes32 needsOneOf = getCapabilityRoles(codeAddress, sig); bytes32 shifted = bytes32(uint256(uint256(2) ** uint256(role))); // See if the permission comes from a *specific* role return bytes32(0) == (needsOneOf & hasRoles) ^ shifted; @@ -69,8 +69,8 @@ contract DomainRoles is DSRoles { return hasUserRole(who, 1, role); } - function canCall(address caller, address code, bytes4 sig) public view override returns (bool) { - return canCall(caller, 1, code, sig); + function canCall(address caller, address codeAddress, bytes4 sig) public view override returns (bool) { + return canCall(caller, 1, codeAddress, sig); } }