Skip to content

Commit

Permalink
[#4] Add test modules
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-ap committed Jun 20, 2023
1 parent 11fe5d3 commit 96f2067
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions contracts/test/TestModule.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.18;

import {ISafe} from "../interfaces/Accounts.sol";
import {ISafeProtocolModule} from "../interfaces/Components.sol";

abstract contract BaseTestModule is ISafeProtocolModule {
string public name = "";
string public version = "";
bool public requiresRootAccess = false;

function metaProvider() external view override returns (uint256 providerType, bytes memory location) {}
}

contract TestModule is BaseTestModule {
function executeFromModule(ISafe safe, address payable to, uint256 value,bytes calldata data) external {

Check failure on line 16 in contracts/test/TestModule.sol

View workflow job for this annotation

GitHub Actions / lint

Insert ·
safe.execTransactionFromModule(to, value, data, 0);
}
}

contract TestModuleWithRootAccess is BaseTestModule {
constructor() {
requiresRootAccess = true;
}

function executeFromModule(ISafe safe, address payable to, uint256 value, bytes calldata data) external {
safe.execTransactionFromModule(to, value, data, 1);
}
}

0 comments on commit 96f2067

Please sign in to comment.