Skip to content

Commit

Permalink
commit building
Browse files Browse the repository at this point in the history
  • Loading branch information
RedVeil committed Oct 28, 2024
1 parent 8006a19 commit 1f39491
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 93 deletions.
2 changes: 1 addition & 1 deletion lib/safe-smart-account
41 changes: 0 additions & 41 deletions src/interfaces/external/safe/IModuleGuard.sol

This file was deleted.

39 changes: 2 additions & 37 deletions src/peripheral/gnosis/transactionGuard/LoggerGuard.sol
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
import {DebugTransactionGuard, Enum} from "safe-smart-account/examples/guards/DebugTransactionGuard.sol";
import {DebugTransactionGuard} from "safe-smart-account/examples/guards/DebugTransactionGuard.sol";

contract LoggerGuard is DebugTransactionGuard {
event ModuleTransactionDetails(
address indexed safe,
address to,
uint256 value,
bytes data,
Enum.Operation operation,
address module
);

event ModuleExecutionDetails(bytes32 indexed txHash, bool success);

function checkModuleTransaction(
address to,
uint256 value,
bytes memory data,
Enum.Operation operation,
address module
) external view {
emit ModuleTransactionDetails(
msg.sender,
to,
value,
data,
operation,
module
);
}

function checkAfterModuleExecution(
bytes32 txHash,
bool success
) external view {
emit ModuleExecutionDetails(txHash, success);
}
}
contract LoggerGuard is DebugTransactionGuard {}
12 changes: 6 additions & 6 deletions src/peripheral/gnosis/transactionGuard/MainTransactionGuard.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.12 <0.9.0;

import {BaseGuard, Guard, Enum} from "safe-smart-account/base/GuardManager.sol";
import {IModuleGuard} from "src/interfaces/external/safe/IModuleGuard.sol";
import {BaseGuard, ITransactionGuard, IModuleGuard} from "safe-smart-account/examples/guards/BaseGuard.sol";
import {Enum} from "safe-smart-account/libraries/Enum.sol";
import {Owned} from "src/utils/Owned.sol";

contract MainTransactionGuard is BaseGuard, Owned {
Expand Down Expand Up @@ -49,7 +49,7 @@ contract MainTransactionGuard is BaseGuard, Owned {
address[] memory hooks = getHooks();

for (uint256 i; i < hooks.length; i++) {
Guard(hooks[i]).checkTransaction(
ITransactionGuard(hooks[i]).checkTransaction(
to,
value,
data,
Expand Down Expand Up @@ -77,7 +77,7 @@ contract MainTransactionGuard is BaseGuard, Owned {
address[] memory hooks = getHooks();

for (uint256 i; i < hooks.length; i++) {
Guard(hooks[i]).checkAfterExecution(txHash, success);
ITransactionGuard(hooks[i]).checkAfterExecution(txHash, success);
}
}

Expand Down Expand Up @@ -105,7 +105,7 @@ contract MainTransactionGuard is BaseGuard, Owned {
address[] memory hooks = getHooks();

for (uint256 i; i < hooks.length; i++) {
Guard(hooks[i]).checkModuleTransaction(
IModuleGuard(hooks[i]).checkModuleTransaction(
to,
value,
data,
Expand All @@ -125,7 +125,7 @@ contract MainTransactionGuard is BaseGuard, Owned {
address[] memory hooks = getHooks();

for (uint256 i; i < hooks.length; i++) {
Guard(hooks[i]).checkAfterModuleExecution(txHash, success);
IModuleGuard(hooks[i]).checkAfterModuleExecution(txHash, success);
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/peripheral/gnosis/transactionGuard/ScopeGuard.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.12 <0.9.0;

import {BaseGuard, Guard, Enum} from "safe-smart-account/base/GuardManager.sol";
import {BaseGuard} from "safe-smart-account/examples/guards/BaseGuard.sol";
import {Enum} from "safe-smart-account/libraries/Enum.sol";
import {Owned} from "src/utils/Owned.sol";

contract ScopeGuard is BaseGuard, Owned {
Expand Down Expand Up @@ -171,7 +172,7 @@ contract ScopeGuard is BaseGuard, Owned {
address payable,
bytes memory,
address
) external view override {
) external override {
_checkTransaction(to, value, data, operation);
}

Expand All @@ -181,7 +182,7 @@ contract ScopeGuard is BaseGuard, Owned {
bytes memory data,
Enum.Operation operation,
address
) external view {
) external override returns (bytes32 moduleTxHash) {
_checkTransaction(to, value, data, operation);
}

Expand Down Expand Up @@ -219,7 +220,7 @@ contract ScopeGuard is BaseGuard, Owned {
}
}

function checkAfterExecution(bytes32, bool) external view override {}
function checkAfterExecution(bytes32, bool) external override {}

function checkAfterModuleExecution(bytes32, bool) external view {}
function checkAfterModuleExecution(bytes32, bool) external override {}
}
6 changes: 3 additions & 3 deletions src/vaults/multisig/phase1/OracleVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {IPriceOracle} from "src/interfaces/IPriceOracle.sol";
contract OracleVault is MultisigVault {
constructor(
InitializeParams memory params,
address oracle
address oracle_
) MultisigVault(params) {
oracle = IPriceOracle(oracle);
oracle = IPriceOracle(oracle_);
}

/*//////////////////////////////////////////////////////////////
Expand All @@ -24,6 +24,6 @@ contract OracleVault is MultisigVault {

/// @return Total amount of underlying `asset` token managed by vault. Delegates to adapter.
function totalAssets() public view override returns (uint256) {
return IPriceOracle(oracle).getQuote(totalSupply(), share, asset);
return oracle.getQuote(totalSupply, share, address(asset));
}
}

0 comments on commit 1f39491

Please sign in to comment.