Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## [4.1.1] - 2025-05-24
- Fixed bug of comparing chainId as string for skipping type2 to legacy txn

## [4.1.0] - 2025-05-22
### Fixes
- If `isApplicableTOAllChains` is true then dont check `enabledChains` on policy
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arka",
"version": "4.1.0",
"version": "4.1.1",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
16 changes: 7 additions & 9 deletions backend/src/paymaster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class Paymaster {
coingeckoPrice: Map<string, CoingeckoPriceCache> = new Map();
coingeckoService: CoingeckoService = new CoingeckoService();
sequelize: Sequelize;
skipType2Txns: number[];
skipType2Txns: string[];

constructor(params: ConstructorParams) {
this.feeMarkUp = ethers.utils.parseUnits(params.feeMarkUp, 'gwei');
Expand All @@ -93,9 +93,7 @@ export class Paymaster {
this.EP8_PVGL = BigNumber.from(params.ep8Pvgl);
this.MTP_PVGL = params.mtpPvgl;
this.MTP_PPGL = params.mtpPpgl;
this.skipType2Txns = params.skipType2Txns.map(
(value) => Number(value)
).filter((value) => !isNaN(value));
this.skipType2Txns = params.skipType2Txns;
}

packUint(high128: BigNumberish, low128: BigNumberish): string {
Expand Down Expand Up @@ -1132,7 +1130,7 @@ export class Paymaster {
}

let tx: providers.TransactionResponse;
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId)) {
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId.toString())) {
tx = await signer.sendTransaction({
to: paymasterAddress,
data: encodedData,
Expand Down Expand Up @@ -1185,7 +1183,7 @@ export class Paymaster {
}

let tx: providers.TransactionResponse;
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId)) {
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId.toString())) {
tx = await signer.sendTransaction({
to: paymasterAddress,
data: encodedData,
Expand Down Expand Up @@ -1249,7 +1247,7 @@ export class Paymaster {
}

let tx: providers.TransactionResponse;
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId)) {
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId.toString())) {
tx = await signer.sendTransaction({
to: paymasterAddress,
data: encodedData,
Expand Down Expand Up @@ -1312,7 +1310,7 @@ export class Paymaster {
}

let tx;
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId)) {
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId.toString())) {
tx = await contract.deploy(epAddr, signer.address, { gasPrice: feeData.gasPrice });
} else {
tx = await contract.deploy(
Expand Down Expand Up @@ -1359,7 +1357,7 @@ export class Paymaster {
}

let tx;
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId)) {
if (!feeData.maxFeePerGas || this.skipType2Txns.includes(chainId.toString())) {
tx = await contract.addStake("10", { value: ethers.utils.parseEther(amount), gasPrice: feeData.gasPrice });
} else {
tx = await contract.addStake(
Expand Down