Skip to content

Commit

Permalink
fix upgraded contracts issue (#485)
Browse files Browse the repository at this point in the history
Co-authored-by: npty <78221556+npty@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 30, 2024
1 parent 5f5b2c0 commit 3a212b0
Show file tree
Hide file tree
Showing 75 changed files with 21,333 additions and 16,881 deletions.
9 changes: 9 additions & 0 deletions apps/maestro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @axelarjs/maestro

## 0.3.29

### Patch Changes

- [#481](https://github.com/axelarnetwork/axelarjs/pull/481) [`05e33d7645700fee93cbca0b84117fe3b26b0be2`](https://github.com/axelarnetwork/axelarjs/commit/05e33d7645700fee93cbca0b84117fe3b26b0be2) Thanks [@npty](https://github.com/npty)! - updated its and factory contract functions

- Updated dependencies [[`05e33d7645700fee93cbca0b84117fe3b26b0be2`](https://github.com/axelarnetwork/axelarjs/commit/05e33d7645700fee93cbca0b84117fe3b26b0be2)]:
- @axelarjs/evm@0.2.7

## 0.3.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/maestro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelarjs/maestro",
"version": "0.3.28",
"version": "0.3.29",
"private": true,
"publishConfig": {
"access": "restricted"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const CanonicalTokenRecovery = () => {
.map(([key, value]) => (
<li key={key}>
<span className="mr-1 font-semibold opacity-85">{key} </span>
<span>{value}</span>
<span>{value as React.ReactNode}</span>
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { INTERCHAIN_TOKEN_FACTORY_ENCODERS } from "@axelarjs/evm";
import {
INTERCHAIN_TOKEN_FACTORY_ENCODERS,
INTERCHAIN_TOKEN_SERVICE_ENCODERS,
} from "@axelarjs/evm";
import { invariant, throttle } from "@axelarjs/utils";
import { useCallback, useEffect, useMemo, useState } from "react";

import { zeroAddress, type TransactionReceipt } from "viem";
import { useAccount, useChainId, useWaitForTransactionReceipt } from "wagmi";

import {
useReadInterchainTokenFactoryInterchainTokenAddress,
useReadInterchainTokenFactoryInterchainTokenId,
useSimulateInterchainTokenFactoryMulticall,
useWriteInterchainTokenFactoryMulticall,
} from "~/lib/contracts/InterchainTokenFactory.hooks";
import { useReadInterchainTokenServiceInterchainTokenAddress } from "~/lib/contracts/InterchainTokenService.hooks";
import {
decodeDeploymentMessageId,
type DeploymentMessageId,
Expand Down Expand Up @@ -68,35 +71,26 @@ export function useDeployAndRegisterRemoteInterchainTokenMutation(
});

const { data: tokenAddress } =
useReadInterchainTokenFactoryInterchainTokenAddress({
args: INTERCHAIN_TOKEN_FACTORY_ENCODERS.interchainTokenAddress.args({
salt: input?.salt as `0x${string}`,
deployer: deployerAddress as `0x${string}`,
useReadInterchainTokenServiceInterchainTokenAddress({
args: INTERCHAIN_TOKEN_SERVICE_ENCODERS.interchainTokenAddress.args({
tokenId: tokenId as `0x${string}`,
}),
query: {
enabled: Boolean(tokenId && input?.salt && deployerAddress),
enabled: Boolean(tokenId),
},
});

const { originalChainName, destinationChainNames } = useMemo(() => {
const { destinationChainNames } = useMemo(() => {
const index = computed.indexedById;
const originalChainName =
index[input?.sourceChainId ?? chainId]?.chain_name ?? "Unknown";

return {
originalChainName,
destinationChainNames:
input?.destinationChainIds.map(
(destinationChainId) =>
index[destinationChainId]?.chain_name ?? "Unknown"
) ?? [],
};
}, [
chainId,
computed.indexedById,
input?.destinationChainIds,
input?.sourceChainId,
]);
}, [computed.indexedById, input?.destinationChainIds]);

const multicallArgs = useMemo(() => {
if (!input || !tokenId) {
Expand Down Expand Up @@ -125,14 +119,14 @@ export function useDeployAndRegisterRemoteInterchainTokenMutation(
const registerTxData = destinationChainNames.map((destinationChain, i) =>
INTERCHAIN_TOKEN_FACTORY_ENCODERS.deployRemoteInterchainToken.data({
...commonArgs,
originalChainName,
originalChainName: "",
destinationChain,
gasValue: input.remoteDeploymentGasFees?.gasFees?.[i].fee ?? 0n,
})
);

return [deployTxData, ...registerTxData];
}, [input, tokenId, destinationChainNames, originalChainName]);
}, [input, tokenId, destinationChainNames]);

const totalGasFee = input?.remoteDeploymentGasFees?.totalGasFee ?? 0n;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const RegisteredInterchainTokenCard: FC<Props> = (props) => {
balance={BigInt(balance.tokenBalance)}
isTokenOwner={balance.isTokenOwner}
isTokenPendingOnwer={balance.isTokenPendingOwner}
isTokenMinter={balance.isTokenMinter}
isTokenMinter={balance.isTokenMinter as boolean}
hasPendingOwner={balance.hasPendingOwner}
tokenId={props.tokenId}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,13 @@ export default function useRegisterRemoteInterchainTokens(
return destinationChainIds.map((chainId, i) =>
INTERCHAIN_TOKEN_FACTORY_ENCODERS.deployRemoteInterchainToken.data({
salt: tokenDeployment.salt,
originalChainName: sourceChain?.chain_name ?? "",
originalChainName: "",
minter: tokenDeployment.originalMinterAddress ?? zeroAddress,
destinationChain: chainId,
gasValue: gasFeesData.gasFees[i].fee,
})
);
}, [
destinationChainIds,
gasFeesData,
sourceChain?.chain_name,
tokenDeployment,
]);
}, [destinationChainIds, gasFeesData, tokenDeployment]);

const totalGasFee = gasFeesData?.totalGasFee ?? 0n;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ import {

export const ierc20MintableBurnableAbi = [
{
stateMutability: "nonpayable",
type: "function",
inputs: [
{ name: "from", internalType: "address", type: "address" },
{ name: "amount", internalType: "uint256", type: "uint256" },
],
name: "burn",
outputs: [],
stateMutability: "nonpayable",
},
{
stateMutability: "nonpayable",
type: "function",
inputs: [
{ name: "to", internalType: "address", type: "address" },
{ name: "amount", internalType: "uint256", type: "uint256" },
],
name: "mint",
outputs: [],
stateMutability: "nonpayable",
},
] as const;

Expand Down
Loading

0 comments on commit 3a212b0

Please sign in to comment.