From ccd85893de9900838ec33ae8a515d5db10860776 Mon Sep 17 00:00:00 2001 From: woody <125113430+woodenfurniture@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:26:11 +1000 Subject: [PATCH] chore: more abi cleanup (#7745) * chore: remove redundant rfox abi * chore: remove unused abis, add as const for type safety --- packages/contracts/src/abis/arbOutbox.ts | 2 +- packages/contracts/src/abis/arbProxy.ts | 2 +- packages/contracts/src/abis/arbRetryableTx.ts | 2 +- packages/contracts/src/abis/arbSys.ts | 2 +- packages/contracts/src/abis/foxStaking.ts | 559 --------------- packages/contracts/src/abis/foxy.ts | 2 +- packages/contracts/src/abis/foxyStaking.ts | 2 +- packages/contracts/src/abis/iBep20.ts | 2 +- packages/contracts/src/abis/index.ts | 3 - .../contracts/src/abis/l1ArbitrumGateway.ts | 2 +- .../src/abis/l1OrbitCustomGateway.ts | 2 +- .../contracts/src/abis/l2ArbitrumGateway.ts | 2 +- .../contracts/src/abis/liquidityReserve.ts | 2 +- packages/contracts/src/abis/rfox.ts | 2 +- .../contracts/src/abis/shapeShiftRouter.ts | 491 ------------- packages/contracts/src/abis/tokeManager.ts | 2 +- packages/contracts/src/abis/tokePool.ts | 2 +- packages/contracts/src/abis/tokeRewardHash.ts | 2 +- .../contracts/src/abis/uniV2StakingRewards.ts | 2 +- packages/contracts/src/abis/weth.ts | 2 +- packages/contracts/src/abis/yearnVault.ts | 643 ------------------ .../Claim/hooks/useArbitrumClaimTx.tsx | 21 +- .../ChangeAddress/ChangeAddressConfirm.tsx | 4 +- .../ChangeAddress/ChangeAddressInput.tsx | 4 +- .../RFOX/components/Claim/ClaimConfirm.tsx | 4 +- .../components/Stake/hooks/useRfoxStake.tsx | 4 +- .../Unstake/hooks/useRfoxUnstake.tsx | 4 +- src/pages/RFOX/constants.ts | 16 +- .../RFOX/hooks/useCooldownPeriodQuery.ts | 4 +- src/pages/RFOX/hooks/useGetTotalStaked.ts | 4 +- .../hooks/useGetUnstakingRequestCountQuery.ts | 12 +- .../hooks/useGetUnstakingRequestsQuery.ts | 8 +- src/pages/RFOX/types.ts | 4 +- 33 files changed, 55 insertions(+), 1764 deletions(-) delete mode 100644 packages/contracts/src/abis/foxStaking.ts delete mode 100644 packages/contracts/src/abis/shapeShiftRouter.ts delete mode 100644 packages/contracts/src/abis/yearnVault.ts diff --git a/packages/contracts/src/abis/arbOutbox.ts b/packages/contracts/src/abis/arbOutbox.ts index d3f457c32e0..db951fc6b06 100644 --- a/packages/contracts/src/abis/arbOutbox.ts +++ b/packages/contracts/src/abis/arbOutbox.ts @@ -223,4 +223,4 @@ export const ARB_OUTBOX_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/arbProxy.ts b/packages/contracts/src/abis/arbProxy.ts index 04f4fe5ab35..f2afb5a4ca4 100644 --- a/packages/contracts/src/abis/arbProxy.ts +++ b/packages/contracts/src/abis/arbProxy.ts @@ -63,4 +63,4 @@ export const ARB_PROXY_ABI = [ type: 'function', }, { stateMutability: 'payable', type: 'receive' }, -] +] as const diff --git a/packages/contracts/src/abis/arbRetryableTx.ts b/packages/contracts/src/abis/arbRetryableTx.ts index fbcbe733bb0..cbf9c757c45 100644 --- a/packages/contracts/src/abis/arbRetryableTx.ts +++ b/packages/contracts/src/abis/arbRetryableTx.ts @@ -110,4 +110,4 @@ export const ARBITRUM_RETRYABLE_TX_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/arbSys.ts b/packages/contracts/src/abis/arbSys.ts index 95e2f0dd731..7673759e6cf 100644 --- a/packages/contracts/src/abis/arbSys.ts +++ b/packages/contracts/src/abis/arbSys.ts @@ -136,4 +136,4 @@ export const ARB_SYS_ABI = [ stateMutability: 'payable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/foxStaking.ts b/packages/contracts/src/abis/foxStaking.ts deleted file mode 100644 index a34064dcfb1..00000000000 --- a/packages/contracts/src/abis/foxStaking.ts +++ /dev/null @@ -1,559 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// FoxStakingV1 -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const FOX_STAKING_V1_ABI = [ - { type: 'constructor', inputs: [], stateMutability: 'nonpayable' }, - { - type: 'function', - inputs: [], - name: 'REWARD_RATE', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'UPGRADE_INTERFACE_VERSION', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'WAD', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'account', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: 'total', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'cooldownPeriod', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'account', internalType: 'address', type: 'address' }], - name: 'earned', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'account', internalType: 'address', type: 'address' }, - { name: 'index', internalType: 'uint256', type: 'uint256' }, - ], - name: 'getUnstakingRequest', - outputs: [ - { - name: '', - internalType: 'struct UnstakingRequest', - type: 'tuple', - components: [ - { - name: 'unstakingBalance', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'cooldownExpiry', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'account', internalType: 'address', type: 'address' }], - name: 'getUnstakingRequestCount', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'stakingTokenAddress', internalType: 'address', type: 'address' }], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'lastUpdateTimestamp', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'pause', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'pauseStaking', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'pauseUnstaking', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'pauseWithdrawals', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'paused', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'proxiableUUID', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'rewardPerToken', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'rewardPerTokenStored', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'newCooldownPeriod', internalType: 'uint256', type: 'uint256' }], - name: 'setCooldownPeriod', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'runeAddress', internalType: 'string', type: 'string' }], - name: 'setRuneAddress', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'runeAddress', internalType: 'string', type: 'string' }, - ], - name: 'stake', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'stakingInfo', - outputs: [ - { name: 'stakingBalance', internalType: 'uint256', type: 'uint256' }, - { name: 'unstakingBalance', internalType: 'uint256', type: 'uint256' }, - { name: 'earnedRewards', internalType: 'uint256', type: 'uint256' }, - { - name: 'rewardPerTokenStored', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'runeAddress', internalType: 'string', type: 'string' }, - ], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'stakingPaused', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'stakingToken', - outputs: [{ name: '', internalType: 'contract IERC20', type: 'address' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalCoolingDown', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [], - name: 'totalStaked', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'unpause', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'unpauseStaking', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'unpauseUnstaking', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'unpauseWithdrawals', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [{ name: 'amount', internalType: 'uint256', type: 'uint256' }], - name: 'unstake', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'unstakingPaused', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [ - { name: 'newImplementation', internalType: 'address', type: 'address' }, - { name: 'data', internalType: 'bytes', type: 'bytes' }, - ], - name: 'upgradeToAndCall', - outputs: [], - stateMutability: 'payable', - }, - { - type: 'function', - inputs: [], - name: 'version', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', - }, - { - type: 'function', - inputs: [{ name: 'index', internalType: 'uint256', type: 'uint256' }], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [], - name: 'withdrawalsPaused', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'version', - internalType: 'uint64', - type: 'uint64', - indexed: false, - }, - ], - name: 'Initialized', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'previousOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'newOwner', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'OwnershipTransferred', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'Paused', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'oldRuneAddress', - internalType: 'string', - type: 'string', - indexed: true, - }, - { - name: 'newRuneAddress', - internalType: 'string', - type: 'string', - indexed: true, - }, - ], - name: 'SetRuneAddress', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'runeAddress', - internalType: 'string', - type: 'string', - indexed: true, - }, - ], - name: 'Stake', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'isPaused', internalType: 'bool', type: 'bool', indexed: false }], - name: 'StakingPausedChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'Unpaused', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'cooldownExpiry', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Unstake', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'isPaused', internalType: 'bool', type: 'bool', indexed: false }], - name: 'UnstakingPausedChanged', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'newCooldownPeriod', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'UpdateCooldownPeriod', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'implementation', - internalType: 'address', - type: 'address', - indexed: true, - }, - ], - name: 'Upgraded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Withdraw', - }, - { - type: 'event', - anonymous: false, - inputs: [{ name: 'isPaused', internalType: 'bool', type: 'bool', indexed: false }], - name: 'WithdrawalsPausedChanged', - }, - { - type: 'error', - inputs: [{ name: 'target', internalType: 'address', type: 'address' }], - name: 'AddressEmptyCode', - }, - { - type: 'error', - inputs: [{ name: 'account', internalType: 'address', type: 'address' }], - name: 'AddressInsufficientBalance', - }, - { - type: 'error', - inputs: [{ name: 'implementation', internalType: 'address', type: 'address' }], - name: 'ERC1967InvalidImplementation', - }, - { type: 'error', inputs: [], name: 'ERC1967NonPayable' }, - { type: 'error', inputs: [], name: 'EnforcedPause' }, - { type: 'error', inputs: [], name: 'ExpectedPause' }, - { type: 'error', inputs: [], name: 'FailedInnerCall' }, - { type: 'error', inputs: [], name: 'InvalidInitialization' }, - { type: 'error', inputs: [], name: 'NotInitializing' }, - { - type: 'error', - inputs: [{ name: 'owner', internalType: 'address', type: 'address' }], - name: 'OwnableInvalidOwner', - }, - { - type: 'error', - inputs: [{ name: 'account', internalType: 'address', type: 'address' }], - name: 'OwnableUnauthorizedAccount', - }, - { type: 'error', inputs: [], name: 'ReentrancyGuardReentrantCall' }, - { - type: 'error', - inputs: [{ name: 'token', internalType: 'address', type: 'address' }], - name: 'SafeERC20FailedOperation', - }, - { type: 'error', inputs: [], name: 'UUPSUnauthorizedCallContext' }, - { - type: 'error', - inputs: [{ name: 'slot', internalType: 'bytes32', type: 'bytes32' }], - name: 'UUPSUnsupportedProxiableUUID', - }, -] as const diff --git a/packages/contracts/src/abis/foxy.ts b/packages/contracts/src/abis/foxy.ts index ea88b368a2e..448865b4145 100644 --- a/packages/contracts/src/abis/foxy.ts +++ b/packages/contracts/src/abis/foxy.ts @@ -672,4 +672,4 @@ export const FOXY_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/foxyStaking.ts b/packages/contracts/src/abis/foxyStaking.ts index e3dd288e01b..e28196c3b72 100644 --- a/packages/contracts/src/abis/foxyStaking.ts +++ b/packages/contracts/src/abis/foxyStaking.ts @@ -714,4 +714,4 @@ export const FOXY_STAKING_ABI = [ stateMutability: 'view', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/iBep20.ts b/packages/contracts/src/abis/iBep20.ts index d21731d8db2..a1b09f1ed9c 100644 --- a/packages/contracts/src/abis/iBep20.ts +++ b/packages/contracts/src/abis/iBep20.ts @@ -122,4 +122,4 @@ export const I_BEP20_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/index.ts b/packages/contracts/src/abis/index.ts index dba820ed794..1ee11c1e594 100644 --- a/packages/contracts/src/abis/index.ts +++ b/packages/contracts/src/abis/index.ts @@ -4,7 +4,6 @@ export * from './arbRetryableTx' export * from './arbSys' export * from './iBep20' export * from './farming' -export * from './foxStaking' export * from './foxy' export * from './foxyStaking' export * from './l1ArbitrumGateway' @@ -12,7 +11,6 @@ export * from './l1OrbitCustomGateway' export * from './l2ArbitrumGateway' export * from './liquidityReserve' export * from './rfox' -export * from './shapeShiftRouter' export * from './thorchainRouter' export * from './tokeManager' export * from './tokePool' @@ -23,4 +21,3 @@ export * from './iUniswapV3Pool' export * from './uniswapV3Quoter' export * from './uniV2StakingRewards' export * from './weth' -export * from './yearnVault' diff --git a/packages/contracts/src/abis/l1ArbitrumGateway.ts b/packages/contracts/src/abis/l1ArbitrumGateway.ts index 229f1ad2813..4484d04626b 100644 --- a/packages/contracts/src/abis/l1ArbitrumGateway.ts +++ b/packages/contracts/src/abis/l1ArbitrumGateway.ts @@ -253,4 +253,4 @@ export const L1_ARBITRUM_GATEWAY_ABI = [ stateMutability: 'view', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/l1OrbitCustomGateway.ts b/packages/contracts/src/abis/l1OrbitCustomGateway.ts index 2bf04f90b37..dc9ce28332d 100644 --- a/packages/contracts/src/abis/l1OrbitCustomGateway.ts +++ b/packages/contracts/src/abis/l1OrbitCustomGateway.ts @@ -372,4 +372,4 @@ export const L1_ORBIT_CUSTOM_GATEWAY_ABI = [ stateMutability: 'payable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/l2ArbitrumGateway.ts b/packages/contracts/src/abis/l2ArbitrumGateway.ts index c2f969351be..62c5c4e7855 100644 --- a/packages/contracts/src/abis/l2ArbitrumGateway.ts +++ b/packages/contracts/src/abis/l2ArbitrumGateway.ts @@ -166,4 +166,4 @@ export const L2_ARBITRUM_GATEWAY_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/liquidityReserve.ts b/packages/contracts/src/abis/liquidityReserve.ts index 5ac2e24a9c0..05b2307bf2e 100644 --- a/packages/contracts/src/abis/liquidityReserve.ts +++ b/packages/contracts/src/abis/liquidityReserve.ts @@ -544,4 +544,4 @@ export const LIQUIDITY_RESERVE_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/rfox.ts b/packages/contracts/src/abis/rfox.ts index 202adc25318..b2dfc85f35f 100644 --- a/packages/contracts/src/abis/rfox.ts +++ b/packages/contracts/src/abis/rfox.ts @@ -552,4 +552,4 @@ export const RFOX_ABI = [ inputs: [{ name: 'slot', internalType: 'bytes32', type: 'bytes32' }], name: 'UUPSUnsupportedProxiableUUID', }, -] +] as const diff --git a/packages/contracts/src/abis/shapeShiftRouter.ts b/packages/contracts/src/abis/shapeShiftRouter.ts deleted file mode 100644 index 8154fb1cac3..00000000000 --- a/packages/contracts/src/abis/shapeShiftRouter.ts +++ /dev/null @@ -1,491 +0,0 @@ -export const SHAPESHIFT_ROUTER_ABI = [ - { - inputs: [ - { - internalType: 'address', - name: 'yearnRegistry', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'vaultId', - type: 'uint256', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'latestVault', - outputs: [ - { - internalType: 'contract VaultAPI', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'migrate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'migrate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'firstVaultId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastVaultId', - type: 'uint256', - }, - ], - name: 'migrate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'numVaults', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'registry', - outputs: [ - { - internalType: 'contract RegistryAPI', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'yearnRegistry', - type: 'address', - }, - ], - name: 'setRegistry', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'firstVaultId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastVaultId', - type: 'uint256', - }, - ], - name: 'totalAssets', - outputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - ], - name: 'totalAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'totalVaultBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'firstVaultId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastVaultId', - type: 'uint256', - }, - ], - name: 'totalVaultBalance', - outputs: [ - { - internalType: 'uint256', - name: 'balance', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'deploymentId', - type: 'uint256', - }, - ], - name: 'vaults', - outputs: [ - { - internalType: 'contract VaultAPI', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'firstVaultId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastVaultId', - type: 'uint256', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] diff --git a/packages/contracts/src/abis/tokeManager.ts b/packages/contracts/src/abis/tokeManager.ts index fe1eb9962a4..81a0be56f22 100644 --- a/packages/contracts/src/abis/tokeManager.ts +++ b/packages/contracts/src/abis/tokeManager.ts @@ -505,4 +505,4 @@ export const TOKE_MANAGER_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/tokePool.ts b/packages/contracts/src/abis/tokePool.ts index b89c6f5d7f0..cf539b11f24 100644 --- a/packages/contracts/src/abis/tokePool.ts +++ b/packages/contracts/src/abis/tokePool.ts @@ -305,4 +305,4 @@ export const TOKE_POOL_ABI = [ stateMutability: 'view', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/tokeRewardHash.ts b/packages/contracts/src/abis/tokeRewardHash.ts index 5783ff8cecf..1a431ee0aa6 100644 --- a/packages/contracts/src/abis/tokeRewardHash.ts +++ b/packages/contracts/src/abis/tokeRewardHash.ts @@ -68,4 +68,4 @@ export const TOKE_REWARD_HASH_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/uniV2StakingRewards.ts b/packages/contracts/src/abis/uniV2StakingRewards.ts index e19380283fa..f56baaa4086 100644 --- a/packages/contracts/src/abis/uniV2StakingRewards.ts +++ b/packages/contracts/src/abis/uniV2StakingRewards.ts @@ -408,4 +408,4 @@ export const UNIV2_STAKING_REWARDS_ABI = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const diff --git a/packages/contracts/src/abis/weth.ts b/packages/contracts/src/abis/weth.ts index 1d16deaa155..f05a6ca6e18 100644 --- a/packages/contracts/src/abis/weth.ts +++ b/packages/contracts/src/abis/weth.ts @@ -276,4 +276,4 @@ export const WETH_ABI = [ name: 'Withdrawal', type: 'event', }, -] +] as const diff --git a/packages/contracts/src/abis/yearnVault.ts b/packages/contracts/src/abis/yearnVault.ts deleted file mode 100644 index 11d92adfbe3..00000000000 --- a/packages/contracts/src/abis/yearnVault.ts +++ /dev/null @@ -1,643 +0,0 @@ -export const YEARN_VAULT_ABI = [ - { - name: 'Transfer', - inputs: [ - { type: 'address', name: 'sender', indexed: true }, - { type: 'address', name: 'receiver', indexed: true }, - { type: 'uint256', name: 'value', indexed: false }, - ], - anonymous: false, - type: 'event', - }, - { - name: 'Approval', - inputs: [ - { type: 'address', name: 'owner', indexed: true }, - { type: 'address', name: 'spender', indexed: true }, - { type: 'uint256', name: 'value', indexed: false }, - ], - anonymous: false, - type: 'event', - }, - { - name: 'StrategyAdded', - inputs: [ - { type: 'address', name: 'strategy', indexed: true }, - { type: 'uint256', name: 'debtLimit', indexed: false }, - { type: 'uint256', name: 'rateLimit', indexed: false }, - { type: 'uint256', name: 'performanceFee', indexed: false }, - ], - anonymous: false, - type: 'event', - }, - { - name: 'StrategyReported', - inputs: [ - { type: 'address', name: 'strategy', indexed: true }, - { type: 'uint256', name: 'gain', indexed: false }, - { type: 'uint256', name: 'loss', indexed: false }, - { type: 'uint256', name: 'totalGain', indexed: false }, - { type: 'uint256', name: 'totalLoss', indexed: false }, - { type: 'uint256', name: 'totalDebt', indexed: false }, - { type: 'uint256', name: 'debtAdded', indexed: false }, - { type: 'uint256', name: 'debtLimit', indexed: false }, - ], - anonymous: false, - type: 'event', - }, - { - inputs: [ - { type: 'address', name: '_token' }, - { type: 'address', name: '_governance' }, - { type: 'address', name: '_rewards' }, - { type: 'string', name: '_nameOverride' }, - { type: 'string', name: '_symbolOverride' }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - name: 'apiVersion', - outputs: [{ type: 'string', name: '' }], - inputs: [], - stateMutability: 'pure', - type: 'function', - gas: 4489, - }, - { - name: 'setName', - outputs: [], - inputs: [{ type: 'string', name: '_name' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 106987, - }, - { - name: 'setSymbol', - outputs: [], - inputs: [{ type: 'string', name: '_symbol' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 71837, - }, - { - name: 'setGovernance', - outputs: [], - inputs: [{ type: 'address', name: '_governance' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36308, - }, - { - name: 'acceptGovernance', - outputs: [], - inputs: [], - stateMutability: 'nonpayable', - type: 'function', - gas: 36234, - }, - { - name: 'setGuestList', - outputs: [], - inputs: [{ type: 'address', name: '_guestList' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36368, - }, - { - name: 'setRewards', - outputs: [], - inputs: [{ type: 'address', name: '_rewards' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36398, - }, - { - name: 'setDepositLimit', - outputs: [], - inputs: [{ type: 'uint256', name: '_limit' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36328, - }, - { - name: 'setPerformanceFee', - outputs: [], - inputs: [{ type: 'uint256', name: '_fee' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36358, - }, - { - name: 'setManagementFee', - outputs: [], - inputs: [{ type: 'uint256', name: '_fee' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 36388, - }, - { - name: 'setGuardian', - outputs: [], - inputs: [{ type: 'address', name: '_guardian' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 37745, - }, - { - name: 'setEmergencyShutdown', - outputs: [], - inputs: [{ type: 'bool', name: '_active' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 37775, - }, - { - name: 'setWithdrawalQueue', - outputs: [], - inputs: [{ type: 'address[20]', name: '_queue' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 750044, - }, - { - name: 'transfer', - outputs: [{ type: 'bool', name: '' }], - inputs: [ - { type: 'address', name: '_to' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 76619, - }, - { - name: 'transferFrom', - outputs: [{ type: 'bool', name: '' }], - inputs: [ - { type: 'address', name: '_from' }, - { type: 'address', name: '_to' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 114054, - }, - { - name: 'approve', - outputs: [{ type: 'bool', name: '' }], - inputs: [ - { type: 'address', name: '_spender' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 38184, - }, - { - name: 'increaseAllowance', - outputs: [{ type: 'bool', name: '' }], - inputs: [ - { type: 'address', name: '_spender' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 40225, - }, - { - name: 'decreaseAllowance', - outputs: [{ type: 'bool', name: '' }], - inputs: [ - { type: 'address', name: '_spender' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 40249, - }, - { - name: 'totalAssets', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3943, - }, - { - name: 'balanceSheetOfStrategy', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'view', - type: 'function', - gas: 2448, - }, - { - name: 'totalBalanceSheet', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address[40]', name: '_strategies' }], - stateMutability: 'view', - type: 'function', - gas: 75836, - }, - { - name: 'deposit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'deposit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'uint256', name: '_amount' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'deposit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [ - { type: 'uint256', name: '_amount' }, - { type: 'address', name: '_recipient' }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'maxAvailableShares', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 356611, - }, - { - name: 'withdraw', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'withdraw', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'uint256', name: '_shares' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'withdraw', - outputs: [{ type: 'uint256', name: '' }], - inputs: [ - { type: 'uint256', name: '_shares' }, - { type: 'address', name: '_recipient' }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'pricePerShare', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 11391, - }, - { - name: 'addStrategy', - outputs: [], - inputs: [ - { type: 'address', name: '_strategy' }, - { type: 'uint256', name: '_debtLimit' }, - { type: 'uint256', name: '_rateLimit' }, - { type: 'uint256', name: '_performanceFee' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 1445692, - }, - { - name: 'updateStrategyDebtLimit', - outputs: [], - inputs: [ - { type: 'address', name: '_strategy' }, - { type: 'uint256', name: '_debtLimit' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 111466, - }, - { - name: 'updateStrategyRateLimit', - outputs: [], - inputs: [ - { type: 'address', name: '_strategy' }, - { type: 'uint256', name: '_rateLimit' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 38518, - }, - { - name: 'updateStrategyPerformanceFee', - outputs: [], - inputs: [ - { type: 'address', name: '_strategy' }, - { type: 'uint256', name: '_performanceFee' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 38542, - }, - { - name: 'migrateStrategy', - outputs: [], - inputs: [ - { type: 'address', name: '_oldVersion' }, - { type: 'address', name: '_newVersion' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 1178388, - }, - { - name: 'revokeStrategy', - outputs: [], - inputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'revokeStrategy', - outputs: [], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'addStrategyToQueue', - outputs: [], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 1195542, - }, - { - name: 'removeStrategyFromQueue', - outputs: [], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'nonpayable', - type: 'function', - gas: 23067618, - }, - { - name: 'debtOutstanding', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - }, - { - name: 'debtOutstanding', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'view', - type: 'function', - }, - { - name: 'creditAvailable', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - }, - { - name: 'creditAvailable', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'view', - type: 'function', - }, - { - name: 'availableDepositLimit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - }, - { - name: 'expectedReturn', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - }, - { - name: 'expectedReturn', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address', name: '_strategy' }], - stateMutability: 'view', - type: 'function', - }, - { - name: 'report', - outputs: [{ type: 'uint256', name: '' }], - inputs: [ - { type: 'uint256', name: '_gain' }, - { type: 'uint256', name: '_loss' }, - { type: 'uint256', name: '_debtPayment' }, - ], - stateMutability: 'nonpayable', - type: 'function', - gas: 920813, - }, - { - name: 'sweep', - outputs: [], - inputs: [{ type: 'address', name: '_token' }], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'sweep', - outputs: [], - inputs: [ - { type: 'address', name: '_token' }, - { type: 'uint256', name: '_value' }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - name: 'name', - outputs: [{ type: 'string', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 9023, - }, - { - name: 'symbol', - outputs: [{ type: 'string', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 8076, - }, - { - name: 'decimals', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2681, - }, - { - name: 'balanceOf', - outputs: [{ type: 'uint256', name: '' }], - inputs: [{ type: 'address', name: 'arg0' }], - stateMutability: 'view', - type: 'function', - gas: 2926, - }, - { - name: 'allowance', - outputs: [{ type: 'uint256', name: '' }], - inputs: [ - { type: 'address', name: 'arg0' }, - { type: 'address', name: 'arg1' }, - ], - stateMutability: 'view', - type: 'function', - gas: 3171, - }, - { - name: 'totalSupply', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2771, - }, - { - name: 'token', - outputs: [{ type: 'address', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2801, - }, - { - name: 'governance', - outputs: [{ type: 'address', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2831, - }, - { - name: 'guardian', - outputs: [{ type: 'address', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2861, - }, - { - name: 'guestList', - outputs: [{ type: 'address', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2891, - }, - { - name: 'strategies', - outputs: [ - { type: 'uint256', name: 'performanceFee' }, - { type: 'uint256', name: 'activation' }, - { type: 'uint256', name: 'debtLimit' }, - { type: 'uint256', name: 'rateLimit' }, - { type: 'uint256', name: 'lastReport' }, - { type: 'uint256', name: 'totalDebt' }, - { type: 'uint256', name: 'totalGain' }, - { type: 'uint256', name: 'totalLoss' }, - ], - inputs: [{ type: 'address', name: 'arg0' }], - stateMutability: 'view', - type: 'function', - gas: 10262, - }, - { - name: 'withdrawalQueue', - outputs: [{ type: 'address', name: '' }], - inputs: [{ type: 'uint256', name: 'arg0' }], - stateMutability: 'view', - type: 'function', - gas: 3060, - }, - { - name: 'emergencyShutdown', - outputs: [{ type: 'bool', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 2981, - }, - { - name: 'depositLimit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - }, - { - name: 'debtLimit', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3041, - }, - { - name: 'totalDebt', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3071, - }, - { - name: 'lastReport', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3101, - }, - { - name: 'rewards', - outputs: [{ type: 'address', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3131, - }, - { - name: 'managementFee', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3161, - }, - { - name: 'performanceFee', - outputs: [{ type: 'uint256', name: '' }], - inputs: [], - stateMutability: 'view', - type: 'function', - gas: 3191, - }, -] diff --git a/src/components/MultiHopTrade/components/TradeInput/components/Claim/hooks/useArbitrumClaimTx.tsx b/src/components/MultiHopTrade/components/TradeInput/components/Claim/hooks/useArbitrumClaimTx.tsx index c9b42115f2b..edc74f090fc 100644 --- a/src/components/MultiHopTrade/components/TradeInput/components/Claim/hooks/useArbitrumClaimTx.tsx +++ b/src/components/MultiHopTrade/components/TradeInput/components/Claim/hooks/useArbitrumClaimTx.tsx @@ -5,7 +5,7 @@ import { KnownChainIds } from '@shapeshiftoss/types' import { TxStatus } from '@shapeshiftoss/unchained-client' import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { useMemo } from 'react' -import type { Hash } from 'viem' +import type { Address, Hash, Hex } from 'viem' import { encodeFunctionData, getAddress } from 'viem' import { useEvmFees } from 'hooks/queries/useEvmFees' import { useWallet } from 'hooks/useWallet/useWallet' @@ -43,24 +43,23 @@ export const useArbitrumClaimTx = ( queryFn: async () => { const { event, message } = claim - const proof = await message.getOutboxProof(l2Provider) + const proof = (await message.getOutboxProof(l2Provider)) as Hex[] if (!('position' in event)) return - // nitro transaction return encodeFunctionData({ abi: ARB_OUTBOX_ABI, functionName: 'executeTransaction', args: [ proof, - event.position, - event.caller, - event.destination, - event.arbBlockNum, - event.ethBlockNum, - event.timestamp, - event.callvalue, - event.data, + event.position.toBigInt(), + event.caller as Address, + event.destination as Address, + event.arbBlockNum.toBigInt(), + event.ethBlockNum.toBigInt(), + event.timestamp.toBigInt(), + event.callvalue.toBigInt(), + event.data as Hex, ], }) }, diff --git a/src/pages/RFOX/components/ChangeAddress/ChangeAddressConfirm.tsx b/src/pages/RFOX/components/ChangeAddress/ChangeAddressConfirm.tsx index 9e3bfd729e6..80208029471 100644 --- a/src/pages/RFOX/components/ChangeAddress/ChangeAddressConfirm.tsx +++ b/src/pages/RFOX/components/ChangeAddress/ChangeAddressConfirm.tsx @@ -12,7 +12,7 @@ import { } from '@chakra-ui/react' import { fromAccountId, fromAssetId } from '@shapeshiftoss/caip' import { CONTRACT_INTERACTION } from '@shapeshiftoss/chain-adapters' -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import { useMutation } from '@tanstack/react-query' import { useCallback, useMemo } from 'react' import { useTranslate } from 'react-polyglot' @@ -86,7 +86,7 @@ export const ChangeAddressConfirm: React.FC< const callData = useMemo(() => { return encodeFunctionData({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, functionName: 'setRuneAddress', args: [confirmedQuote.newRuneAddress], }) diff --git a/src/pages/RFOX/components/ChangeAddress/ChangeAddressInput.tsx b/src/pages/RFOX/components/ChangeAddress/ChangeAddressInput.tsx index 046b60bf48c..ae233583c89 100644 --- a/src/pages/RFOX/components/ChangeAddress/ChangeAddressInput.tsx +++ b/src/pages/RFOX/components/ChangeAddress/ChangeAddressInput.tsx @@ -10,7 +10,7 @@ import { Stack, } from '@chakra-ui/react' import { fromAccountId, fromAssetId } from '@shapeshiftoss/caip' -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import { type FC, useCallback, useEffect, useMemo } from 'react' import { FormProvider, useForm, useWatch } from 'react-hook-form' import { useTranslate } from 'react-polyglot' @@ -117,7 +117,7 @@ export const ChangeAddressInput: FC & ClaimCo if (!stakingAsset) return return encodeFunctionData({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, functionName: 'withdraw', args: [BigInt(claimQuote.index)], }) diff --git a/src/pages/RFOX/components/Stake/hooks/useRfoxStake.tsx b/src/pages/RFOX/components/Stake/hooks/useRfoxStake.tsx index dc21a3f1f06..38d40238df6 100644 --- a/src/pages/RFOX/components/Stake/hooks/useRfoxStake.tsx +++ b/src/pages/RFOX/components/Stake/hooks/useRfoxStake.tsx @@ -3,7 +3,7 @@ import { Link, Text, useToast } from '@chakra-ui/react' import type { AccountId, AssetId } from '@shapeshiftoss/caip' import { fromAccountId, fromAssetId } from '@shapeshiftoss/caip' import { CONTRACT_INTERACTION } from '@shapeshiftoss/chain-adapters' -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import type { UseMutationResult } from '@tanstack/react-query' import { useMutation, type UseQueryResult } from '@tanstack/react-query' import { useMemo, useState } from 'react' @@ -115,7 +115,7 @@ export const useRfoxStake = ({ if (!(isValidStakingAmount && runeAddress && stakingAsset)) return return encodeFunctionData({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, functionName: 'stake', args: [BigInt(amountCryptoBaseUnit), runeAddress], }) diff --git a/src/pages/RFOX/components/Unstake/hooks/useRfoxUnstake.tsx b/src/pages/RFOX/components/Unstake/hooks/useRfoxUnstake.tsx index c697f224888..58d356e8cda 100644 --- a/src/pages/RFOX/components/Unstake/hooks/useRfoxUnstake.tsx +++ b/src/pages/RFOX/components/Unstake/hooks/useRfoxUnstake.tsx @@ -1,7 +1,7 @@ import type { AccountId } from '@shapeshiftoss/caip' import { type AssetId, fromAccountId, fromAssetId } from '@shapeshiftoss/caip' import { CONTRACT_INTERACTION } from '@shapeshiftoss/chain-adapters' -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import type { UseMutationResult } from '@tanstack/react-query' import { useMutation, type UseQueryResult } from '@tanstack/react-query' import { useMemo } from 'react' @@ -101,7 +101,7 @@ export const useRfoxUnstake = ({ if (!hasEnteredValue) return return encodeFunctionData({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, functionName: 'unstake', args: [BigInt(toBaseUnit(amountCryptoPrecision, stakingAsset?.precision ?? 0))], }) diff --git a/src/pages/RFOX/constants.ts b/src/pages/RFOX/constants.ts index 670e5dca01a..99639dc01cd 100644 --- a/src/pages/RFOX/constants.ts +++ b/src/pages/RFOX/constants.ts @@ -1,15 +1,11 @@ -import { - FOX_STAKING_V1_ABI, - RFOX_PROXY_CONTRACT, - viemClientByNetworkId, -} from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT, viemClientByNetworkId } from '@shapeshiftoss/contracts' import { getAbiItem, getContract } from 'viem' import { arbitrum } from 'viem/chains' -export const setRuneAddressEvent = getAbiItem({ abi: FOX_STAKING_V1_ABI, name: 'SetRuneAddress' }) -export const stakeEvent = getAbiItem({ abi: FOX_STAKING_V1_ABI, name: 'Stake' }) -export const unstakeEvent = getAbiItem({ abi: FOX_STAKING_V1_ABI, name: 'Unstake' }) -export const withdrawEvent = getAbiItem({ abi: FOX_STAKING_V1_ABI, name: 'Withdraw' }) +export const setRuneAddressEvent = getAbiItem({ abi: RFOX_ABI, name: 'SetRuneAddress' }) +export const stakeEvent = getAbiItem({ abi: RFOX_ABI, name: 'Stake' }) +export const unstakeEvent = getAbiItem({ abi: RFOX_ABI, name: 'Unstake' }) +export const withdrawEvent = getAbiItem({ abi: RFOX_ABI, name: 'Withdraw' }) export const IPFS_GATEWAY = 'https://gateway.shapeshift.com/ipfs' @@ -19,6 +15,6 @@ const client = viemClientByNetworkId[arbitrum.id] export const contract = getContract({ address: RFOX_PROXY_CONTRACT, - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, client, }) diff --git a/src/pages/RFOX/hooks/useCooldownPeriodQuery.ts b/src/pages/RFOX/hooks/useCooldownPeriodQuery.ts index 8d7a7d3c438..31db732a0e4 100644 --- a/src/pages/RFOX/hooks/useCooldownPeriodQuery.ts +++ b/src/pages/RFOX/hooks/useCooldownPeriodQuery.ts @@ -1,11 +1,11 @@ -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import { arbitrum } from 'viem/chains' import { useReadContract } from 'wagmi' import { formatSecondsToDuration } from 'lib/utils/time' export const useCooldownPeriodQuery = () => { const cooldownPeriodQuery = useReadContract({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, address: RFOX_PROXY_CONTRACT, functionName: 'cooldownPeriod', chainId: arbitrum.id, diff --git a/src/pages/RFOX/hooks/useGetTotalStaked.ts b/src/pages/RFOX/hooks/useGetTotalStaked.ts index 8befd06f4fb..50dd39264e7 100644 --- a/src/pages/RFOX/hooks/useGetTotalStaked.ts +++ b/src/pages/RFOX/hooks/useGetTotalStaked.ts @@ -1,4 +1,4 @@ -import { FOX_STAKING_V1_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT } from '@shapeshiftoss/contracts' import { arbitrum } from 'viem/chains' import { useReadContract } from 'wagmi' @@ -12,7 +12,7 @@ export const useTotalStakedQuery = ({ select, }: UseTotalStakedQueryProps) => { return useReadContract({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, address: RFOX_PROXY_CONTRACT, functionName: 'totalStaked', chainId: arbitrum.id, diff --git a/src/pages/RFOX/hooks/useGetUnstakingRequestCountQuery.ts b/src/pages/RFOX/hooks/useGetUnstakingRequestCountQuery.ts index c51d8dd78eb..27d73e1d2ef 100644 --- a/src/pages/RFOX/hooks/useGetUnstakingRequestCountQuery.ts +++ b/src/pages/RFOX/hooks/useGetUnstakingRequestCountQuery.ts @@ -1,8 +1,4 @@ -import { - FOX_STAKING_V1_ABI, - RFOX_PROXY_CONTRACT, - viemClientByNetworkId, -} from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT, viemClientByNetworkId } from '@shapeshiftoss/contracts' import { skipToken, useQuery } from '@tanstack/react-query' import type { ReadContractQueryKey } from '@wagmi/core/query' import { useMemo } from 'react' @@ -13,13 +9,13 @@ import { arbitrum } from 'viem/chains' import type { Config } from 'wagmi' type GetUnstakingRequestCountQueryKey = ReadContractQueryKey< - typeof FOX_STAKING_V1_ABI, + typeof RFOX_ABI, 'getUnstakingRequestCount', readonly [Address], Config > type UnstakingRequestCount = ReadContractReturnType< - typeof FOX_STAKING_V1_ABI, + typeof RFOX_ABI, 'getUnstakingRequestCount', readonly [Address] > @@ -54,7 +50,7 @@ export const useGetUnstakingRequestCountQuery = readContract(client, { - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, address: RFOX_PROXY_CONTRACT, functionName: 'getUnstakingRequestCount', args: [getAddress(stakingAssetAccountAddress)], diff --git a/src/pages/RFOX/hooks/useGetUnstakingRequestsQuery.ts b/src/pages/RFOX/hooks/useGetUnstakingRequestsQuery.ts index 0d755731dfe..9d7f8160194 100644 --- a/src/pages/RFOX/hooks/useGetUnstakingRequestsQuery.ts +++ b/src/pages/RFOX/hooks/useGetUnstakingRequestsQuery.ts @@ -1,8 +1,4 @@ -import { - FOX_STAKING_V1_ABI, - RFOX_PROXY_CONTRACT, - viemClientByNetworkId, -} from '@shapeshiftoss/contracts' +import { RFOX_ABI, RFOX_PROXY_CONTRACT, viemClientByNetworkId } from '@shapeshiftoss/contracts' import { skipToken, useQuery } from '@tanstack/react-query' import { useMemo } from 'react' import { getAddress, type MulticallReturnType } from 'viem' @@ -21,7 +17,7 @@ const getContracts = (stakingAssetAccountAddress: string | undefined, count: big { length: Number(count) }, (_, index) => ({ - abi: FOX_STAKING_V1_ABI, + abi: RFOX_ABI, address: RFOX_PROXY_CONTRACT, functionName: 'getUnstakingRequest', args: [getAddress(stakingAssetAccountAddress), BigInt(index)], diff --git a/src/pages/RFOX/types.ts b/src/pages/RFOX/types.ts index 4f60d297714..bfb9c2a9f23 100644 --- a/src/pages/RFOX/types.ts +++ b/src/pages/RFOX/types.ts @@ -1,4 +1,4 @@ -import type { FOX_STAKING_V1_ABI } from '@shapeshiftoss/contracts' +import type { RFOX_ABI } from '@shapeshiftoss/contracts' import type { Address, Log, ReadContractReturnType } from 'viem' import type { PartialFields } from 'lib/types' @@ -74,7 +74,7 @@ export type RFOXAccountLog = | Log export type AbiStakingInfo = ReadContractReturnType< - typeof FOX_STAKING_V1_ABI, + typeof RFOX_ABI, 'stakingInfo', readonly [Address] >