Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPM: making config public #438

Merged
merged 2 commits into from
Feb 8, 2024
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
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
Loading