chore(trading): update approval amount to be max uint256 (#3395)
This commit is contained in:
parent
b570b9c4c1
commit
9229e7f686
@ -1,4 +1,5 @@
|
|||||||
import { isAssetTypeERC20, removeDecimal } from '@vegaprotocol/utils';
|
import { MaxUint256 } from '@ethersproject/constants';
|
||||||
|
import { isAssetTypeERC20 } from '@vegaprotocol/utils';
|
||||||
import {
|
import {
|
||||||
EthTxStatus,
|
EthTxStatus,
|
||||||
useEthereumConfig,
|
useEthereumConfig,
|
||||||
@ -37,10 +38,9 @@ export const useSubmitApproval = (
|
|||||||
},
|
},
|
||||||
perform: () => {
|
perform: () => {
|
||||||
if (!asset || !config) return;
|
if (!asset || !config) return;
|
||||||
const amount = removeDecimal('1000000', asset.decimals);
|
|
||||||
const id = createEthTransaction(contract, 'approve', [
|
const id = createEthTransaction(contract, 'approve', [
|
||||||
config?.collateral_bridge_contract.address,
|
config?.collateral_bridge_contract.address,
|
||||||
amount,
|
MaxUint256.toString(),
|
||||||
]);
|
]);
|
||||||
setId(id);
|
setId(id);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user