Skip to content

Commit

Permalink
notes for unaccounted overhead values + update storage to memory
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Feb 12, 2024
1 parent 8c4caf6 commit fd750fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/token/oracles/OracleAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract contract OracleAggregator is Ownable, IOracleAggregator {
view
returns (uint256 tokenPrice, uint8 tokenOracleDecimals, uint8 tokenDecimals, bool isError)
{
TokenInfo storage tokenInfo = tokensInfo[token];
TokenInfo memory tokenInfo = tokensInfo[token];
tokenDecimals = tokenInfo.tokenDecimals;
uint24 priceUpdateThreshold = tokenInfo.priceUpdateThreshold;

Expand Down
14 changes: 10 additions & 4 deletions test/sponsorship-paymaster/biconomy-sponsorship-paymaster-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ describe("EntryPoint with VerifyingPaymaster Singleton", function () {
it("succeed with valid signature", async () => {
const fundingId = await offchainSigner.getAddress();

// TODO: find accurate value of unaccountedEPGasOverhead based on userOpGasPrice calculation flip (maxFeePerGas vs block.gasprice + priorityFee)

// already bit high here because of first txn
await sponsorshipPaymaster
.connect(deployer)
.setUnaccountedEPGasOverhead(35500);
.setUnaccountedEPGasOverhead(55500);

await sponsorshipPaymaster.depositFor(fundingId, {
value: ethers.utils.parseEther("1"),
Expand Down Expand Up @@ -307,9 +310,10 @@ describe("EntryPoint with VerifyingPaymaster Singleton", function () {
it("succeed with valid signature - second transaction ", async () => {
const fundingId = await offchainSigner.getAddress();

// TODO: find accurate value of unaccountedEPGasOverhead based on userOpGasPrice calculation flip (maxFeePerGas vs block.gasprice + priorityFee)
await sponsorshipPaymaster
.connect(deployer)
.setUnaccountedEPGasOverhead(18500);
.setUnaccountedEPGasOverhead(38500);

await sponsorshipPaymaster.depositFor(fundingId, {
value: ethers.utils.parseEther("1"),
Expand Down Expand Up @@ -440,9 +444,10 @@ describe("EntryPoint with VerifyingPaymaster Singleton", function () {
it("succeed with valid signature - same account - different funding id ", async () => {
const fundingId = await secondFundingId.getAddress();

// TODO: find accurate value of unaccountedEPGasOverhead based on userOpGasPrice calculation flip (maxFeePerGas vs block.gasprice + priorityFee)
await sponsorshipPaymaster
.connect(deployer)
.setUnaccountedEPGasOverhead(18500);
.setUnaccountedEPGasOverhead(38500);

await sponsorshipPaymaster.depositFor(fundingId, {
value: ethers.utils.parseEther("1"),
Expand Down Expand Up @@ -573,9 +578,10 @@ describe("EntryPoint with VerifyingPaymaster Singleton", function () {
it("fails for fundingId which does not have enough deposit", async () => {
const fundingId = await thirdFundingId.getAddress();

// TODO: find accurate value of unaccountedEPGasOverhead based on userOpGasPrice calculation flip (maxFeePerGas vs block.gasprice + priorityFee)
await sponsorshipPaymaster
.connect(deployer)
.setUnaccountedEPGasOverhead(18500);
.setUnaccountedEPGasOverhead(38500);

// do not deposit

Expand Down

0 comments on commit fd750fe

Please sign in to comment.