Skip to content

Commit

Permalink
fix: revoke & approve simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMasayoshi committed Jan 31, 2025
1 parent 00d5522 commit bc512dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
20 changes: 14 additions & 6 deletions apps/web/src/lib/wagmi/hooks/approvals/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ export type ERC20ApproveArgs = [Address, bigint]

export const old_erc20Abi_approve = [
{
type: 'function',
name: 'approve',
stateMutability: 'nonpayable',
constant: false,
inputs: [
{ name: '_spender', type: 'address' },
{ name: '_value', type: 'uint256' },
{
name: '_spender',
type: 'address',
},
{
name: '_value',
type: 'uint256',
},
],
outputs: [],
name: 'approve',
outputs: {},
payable: false,
stateMutability: 'nonpayable',
type: 'function',
},
] as const

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const useTokenApproval = ({
spender as Address,
approveMax ? maxUint256 : amount ? amount.quotient : 0n,
],
scopeKey: 'approve-std',
query: {
enabled: simulationEnabled && !fallback,
retry: (failureCount, error) => {
Expand Down Expand Up @@ -110,6 +111,7 @@ export const useTokenApproval = ({
spender as Address,
approveMax ? maxUint256 : amount ? amount.quotient : 0n,
],
scopeKey: 'approve-fallback',
query: {
enabled: simulationEnabled && fallback,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const useTokenRevokeApproval = ({
chainId: token?.chainId,
functionName: 'approve',
args: [spender as Address, 0n],
scopeKey: 'revoke-std',
query: {
enabled: simulationEnabled && !fallback,
retry: (failureCount, error) => {
Expand All @@ -75,6 +76,7 @@ export const useTokenRevokeApproval = ({
chainId: token?.chainId,
functionName: 'approve',
args: [spender as Address, 0n],
scopeKey: 'revoke-fallback',
query: {
enabled: simulationEnabled && fallback,
},
Expand Down

0 comments on commit bc512dc

Please sign in to comment.