make mordor work again; tx type should be legacy

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-03-09 21:35:00 +03:00
parent 76432be4b1
commit f17d4c054f
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
7 changed files with 45 additions and 16 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.5.44",
"version": "0.5.45",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -37,15 +37,27 @@ export const isNetworkAvailable = (chainId, addressChainId) => {
}
export const isNetworkLegacy = (chainId) => {
let exists = false;
let isLegacy = false;
switch (chainId) {
case 560048:
exists = true
isLegacy = true
break;
default:
break;
}
return exists;
return isLegacy;
}
export const isNetworkLegacyType = (chainId) => {
let isLegacyType = false;
switch (chainId) {
case 63:
isLegacyType = true;
break;
default:
break;
}
return isLegacyType
}
export const networkAvgBlockSpeed = (chainId) => {

View File

@ -2,6 +2,7 @@ import { useReadContract, useReadContracts } from "wagmi";
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
import toast from "react-hot-toast";
import { isNetworkLegacyType } from "../../constants";
import { config } from "../../config";
import {
@ -321,7 +322,8 @@ const executeOnChainTransaction = async (
functionName,
args,
account,
chainId
chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);

View File

@ -4,6 +4,7 @@ import { simulateContract, writeContract, waitForTransactionReceipt } from "@wag
import toast from "react-hot-toast";
import { keccak256, stringToBytes } from 'viem'
import { isNetworkLegacyType } from "../../constants";
import { config } from "../../config";
import {
@ -544,7 +545,8 @@ export const releaseLocked = async (chainId, account, proposalId) => {
functionName: 'releaseLocked',
args: [proposalId],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -571,7 +573,8 @@ export const executeProposal = async (chainId, account, proposalId) => {
functionName: 'execute',
args: [proposalId],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -598,7 +601,8 @@ export const castVote = async (chainId, account, proposalId, support) => {
functionName: 'castVote',
args: [proposalId, support],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -629,7 +633,8 @@ export const propose = async (chainId, account, functions, description) => {
functionName: 'propose',
args: [targets, values, calldatas, description],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);

View File

@ -4,6 +4,7 @@ import toast from "react-hot-toast";
import { config } from "../../config";
import { isNetworkLegacyType } from "../../constants";
import { STAKING_ADDRESSES } from "../../constants/addresses";
import { abi as StakingAbi } from "../../abi/GhostStaking.json";
@ -248,7 +249,8 @@ const executeOnChainTransaction = async (
functionName,
args,
account,
chainId
chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);

View File

@ -4,6 +4,7 @@ import toast from "react-hot-toast";
import { getTokenAbi, getTokenAddress, getTokenDecimals } from "../helpers";
import { isNetworkLegacyType } from "../../constants";
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
import { shorten } from "../../helpers";
import { tokenNameConverter } from "../../helpers/tokenConverter";
@ -199,7 +200,8 @@ export const approveTokens = async (chainId, name, owner, spender, value) => {
functionName: 'approve',
args: [spender, value],
account: owner,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -225,7 +227,8 @@ export const mintDai = async (chainId, account, value) => {
args: [account],
account: account,
value: value,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -250,7 +253,8 @@ export const burnDai = async (chainId, account, value) => {
functionName: 'burn',
args: [value],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -275,7 +279,8 @@ export const depositNative = async (chainId, account, value) => {
functionName: 'deposit',
account: account,
chainId: chainId,
value: value
value: value,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);
@ -300,7 +305,8 @@ export const withdrawWeth = async (chainId, account, value) => {
functionName: 'withdraw',
args: [value],
account: account,
chainId: chainId
chainId: chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);

View File

@ -1,6 +1,7 @@
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
import toast from "react-hot-toast";
import { isNetworkLegacyType } from "../../constants";
import { UNISWAP_V2_ROUTER } from "../../constants/addresses";
import { abi as RouterAbi } from "../../abi/UniswapV2Router.json";
import { getTokenAddress } from "../helpers";
@ -93,7 +94,8 @@ const executeOnChainTransaction = async (
functionName,
args,
account,
chainId
chainId,
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
});
const txHash = await writeContract(config, request);