Skip to content

Commit

Permalink
fix: Name minting gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Feb 29, 2024
1 parent f26866e commit f4152e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions webapp/src/components/Modals/BuyWithCryptoModal/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const useGasCost = (
if (
!shouldUseCrossChainProvider &&
wallet &&
nativeChainToken &&
getNetwork(wallet.chainId) === assetNetwork
) {
calculateGas()
Expand Down
10 changes: 4 additions & 6 deletions webapp/src/components/Modals/BuyWithCryptoModal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const estimateBuyNftGas = async (
wallet: Wallet,
asset: NFT,
order: Order
) => {
): Promise<BigNumber> => {
const networkProvider = await getNetworkProvider(selectedChain)
const provider = new ethers.providers.Web3Provider(networkProvider)

Expand All @@ -241,12 +241,10 @@ export const estimateNameMintingGas = async (
name: string,
selectedChain: ChainId,
ownerAddress: string
) => {
): Promise<BigNumber> => {
const networkProvider = await getNetworkProvider(selectedChain)
const provider = new ethers.providers.Web3Provider(networkProvider)

const contract = getContract(ContractName.DCLRegistrar, selectedChain)
const contract = getContract(ContractName.DCLControllerV2, selectedChain)
const c = new ethers.Contract(contract.address, contract.abi, provider)
const estimation = await c.estimateGas.register(ownerAddress, name)
return estimation
return c.estimateGas.register(name, ownerAddress)
}

0 comments on commit f4152e6

Please sign in to comment.