Skip to content

Commit

Permalink
🐛 remove owner from Permit
Browse files Browse the repository at this point in the history
  • Loading branch information
sebipap committed Sep 28, 2023
1 parent 746e1b1 commit 16c365c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/getEXA/TXStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const BridgeTXStatus = () => {
const { sourceTxStatus, destinationTxStatus, sourceTransactionHash } = bridgeStatus || {
sourceTxStatus: 'PENDING',
destinationTxStatus: 'PENDING',
sourceTransactionHash: undefined,
sourceTransactionHash: tx?.hash,
};
const socketScanURL = `https://socketscan.io/tx/${sourceTransactionHash}`;
const optimisticEtherscanURL = `https://optimistic.etherscan.io/tx/${sourceTransactionHash}`;
Expand Down
9 changes: 4 additions & 5 deletions contexts/GetEXAContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
const { status, transactionHash } = await waitForTransaction({ hash });
setTX({ status: status ? 'success' : 'error', hash: transactionHash });
}
}
setTXStep(TXStep.CONFIRM);
}
} catch (err) {
Expand Down Expand Up @@ -333,7 +334,6 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
});

const permit = {
owner: walletAddress,
amount: value,
deadline,
signature,
Expand Down Expand Up @@ -414,7 +414,6 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
if (isBridge) return confirmBridge();

if (!walletAddress || !route || !swapper || !erc20?.address || !opts || !asset) return;
const { swap } = swapper.write;

setTXStep(TXStep.CONFIRM_PENDING);

Expand All @@ -427,7 +426,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
const args = [erc20.address, amount, txData, minEXA, keepETH] as const;
const gas = await swapper.estimateGas.swap(args, opts);

hash = await swap(args, {
hash = await swapper.write.swap(args, {
...opts,
gasLimit: gasLimit(gas),
});
Expand All @@ -439,7 +438,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
case 'permit': {
const args = [erc20.address, permit.value, txData, minEXA, keepETH] as const;
const gas = await swapper.estimateGas.swap(args, opts);
hash = await swap(args, {
hash = await swapper.write.swap(args, {
...opts,
gasLimit: gasLimit(gas),
});
Expand All @@ -448,7 +447,7 @@ export const GetEXAProvider: FC<PropsWithChildren> = ({ children }) => {
case 'permit2': {
const args = [erc20.address, permit.value, txData, minEXA, keepETH] as const;
const gas = await swapper.estimateGas.swap(args, opts);
hash = await swap(args, {
hash = await swapper.write.swap(args, {
...opts,
gasLimit: gasLimit(gas),
});
Expand Down
2 changes: 1 addition & 1 deletion hooks/useWeb3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const useWeb3 = (): Web3 => {
const opts = useMemo(
() =>
walletAddress
? { account: walletAddress, chain: defaultChain, value: connector?.id === 'safe' ? 0n : undefined }
? { account: walletAddress, chain: defaultChain, ...(connector?.id === 'safe' ? { value: 0n } : {}) }
: undefined,
[walletAddress, connector?.id],
);
Expand Down

0 comments on commit 16c365c

Please sign in to comment.