Skip to content

Commit

Permalink
use solady ownable
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Mar 22, 2024
1 parent 4f7596e commit 2d832cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions contracts/base/BasePaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.24;

/* solhint-disable reason-string */

import "@openzeppelin/contracts/access/Ownable.sol";
import { SoladyOwnable } from "../utils/SoladyOwnable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { IPaymaster } from "account-abstraction/contracts/interfaces/IPaymaster.sol";
import { IEntryPoint } from "account-abstraction/contracts/interfaces/IEntryPoint.sol";
Expand All @@ -13,14 +13,14 @@ import "account-abstraction/contracts/core/UserOperationLib.sol";
* provides helper methods for staking.
* Validates that the postOp is called only by the entryPoint.
*/
abstract contract BasePaymaster is IPaymaster, Ownable {
abstract contract BasePaymaster is IPaymaster, SoladyOwnable {
IEntryPoint public immutable entryPoint;

uint256 internal constant PAYMASTER_VALIDATION_GAS_OFFSET = UserOperationLib.PAYMASTER_VALIDATION_GAS_OFFSET;
uint256 internal constant PAYMASTER_POSTOP_GAS_OFFSET = UserOperationLib.PAYMASTER_POSTOP_GAS_OFFSET;
uint256 internal constant PAYMASTER_DATA_OFFSET = UserOperationLib.PAYMASTER_DATA_OFFSET;

constructor(IEntryPoint _entryPoint) Ownable(msg.sender) {
constructor(address _owner, IEntryPoint _entryPoint) SoladyOwnable(_owner) {
_validateEntryPointInterface(_entryPoint);
entryPoint = _entryPoint;
}
Expand Down
10 changes: 1 addition & 9 deletions contracts/sponsorship/SponsorshipPaymasterWithPremium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeTransferLib } from "solady/src/utils/SafeTransferLib.sol";
import { IBiconomySponsorshipPaymaster } from "../interfaces/IBiconomySponsorshipPaymaster.sol";

// possiblity (conflicts with BasePaymaster which is also Ownbale) // either make BasePaymaster SoladyOwnable
// import { SoladyOwnable } from "../utils/SoladyOwnable.sol";

/**
* @title BiconomySponsorshipPaymaster
* @author livingrockrises<[email protected]>
Expand All @@ -43,18 +40,13 @@ contract BiconomySponsorshipPaymaster is BasePaymaster, ReentrancyGuard, Biconom
// note: could rename to PAYMASTER_ID_OFFSET
uint256 private constant VALID_PND_OFFSET = PAYMASTER_DATA_OFFSET;

// temp
// paymasterAndData: paymaster address + paymaster gas limits + paymasterData
// paymasterData: concat of [paymasterId(20 bytes), validUntil(6 bytes), validAfter(6 bytes), priceMarkup(4 bytes), signature]

mapping(address => uint256) public paymasterIdBalances;

constructor(address _owner, IEntryPoint _entryPoint, address _verifyingSigner, address _feeCollector) BasePaymaster(_entryPoint) {
constructor(address _owner, IEntryPoint _entryPoint, address _verifyingSigner, address _feeCollector) BasePaymaster(_owner, _entryPoint) {
// TODO
// Check for zero address
verifyingSigner = _verifyingSigner;
feeCollector = _feeCollector;
_transferOwnership(_owner);
}

/**
Expand Down

0 comments on commit 2d832cc

Please sign in to comment.