Skip to content

Commit

Permalink
Merge branch 'develop' into features/SMA-314-fix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem authored Nov 8, 2023
2 parents 2cc44bf + 827877c commit 5ea14b8
Show file tree
Hide file tree
Showing 55 changed files with 1,626 additions and 264 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/check_branch_name.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Branch Name
on:
create:

jobs:
check-branch-name:
runs-on: ubuntu-latest
if: github.event.ref_type == 'branch' && !contains(github.ref, 'refs/heads/main') && !contains(github.ref, 'refs/heads/develop')
steps:
- name: Check Branch Name
run: |
BRANCH_PREFIX_REGEX="^(features/|fixes/|releases/).+"
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ ! $BRANCH_NAME =~ $BRANCH_PREFIX_REGEX ]]; then
echo "Invalid branch name: $BRANCH_NAME"
echo "Branch name must start with 'features/', 'fixes/', or 'releases/'."
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ forge-cache/
typechain-types
typechain
typings
yarn-error.log

#Hardhat files
cache
Expand Down
149 changes: 0 additions & 149 deletions DerivedPriceFeedFlat.sol

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/BasePaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

/* solhint-disable reason-string */

Expand Down
7 changes: 6 additions & 1 deletion contracts/common/Errors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

contract BasePaymasterErrors {
/**
Expand All @@ -20,6 +20,11 @@ contract VerifyingPaymasterErrors {
*/
error VerifyingSignerCannotBeZero();

/**
* @notice Throws when the fee collector address provided is address(0)
*/
error FeeCollectorCannotBeZero();

/**
* @notice Throws when the paymaster address provided is address(0)
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/deployer/Create3.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

/**
@title A library for deploying contracts EIP-3171 style.
Expand Down
2 changes: 1 addition & 1 deletion contracts/deployer/Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: Unlicense
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

import "./Create3.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IWETH9.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
60 changes: 60 additions & 0 deletions contracts/interfaces/paymasters/IVerifyingSingletonPaymaster.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IVerifyingSingletonPaymaster {
event EPGasOverheadChanged(
uint256 indexed _oldValue,
uint256 indexed _newValue
);

event FixedPriceMarkupChanged(
uint32 indexed _oldValue,
uint32 indexed _newValue
);

event VerifyingSignerChanged(
address indexed _oldSigner,
address indexed _newSigner,
address indexed _actor
);

event FeeCollectorChanged(
address indexed _oldFeeCollector,
address indexed _newFeeCollector,
address indexed _actor
);
event GasDeposited(address indexed _paymasterId, uint256 indexed _value);
event GasWithdrawn(
address indexed _paymasterId,
address indexed _to,
uint256 indexed _value
);
event GasBalanceDeducted(
address indexed _paymasterId,
uint256 indexed _charge
);
event PremiumCollected(
address indexed _paymasterId,
uint256 indexed _premium
);

/**
* @dev Returns the current balance of the paymasterId(aka fundingId)
* @param paymasterId The address of the paymasterId
*/
function getBalance(
address paymasterId
) external view returns (uint256 balance);

/**
* @dev updates the verifyingSigner address
* @param _newVerifyingSigner The new verifyingSigner address
*/
function setSigner(address _newVerifyingSigner) external payable;

/**
* @dev updates the postOp + unacocunted gas overhead
* @param value The new value
*/
function setUnaccountedEPGasOverhead(uint256 value) external payable;
}
40 changes: 40 additions & 0 deletions contracts/libs/MathLib.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.20;

library MathLib {
function minuint256(
uint256 a,
uint256 b
) internal pure returns (uint256 result) {
assembly {
result := xor(b, mul(xor(b, a), gt(a, b)))
}
}

function maxuint256(
uint256 a,
uint256 b
) internal pure returns (uint256 result) {
assembly {
result := xor(a, mul(xor(a, b), gt(b, a)))
}
}

function minuint32(
uint32 a,
uint32 b
) internal pure returns (uint32 result) {
assembly {
result := xor(b, mul(xor(b, a), gt(a, b)))
}
}

function maxuint32(
uint32 a,
uint32 b
) internal pure returns (uint32 result) {
assembly {
result := xor(a, mul(xor(a, b), gt(b, a)))
}
}
}
2 changes: 1 addition & 1 deletion contracts/references/AdvancedVerifyingPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol";
import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/infinitism/OracleHelper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

/* solhint-disable not-rely-on-time */

Expand Down
2 changes: 2 additions & 0 deletions contracts/references/infinitism/SampleTokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import "./OracleHelper.sol";

// OG GSN same correlation https://github.com/opengsn/gsn/blob/master/packages/paymasters/contracts/TokenPaymaster.sol

// TODO: Update with latest contract changes and make required modifications / variations

// TODO: note https://github.com/pimlicolabs/erc20-paymaster-contracts/issues/10
// TODO: set a hard limit on how much gas a single user op may cost (postOp to fix the price)
/// @title Sample ERC-20 Token Paymaster for ERC-4337
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/infinitism/UniswapHelper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

/* solhint-disable not-rely-on-time */

Expand Down
2 changes: 1 addition & 1 deletion contracts/references/pimlico/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

interface IOracle {
function decimals() external view returns (uint8);
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/pimlico/PimlicoERC20Paymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.17;
pragma solidity ^0.8.20;

// Import the required libraries and contracts
import "@account-abstraction/contracts/core/BasePaymaster.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/soul/IPriceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

interface IPriceOracle {
function exchangePrice(
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/soul/ITokenPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

import "@account-abstraction/contracts/interfaces/IPaymaster.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/soul/PriceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

import "./IPriceOracle.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/references/soul/TokenPaymaster.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./ITokenPaymaster.sol";
Expand Down
Loading

0 comments on commit 5ea14b8

Please sign in to comment.