Skip to content

Commit

Permalink
fix: temporary fix for fuse gas issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed Jul 31, 2024
1 parent 4da51ff commit f069b01
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-v2/src/sdk/base/hooks/useGasFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useGasFees = () => {
//force gas price for celo and ethereum
switch (chainId) {
case 122:
return BigNumber.from(10e9);
return BigNumber.from(20e9);
case 42220:
return BigNumber.from(5e9);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/contracts/FuseUniswapContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export async function swap(
const { methodName, args, value } = parameters;

const req = contract.methods[methodName](...args).send({
...{ gasPrice: "10000000000" },
...{ gasPrice: 20e9 },
...(value && !isZero(value) ? { value, from: account } : { from: account })
});

Expand Down
12 changes: 5 additions & 7 deletions packages/sdk/src/core/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,9 +802,7 @@ export async function approveStake(
const req = ERC20Contract(web3, token.address)
.methods.approve(spender, MaxApproveValue.toString())
.send({
...(protocol !== LIQUIDITY_PROTOCOL.GOODDAO
? { from: account, type: "0x2" }
: { from: account, gasPrice: "10000000000" })
...(protocol !== LIQUIDITY_PROTOCOL.GOODDAO ? { from: account, type: "0x2" } : { from: account, gasPrice: 20e9 })
});

if (onSent) req.on("transactionHash", onSent);
Expand Down Expand Up @@ -834,7 +832,7 @@ export async function stakeGov(
const account = await getAccount(web3);

const tokenAmount = amount.toBigNumber(token.decimals);
const req = contract.methods.stake(tokenAmount).send({ from: account, gasPrice: "10000000000" });
const req = contract.methods.stake(tokenAmount).send({ from: account, gasPrice: 20e9 });

if (onSent) req.on("transactionHash", (hash: string) => onSent(hash, account));

Expand Down Expand Up @@ -908,7 +906,7 @@ export async function withdraw(

let req;
if (stake.protocol === LIQUIDITY_PROTOCOL.GOODDAO) {
req = contract.methods.withdrawStake(toWithdraw).send({ from: account, gasPrice: "10000000000" });
req = contract.methods.withdrawStake(toWithdraw).send({ from: account, gasPrice: 20e9 });
} else
req = contract.methods.withdrawStake(toWithdraw, withdrawIntoInterestToken).send({
from: account,
Expand Down Expand Up @@ -963,7 +961,7 @@ export async function claimGoodRewards(
const transactions: any[] = [];
if (chainId === SupportedChainId.FUSE) {
const contract = governanceStakingContract(web3);
transactions.push(contract.methods.withdrawRewards().send({ from: account, gasPrice: "10000000000" }));
transactions.push(contract.methods.withdrawRewards().send({ from: account, gasPrice: 20e9 }));
} else {
const stakersDistribution = await stakersDistributionContract(web3);
const simpleStakingReleases = await getSimpleStakingContractAddressesV3(web3);
Expand Down Expand Up @@ -1006,7 +1004,7 @@ export async function claimGoodReward(
const transactions: any[] = [];
if (chainId === SupportedChainId.FUSE) {
const contract = governanceStakingContract(web3);
transactions.push(contract.methods.withdrawRewards().send({ from: account, gasPrice: "10000000000" }));
transactions.push(contract.methods.withdrawRewards().send({ from: account, gasPrice: 20e9 }));
} else {
const stakersDistribution = await stakersDistributionContract(web3);

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/core/ubi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function claim(web3: Web3, account: string): Promise<void> {
await validateChainId(web3);

const contract = await ubiSchemeContract(web3);
return contract.methods.claim().send({ from: account, gasPrice: "10000000000" });
return contract.methods.claim().send({ from: account, gasPrice: 20e9 });
}

/**
Expand Down

0 comments on commit f069b01

Please sign in to comment.