Skip to content

Commit

Permalink
add arbitrum goerli in chains config + remove hardcoded gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Jun 5, 2023
1 parent cef62aa commit 0d7576b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/components/Forward/BatchLiquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ const BatchLiquidity: React.FC = () => {

// send transaction internally calls signTransaction and sends it to connected relayer
const txHash = await smartAccount.sendUserPaidTransaction({
tx: transaction,
gasLimit: {
hex: "0xC3500",
type: "hex",
}
tx: transaction
// gasLimit, // test and fix
/* Note: after changes : if you don’t provide custom gas limit it works but internal txn fails with BSA010
require(gasleft() >= max((_tx.targetTxGas * 64) / 63,_tx.targetTxGas + 2500) + 500, "BSA010");
Expand Down
6 changes: 1 addition & 5 deletions src/components/Forward/MintNft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ const MintNftForward: React.FC = () => {

// send transaction internally calls signTransaction and sends it to connected relayer
const txHash = await smartAccount.sendUserPaidTransaction({
tx: transaction,
gasLimit: {
hex: "0xC3500",
type: "hex",
}
tx: transaction
});
console.log(txHash);

Expand Down
1 change: 1 addition & 0 deletions src/contexts/SmartAccountContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const ChainId = {
GOERLI: 5,
POLYGON_MUMBAI: 80001,
POLYGON_MAINNET: 137,
ARBITRUM_GOERLI: 421613
};

// Types
Expand Down
6 changes: 5 additions & 1 deletion src/utils/chainConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ export const ChainId = {
GOERLI: 5,
POLYGON_MUMBAI: 80001,
POLYGON_MAINNET: 137,
ARBITRUM_GOERLI: 421613,
};

export let activeChainId = ChainId.POLYGON_MUMBAI;
export let activeChainId = ChainId.ARBITRUM_GOERLI;
export const supportedChains = [
ChainId.GOERLI,
ChainId.POLYGON_MAINNET,
ChainId.POLYGON_MUMBAI,
ChainId.ARBITRUM_GOERLI
];

export const getRPCProvider = (chainId: number) => {
Expand Down Expand Up @@ -37,6 +39,8 @@ export const getExplorer = (chainId: number) => {
return "https://mumbai.polygonscan.com";
case 137:
return "https://polygonscan.com";
case 421613:
return "https://goerli.arbiscan.io/";
default:
return "https://mumbai.polygonscan.com";
}
Expand Down

0 comments on commit 0d7576b

Please sign in to comment.