Skip to content

Commit

Permalink
smart vault: rename hasPermissions function
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalende committed Dec 16, 2023
1 parent 1a4fb2a commit 0f06df7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/relayer/certora/helpers/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ contract Helpers {
address taskSmartVault = ITask(tasks[i]).smartVault();
if (taskSmartVault != smartVault) return false;

bool hasPermissions = ISmartVault(smartVault).hasPermissions(tasks[i]);
if (!hasPermissions) return false;
bool hasAnyPermission = ISmartVault(smartVault).hasAnyPermission(tasks[i]);
if (!hasAnyPermission) return false;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion packages/relayer/certora/specs/Relayer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ methods {

// Wildcard entries
function _.smartVault() external => PER_CALLEE_CONSTANT;
function _.hasPermissions(address) external => PER_CALLEE_CONSTANT;
function _.hasAnyPermission(address) external => PER_CALLEE_CONSTANT;
}


Expand Down
4 changes: 2 additions & 2 deletions packages/relayer/contracts/Relayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ contract Relayer is IRelayer, Ownable {

// Note the validation below is the only one made on task, by checking that the smart vault that will pay for the gas is somehow related to it.
// This check is critical since the smart vault is not referenced again inside this function.
bool hasPermissions = ISmartVault(smartVault).hasPermissions(task);
if (!hasPermissions) revert RelayerTaskDoesNotHavePermissions(task, smartVault);
bool hasAnyPermission = ISmartVault(smartVault).hasAnyPermission(task);
if (!hasAnyPermission) revert RelayerTaskDoesNotHavePermissions(task, smartVault);

// Note if `task` were an EOA the line below would succeed, resulting in a false positive. This is prevented a few lines above by making sure `task` is a contract that implements ITask.
// solhint-disable-next-line avoid-low-level-calls
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-vault/contracts/SmartVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ contract SmartVault is ISmartVault, Authorized, ReentrancyGuardUpgradeable {
/**
* @dev Tells whether someone has any permission over the smart vault
*/
function hasPermissions(address who) external view override returns (bool) {
function hasAnyPermission(address who) external view override returns (bool) {
return _hasAnyPermission(who);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/smart-vault/contracts/interfaces/ISmartVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ interface ISmartVault is IAuthorized {
/**
* @dev Tells whether someone has any permission over the smart vault
*/
function hasPermissions(address who) external view returns (bool);
function hasAnyPermission(address who) external view returns (bool);

/**
* @dev Pauses a smart vault
Expand Down

0 comments on commit 0f06df7

Please sign in to comment.