Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetbout committed Apr 17, 2024
1 parent 4cbd764 commit 5af0863
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
num,
uint256,
} from "starknet";
import { ArgentSigner, KeyPair, ethAddress, loadContract, provider, randomStarknetKeyPair, strkAddress } from ".";
import { ArgentSigner, KeyPair, ethAddress, loadContract, randomStarknetKeyPair, strkAddress } from ".";
import { provider } from "./provider";

export class ArgentAccount extends Account {
// Increase the gas limit by 30% to avoid failures due to gas estimation being too low with tx v3 and transactions the use escaping
override async deployAccount(
Expand Down
1 change: 1 addition & 0 deletions lib/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export async function loadContract(contractAddress: string, retry = 0): Promise<
}
return new Contract(abi, contractAddress, provider);
} catch (e) {
console.log(`Failing to loadContract for ${contractAddress}, retrying... (${retry})`);
if (retry >= 3) {
console.log(e);
// If this isn't working we can fail
Expand Down
3 changes: 3 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import dotenv from "dotenv";
dotenv.config({ override: true });

export * from "./accounts";
export * from "./contracts";
export * from "./provider";
Expand Down
6 changes: 3 additions & 3 deletions scripts/deploy-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dotenv.config({ override: true });

// Update theses
const accountClassHash = process.env.ARGENT_CLASS_HASH;
const ethFundingAmount = BigInt(1e17);
const strkFundingAmount = BigInt(1e16);
const ethFundingAmount = BigInt(1e16);
const strkFundingAmount = BigInt(1e17);

// Fixed constants
const selfDeploy = true;
Expand Down Expand Up @@ -52,7 +52,7 @@ async function safeDeployAccount(params: DeployAccountParams, retry = 0): Promis
const { account } = await deployAccountWithoutGuardian(params);
return account;
} catch (e) {
console.log(`Failing to deploy, retrying... ${retry}`);
console.log(`Failing to deploy, retrying... (${retry})`);
if (retry >= 3) {
console.log(e);
return;
Expand Down
2 changes: 1 addition & 1 deletion scripts/fund-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function safeBalanceOf(contract: Contract, address: string, retry = 0) {
try {
return await contract.balanceOf(address);
} catch (e) {
console.log(`Failing to get balance, retrying... ${retry}`);
console.log(`Failing to get balance, retrying... (${retry})`);
if (retry >= 5) {
console.log(e);
return;
Expand Down
2 changes: 1 addition & 1 deletion scripts/stress-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const aimTPS = 3;
const timeInSeconds = 5;
const ratioTxV3 = 0.6;
const maxFee = 1e15;
const l1_gas = { max_amount: "0x100", max_price_per_unit: num.toHex(1e15) };
const l1_gas = { max_amount: "0x1000", max_price_per_unit: num.toHex(1e14) };

// Fixed constants
const v3Amount = Math.ceil(aimTPS * ratioTxV3);
Expand Down

0 comments on commit 5af0863

Please sign in to comment.