Skip to content

Commit

Permalink
Fix BalanceManager withdrawal issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NiftyAndy committed Jun 20, 2024
1 parent dea61f0 commit 6c1847d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ const HistoryTable = ({

const handleRetryWithdraw = async (data: { amount: number; expire_at: number; signature: string }) => {
const { amount, expire_at, signature } = data;
const res = await tx(
writeContracts[GAME_ACCOUNT_CONTRACT].withdraw(parseEther(`${amount}`), BigInt(nonce), expire_at, signature),
);
if (res) resetForm();
const contract = writeContracts[GAME_ACCOUNT_CONTRACT];
await tx(contract.withdraw(parseEther(`${amount}`), nonce, expire_at, signature));
resetForm();
};

return (
Expand Down
5 changes: 2 additions & 3 deletions apps/app/src/app/(public-routes)/raffle/MyNFTL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ const MyNFTL = (): JSX.Element => {
signature: string;
nonce: number;
};
const txRes = await tx(
writeContracts[GAME_ACCOUNT_CONTRACT].withdraw(amountWEI, BigInt(nonce), expire_at, signature),
);
const contract = writeContracts[GAME_ACCOUNT_CONTRACT];
const txRes = await tx(contract.withdraw(amountWEI, nonce, expire_at, signature));
// eslint-disable-next-line no-console
if (DEBUG) console.log('TX_DATA', txRes);
refreshNFTLBalance();
Expand Down
5 changes: 5 additions & 0 deletions apps/app/src/constants/contracts/deployments.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,11 @@ export default {
name: '_nonce',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_expireAt',
type: 'uint256',
},
{
internalType: 'bytes',
name: '_signature',
Expand Down

0 comments on commit 6c1847d

Please sign in to comment.