diff --git a/contracts/base/BasePaymaster.sol b/contracts/base/BasePaymaster.sol index cbab46b..25ca1a6 100644 --- a/contracts/base/BasePaymaster.sol +++ b/contracts/base/BasePaymaster.sol @@ -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"; @@ -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; } diff --git a/contracts/sponsorship/SponsorshipPaymasterWithPremium.sol b/contracts/sponsorship/SponsorshipPaymasterWithPremium.sol index d999da0..b4c90c0 100644 --- a/contracts/sponsorship/SponsorshipPaymasterWithPremium.sol +++ b/contracts/sponsorship/SponsorshipPaymasterWithPremium.sol @@ -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 @@ -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); } /**