-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Filipp Makarov
authored and
Filipp Makarov
committed
Nov 22, 2024
1 parent
4341bed
commit 950b583
Showing
8 changed files
with
89 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: Unlicensed | ||
pragma solidity ^0.8.27; | ||
|
||
import { TokenPaymasterParserLib } from "../../contracts/libraries/TokenPaymasterParserLib.sol"; | ||
import { IBiconomyTokenPaymaster } from "../../contracts/interfaces/IBiconomyTokenPaymaster.sol"; | ||
|
||
library PaymasterParserLibExposed { | ||
using TokenPaymasterParserLib for bytes; | ||
|
||
function parsePaymasterAndData(bytes calldata paymasterAndData) public pure returns (IBiconomyTokenPaymaster.PaymasterMode mode, bytes calldata modeSpecificData) { | ||
return paymasterAndData.parsePaymasterAndData(); | ||
} | ||
|
||
function parseExternalModeSpecificData(bytes calldata modeSpecificData) public pure returns ( | ||
uint48 validUntil, | ||
uint48 validAfter, | ||
address tokenAddress, | ||
uint256 tokenPrice, | ||
uint32 externalPriceMarkup, | ||
bytes calldata signature | ||
) { | ||
return modeSpecificData.parseExternalModeSpecificData(); | ||
} | ||
|
||
function parseIndependentModeSpecificData(bytes calldata modeSpecificData) public pure returns (address tokenAddress) { | ||
return modeSpecificData.parseIndependentModeSpecificData(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: Unlicensed | ||
pragma solidity ^0.8.27; | ||
|
||
import { PaymasterParserLibExposed } from "./PaymasterParserLibExposed.sol"; | ||
import { IBiconomyTokenPaymaster } from "../../contracts/interfaces/IBiconomyTokenPaymaster.sol"; | ||
|
||
contract PaymasterParserLibWrapper { | ||
using PaymasterParserLibExposed for bytes; | ||
|
||
function parsePaymasterAndData(bytes calldata paymasterAndData) external pure returns (IBiconomyTokenPaymaster.PaymasterMode mode, bytes memory modeSpecificData) { | ||
(mode, modeSpecificData) = paymasterAndData.parsePaymasterAndData(); | ||
} | ||
|
||
function parseExternalModeSpecificData(bytes calldata modeSpecificData) external pure returns ( | ||
uint48 validUntil, | ||
uint48 validAfter, | ||
address tokenAddress, | ||
uint256 tokenPrice, | ||
uint32 externalPriceMarkup, | ||
bytes memory signature | ||
) { | ||
(validUntil, validAfter, tokenAddress, tokenPrice, externalPriceMarkup, signature) = modeSpecificData.parseExternalModeSpecificData(); | ||
} | ||
|
||
function parseIndependentModeSpecificData(bytes calldata modeSpecificData) external pure returns (address tokenAddress) { | ||
tokenAddress = modeSpecificData.parseIndependentModeSpecificData(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters