Skip to content

Commit

Permalink
TPM: making config public (#438)
Browse files Browse the repository at this point in the history
* Making config public
  • Loading branch information
shahafn authored Feb 8, 2024
1 parent c1c2aab commit 626af49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/samples/TokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract TokenPaymaster is BasePaymaster, UniswapHelper, OracleHelper {
/// @notice All 'price' variables are multiplied by this value to avoid rounding up
uint256 private constant PRICE_DENOMINATOR = 1e26;

TokenPaymasterConfig private tokenPaymasterConfig;
TokenPaymasterConfig public tokenPaymasterConfig;

/// @notice Initializes the TokenPaymaster contract with the given parameters.
/// @param _token The ERC20 token used for transaction fee payments.
Expand Down
4 changes: 2 additions & 2 deletions reports/gas-checker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ token paymaster │ 1 │ 128754 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ token paymaster with diff │ 2 │ │ 6635137372
║ token paymaster with diff │ 2 │ │ 6636337384
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ token paymaster │ 10 │ 726214 │ │ ║
╟────────────────────────────────┼───────┼───────────────┼────────────────┼─────────────────────╢
║ token paymaster with diff │ 11 │ │ 6646737488
║ token paymaster with diff │ 11 │ │ 6643137452
╚════════════════════════════════╧═══════╧═══════════════╧════════════════╧═════════════════════╝

3 changes: 2 additions & 1 deletion test/samples/TokenPaymaster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ describe('TokenPaymaster', function () {

it('paymaster should reject if postOpGaSLimit is too low', async () => {
const snapshot = await ethers.provider.send('evm_snapshot', [])
const config = await paymaster.tokenPaymasterConfig()
let op = await fillUserOp({
sender: account.address,
paymaster: paymasterAddress,
paymasterVerificationGasLimit: 3e5,
paymasterPostOpGasLimit: 4000, // too low
paymasterPostOpGasLimit: config.refundPostopCost - 1, // too low
callData
}, entryPoint)
op = signUserOp(op, accountOwner, entryPoint.address, chainId)
Expand Down

0 comments on commit 626af49

Please sign in to comment.