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

feat: migrate from ethers.js to viem #117

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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: 1 addition & 2 deletions backend/indexer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ponder } from "@/generated";
import { BigNumber } from "ethers";

ponder.on("EtherspotPaymaster:SponsorSuccessful", async ({ event, context }) => {
const { db, network } = context;
const { args, block, transaction, log } = event;
const time = Number(BigNumber.from(block.timestamp).toString());
const time = Number(BigInt(block.timestamp).toString());
const timestamp = new Date(time * 1000);
try {
await db.PaymasterEvent.create({
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": "1.2.9",
"version": "1.2.10",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/abi/ChainlinkOracleAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,4 @@ export default [
"stateMutability": "view",
"type": "function"
}
]
] as const
2 changes: 1 addition & 1 deletion backend/src/abi/EtherspotChainlinkOracleAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,4 @@ export default [
"stateMutability": "nonpayable",
"type": "function"
}
]
] as const;
2 changes: 1 addition & 1 deletion backend/src/abi/PimlicoAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,4 @@ export default [
stateMutability: "nonpayable",
type: "function"
}
]
] as const;
2 changes: 1 addition & 1 deletion backend/src/abi/PythOracleAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,4 +517,4 @@ export default [
"stateMutability": "payable",
"type": "function"
}
]
] as const;
14 changes: 8 additions & 6 deletions backend/src/constants/Pimlico.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const TOKEN_ADDRESS: Record<number, Record<string, string>> = {
import { Hex } from "viem"

export const TOKEN_ADDRESS: Record<number, Record<string, Hex>> = {
1: {
USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
},
Expand Down Expand Up @@ -49,7 +51,7 @@ export const NATIVE_ASSET: Record<number, string> = {
84531: "ETH"
}

export const ORACLE_ADDRESS: Record<number, Record<string, string>> = {
export const ORACLE_ADDRESS: Record<number, Record<string, Hex>> = {
1: {
ETH: "0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419",
DAI: "0xaed0c38402a5d19df6e4c03f4e2dced6e29c1ee9",
Expand Down Expand Up @@ -99,7 +101,7 @@ export const ORACLE_ADDRESS: Record<number, Record<string, string>> = {
/**
* Example Structure for adding deployed erc20 paymasters on AWS secrets manager
*/
export const CustomDeployedPaymasters: Record<number, Record<string, string>> = {
export const CustomDeployedPaymasters: Record<number, Record<string, Hex>> = {
"137": {
"USDT": "0xFB8A7D1786E01f31Fc6466A48243Ca9FF0820cCB"
},
Expand Down Expand Up @@ -140,7 +142,7 @@ export const CustomDeployedPaymasters: Record<number, Record<string, string>> =
}
}

export const PAYMASTER_ADDRESS: Record<number, Record<string, string>> = {
export const PAYMASTER_ADDRESS: Record<number, Record<string, Hex>> = {
1: {
USDC: "0x0000000000fABFA8079AB313D1D14Dcf4D15582a"
},
Expand Down Expand Up @@ -181,7 +183,7 @@ export const PAYMASTER_ADDRESS: Record<number, Record<string, string>> = {
/**
* Example Structure for adding deployed multi-token paymasters on AWS secrets manager
*/
export const MULTI_TOKEN_PAYMASTERS: Record<number, Record<string, string>> = {
export const MULTI_TOKEN_PAYMASTERS: Record<number, Record<string, Hex>> = {
"80001": {
"0x453478E2E0c846c069e544405d5877086960BEf2": "0xe85649152D15825F2226B2d9C49c07b1cd2b36C7"
},
Expand All @@ -193,7 +195,7 @@ export const MULTI_TOKEN_PAYMASTERS: Record<number, Record<string, string>> = {
/**
* Example Structure for adding deployed multi-token oracles on AWS secrets manager
*/
export const MULTI_TOKEN_ORACLES: Record<number, Record<string, string>> = {
export const MULTI_TOKEN_ORACLES: Record<number, Record<string, Hex>> = {
"80001": {
"0x453478E2E0c846c069e544405d5877086960BEf2": "0x75bDb3803d671ac3051112E8A7745fF88eEd6d94"
},
Expand Down
Loading