make mordor work again; tx type should be legacy
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
76432be4b1
commit
f17d4c054f
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.5.44",
|
"version": "0.5.45",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -37,15 +37,27 @@ export const isNetworkAvailable = (chainId, addressChainId) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const isNetworkLegacy = (chainId) => {
|
export const isNetworkLegacy = (chainId) => {
|
||||||
let exists = false;
|
let isLegacy = false;
|
||||||
switch (chainId) {
|
switch (chainId) {
|
||||||
case 560048:
|
case 560048:
|
||||||
exists = true
|
isLegacy = true
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
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) => {
|
export const networkAvgBlockSpeed = (chainId) => {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { useReadContract, useReadContracts } from "wagmi";
|
|||||||
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
|
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
|
import { isNetworkLegacyType } from "../../constants";
|
||||||
import { config } from "../../config";
|
import { config } from "../../config";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -321,7 +322,8 @@ const executeOnChainTransaction = async (
|
|||||||
functionName,
|
functionName,
|
||||||
args,
|
args,
|
||||||
account,
|
account,
|
||||||
chainId
|
chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { simulateContract, writeContract, waitForTransactionReceipt } from "@wag
|
|||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { keccak256, stringToBytes } from 'viem'
|
import { keccak256, stringToBytes } from 'viem'
|
||||||
|
|
||||||
|
import { isNetworkLegacyType } from "../../constants";
|
||||||
import { config } from "../../config";
|
import { config } from "../../config";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -544,7 +545,8 @@ export const releaseLocked = async (chainId, account, proposalId) => {
|
|||||||
functionName: 'releaseLocked',
|
functionName: 'releaseLocked',
|
||||||
args: [proposalId],
|
args: [proposalId],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -571,7 +573,8 @@ export const executeProposal = async (chainId, account, proposalId) => {
|
|||||||
functionName: 'execute',
|
functionName: 'execute',
|
||||||
args: [proposalId],
|
args: [proposalId],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -598,7 +601,8 @@ export const castVote = async (chainId, account, proposalId, support) => {
|
|||||||
functionName: 'castVote',
|
functionName: 'castVote',
|
||||||
args: [proposalId, support],
|
args: [proposalId, support],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -629,7 +633,8 @@ export const propose = async (chainId, account, functions, description) => {
|
|||||||
functionName: 'propose',
|
functionName: 'propose',
|
||||||
args: [targets, values, calldatas, description],
|
args: [targets, values, calldatas, description],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import toast from "react-hot-toast";
|
|||||||
|
|
||||||
import { config } from "../../config";
|
import { config } from "../../config";
|
||||||
|
|
||||||
|
import { isNetworkLegacyType } from "../../constants";
|
||||||
import { STAKING_ADDRESSES } from "../../constants/addresses";
|
import { STAKING_ADDRESSES } from "../../constants/addresses";
|
||||||
import { abi as StakingAbi } from "../../abi/GhostStaking.json";
|
import { abi as StakingAbi } from "../../abi/GhostStaking.json";
|
||||||
|
|
||||||
@ -248,7 +249,8 @@ const executeOnChainTransaction = async (
|
|||||||
functionName,
|
functionName,
|
||||||
args,
|
args,
|
||||||
account,
|
account,
|
||||||
chainId
|
chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import toast from "react-hot-toast";
|
|||||||
|
|
||||||
import { getTokenAbi, getTokenAddress, getTokenDecimals } from "../helpers";
|
import { getTokenAbi, getTokenAddress, getTokenDecimals } from "../helpers";
|
||||||
|
|
||||||
|
import { isNetworkLegacyType } from "../../constants";
|
||||||
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
import { DecimalBigNumber } from "../../helpers/DecimalBigNumber";
|
||||||
import { shorten } from "../../helpers";
|
import { shorten } from "../../helpers";
|
||||||
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
import { tokenNameConverter } from "../../helpers/tokenConverter";
|
||||||
@ -199,7 +200,8 @@ export const approveTokens = async (chainId, name, owner, spender, value) => {
|
|||||||
functionName: 'approve',
|
functionName: 'approve',
|
||||||
args: [spender, value],
|
args: [spender, value],
|
||||||
account: owner,
|
account: owner,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -225,7 +227,8 @@ export const mintDai = async (chainId, account, value) => {
|
|||||||
args: [account],
|
args: [account],
|
||||||
account: account,
|
account: account,
|
||||||
value: value,
|
value: value,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -250,7 +253,8 @@ export const burnDai = async (chainId, account, value) => {
|
|||||||
functionName: 'burn',
|
functionName: 'burn',
|
||||||
args: [value],
|
args: [value],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
@ -275,7 +279,8 @@ export const depositNative = async (chainId, account, value) => {
|
|||||||
functionName: 'deposit',
|
functionName: 'deposit',
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId,
|
chainId: chainId,
|
||||||
value: value
|
value: value,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|
||||||
@ -300,7 +305,8 @@ export const withdrawWeth = async (chainId, account, value) => {
|
|||||||
functionName: 'withdraw',
|
functionName: 'withdraw',
|
||||||
args: [value],
|
args: [value],
|
||||||
account: account,
|
account: account,
|
||||||
chainId: chainId
|
chainId: chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
|
import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
|
import { isNetworkLegacyType } from "../../constants";
|
||||||
import { UNISWAP_V2_ROUTER } from "../../constants/addresses";
|
import { UNISWAP_V2_ROUTER } from "../../constants/addresses";
|
||||||
import { abi as RouterAbi } from "../../abi/UniswapV2Router.json";
|
import { abi as RouterAbi } from "../../abi/UniswapV2Router.json";
|
||||||
import { getTokenAddress } from "../helpers";
|
import { getTokenAddress } from "../helpers";
|
||||||
@ -93,7 +94,8 @@ const executeOnChainTransaction = async (
|
|||||||
functionName,
|
functionName,
|
||||||
args,
|
args,
|
||||||
account,
|
account,
|
||||||
chainId
|
chainId,
|
||||||
|
type: isNetworkLegacyType(chainId) ? 'legacy' : 'eip1559',
|
||||||
});
|
});
|
||||||
|
|
||||||
const txHash = await writeContract(config, request);
|
const txHash = await writeContract(config, request);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user