Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Dec 30, 2024
1 parent 230f666 commit 54b494d
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions contracts/src/ErrantryClientSmartAccount.sol
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {SimpleAccount, IEntryPoint, PackedUserOperation, SIG_VALIDATION_SUCCESS} from "@account-abstraction/contracts/samples/SimpleAccount.sol";
import {
SimpleAccount,
IEntryPoint,
PackedUserOperation,
SIG_VALIDATION_SUCCESS
} from "@account-abstraction/contracts/samples/SimpleAccount.sol";
import {IErrantryClientSmartAccount} from "./interfaces/IErrantryClientSmartAccount.sol";
import {IErrandManager} from "./interfaces/IErrandManager.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract ErrantryClientSmartAccount is IErrantryClientSmartAccount {
constructor(
IEntryPoint _entryPoint,
address _trustedOracle
) IErrantryClientSmartAccount(_entryPoint, _trustedOracle) {}
constructor(IEntryPoint _entryPoint, address _trustedOracle)
IErrantryClientSmartAccount(_entryPoint, _trustedOracle)
{}

/* >>>>>>>> general external functions <<<<<<< */
function payErrands() external override {
_payErrands();
}

/* >>>>>>>> overridden functions <<<<<<< */
function _validateSignature(
PackedUserOperation calldata userOp,
bytes32 userOpHash
) internal override returns (uint256 validationData) {
function _validateSignature(PackedUserOperation calldata userOp, bytes32 userOpHash)
internal
override
returns (uint256 validationData)
{
bytes memory _callData = userOp.callData;
// Extract the function selector from the first 4 bytes of callData
bytes4 functionSelector;
Expand All @@ -41,7 +47,10 @@ contract ErrantryClientSmartAccount is IErrantryClientSmartAccount {
}

/* >>>>>>>> internal functions <<<<<<< */
function _checkErrandFundBalance() internal {}
function _checkErrandFundBalance(address token, uint256 requiredAmount) internal view {
uint256 balance = IERC20(token).balanceOf(address(this));
require(balance >= requiredAmount, "Insufficient token balance for errands");
}

function _payErrands() internal {}
}

0 comments on commit 54b494d

Please sign in to comment.