chore(trading): update approval amount to be max uint256 (#3395)

This commit is contained in:
Matthew Russell 2023-04-07 10:33:53 -07:00 committed by GitHub
parent b570b9c4c1
commit 9229e7f686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import { isAssetTypeERC20, removeDecimal } from '@vegaprotocol/utils';
import { MaxUint256 } from '@ethersproject/constants';
import { isAssetTypeERC20 } from '@vegaprotocol/utils';
import {
EthTxStatus,
useEthereumConfig,
@ -37,10 +38,9 @@ export const useSubmitApproval = (
},
perform: () => {
if (!asset || !config) return;
const amount = removeDecimal('1000000', asset.decimals);
const id = createEthTransaction(contract, 'approve', [
config?.collateral_bridge_contract.address,
amount,
MaxUint256.toString(),
]);
setId(id);
},