diff --git a/clients/config/overrides.ts b/clients/config/overrides.ts new file mode 100644 index 00000000..e423164d --- /dev/null +++ b/clients/config/overrides.ts @@ -0,0 +1,7 @@ +import { CallOverrides } from "@ethersproject/contracts"; + +// https://docs.immutable.com/docs/zkEVM/architecture/gas-config +export const defaultGasOverrides: CallOverrides = { + maxPriorityFeePerGas: 10e9, // 10 Gwei + maxFeePerGas: 15e9, +}; diff --git a/clients/erc20.ts b/clients/erc20.ts index 86912527..1c1ab360 100644 --- a/clients/erc20.ts +++ b/clients/erc20.ts @@ -6,6 +6,7 @@ import { CallOverrides, PopulatedTransaction } from "@ethersproject/contracts"; import { ERC20 } from "../typechain-types/@openzeppelin/contracts/token/ERC20"; import { ERC20__factory } from "../typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory"; import { PromiseOrValue } from "../typechain-types/common"; +import { defaultGasOverrides } from "./config/overrides"; export class ERC20Client { private readonly contract: ERC20; @@ -19,7 +20,7 @@ export class ERC20Client { * @returns a promise that resolves with a BigNumber that represents the amount of tokens in existence */ public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return this.contract.connect(provider).totalSupply(overrides); + return this.contract.connect(provider).totalSupply({ ...defaultGasOverrides, ...overrides }); } /** @@ -30,7 +31,7 @@ export class ERC20Client { account: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return this.contract.connect(provider).balanceOf(account, overrides); + return this.contract.connect(provider).balanceOf(account, { ...defaultGasOverrides, ...overrides }); } /** @@ -42,7 +43,7 @@ export class ERC20Client { spender: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return this.contract.connect(provider).allowance(owner, spender, overrides); + return this.contract.connect(provider).allowance(owner, spender, { ...defaultGasOverrides, ...overrides }); } /** @@ -53,7 +54,7 @@ export class ERC20Client { amount: PromiseOrValue, overrides: Overrides & { from?: PromiseOrValue } = {} ): Promise { - return this.contract.populateTransaction.transfer(to, amount, overrides); + return this.contract.populateTransaction.transfer(to, amount, { ...defaultGasOverrides, ...overrides }); } /** @@ -64,7 +65,7 @@ export class ERC20Client { amount: PromiseOrValue, overrides: Overrides & { from?: PromiseOrValue } = {} ): Promise { - return this.contract.populateTransaction.approve(spender, amount, overrides); + return this.contract.populateTransaction.approve(spender, amount, { ...defaultGasOverrides, ...overrides }); } /** @@ -76,6 +77,6 @@ export class ERC20Client { amount: PromiseOrValue, overrides: Overrides & { from?: PromiseOrValue } = {} ): Promise { - return this.contract.populateTransaction.transferFrom(from, to, amount, overrides); + return this.contract.populateTransaction.transferFrom(from, to, amount, { ...defaultGasOverrides, ...overrides }); } } diff --git a/clients/erc721-mint-by-id.ts b/clients/erc721-mint-by-id.ts index 0735de51..d7f8df52 100644 --- a/clients/erc721-mint-by-id.ts +++ b/clients/erc721-mint-by-id.ts @@ -4,6 +4,7 @@ import type { Provider } from "@ethersproject/providers"; import { ImmutableERC721MintByID, ImmutableERC721MintByID__factory } from "../typechain-types"; import { ImmutableERC721Base } from "../typechain-types/contracts/token/erc721/preset/ImmutableERC721MintByID"; import { PromiseOrValue } from "../typechain-types/common"; +import { defaultGasOverrides } from "./config/overrides"; // Struct for specifying token IDs to mint to an address. export type IDMint = ImmutableERC721Base.IDMintStruct; @@ -30,14 +31,14 @@ export class ERC721MintByIDClient { * @returns the DEFAULT_ADMIN_ROLE as a string. */ public async DEFAULT_ADMIN_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE(overrides); + return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE({ ...defaultGasOverrides, ...overrides }); } /** * @returns the MINTER_ROLE as a string. */ public async MINTER_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).MINTER_ROLE(overrides); + return await this.contract.connect(provider).MINTER_ROLE({ ...defaultGasOverrides, ...overrides }); } /** @@ -48,28 +49,28 @@ export class ERC721MintByIDClient { owner: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).balanceOf(owner, overrides); + return await this.contract.connect(provider).balanceOf(owner, { ...defaultGasOverrides, ...overrides }); } /** * @returns the baseURI as a string. */ public async baseURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).baseURI(overrides); + return await this.contract.connect(provider).baseURI({ ...defaultGasOverrides, ...overrides }); } /** * @returns the contractURI as a string. */ public async contractURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).contractURI(overrides); + return await this.contract.connect(provider).contractURI({ ...defaultGasOverrides, ...overrides }); } /** * @returns admin addresses as an array of strings. */ public async getAdmins(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).getAdmins(overrides); + return await this.contract.connect(provider).getAdmins({ ...defaultGasOverrides, ...overrides }); } /** @@ -80,7 +81,7 @@ export class ERC721MintByIDClient { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getApproved(tokenId, overrides); + return await this.contract.connect(provider).getApproved(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -91,7 +92,7 @@ export class ERC721MintByIDClient { role: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleAdmin(role, overrides); + return await this.contract.connect(provider).getRoleAdmin(role, { ...defaultGasOverrides, ...overrides }); } /** @@ -103,7 +104,7 @@ export class ERC721MintByIDClient { index: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleMember(role, index, overrides); + return await this.contract.connect(provider).getRoleMember(role, index, { ...defaultGasOverrides, ...overrides }); } /** @@ -114,7 +115,7 @@ export class ERC721MintByIDClient { role: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleMemberCount(role, overrides); + return await this.contract.connect(provider).getRoleMemberCount(role, { ...defaultGasOverrides, ...overrides }); } /** @@ -126,7 +127,7 @@ export class ERC721MintByIDClient { account: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).hasRole(role, account, overrides); + return await this.contract.connect(provider).hasRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -138,14 +139,16 @@ export class ERC721MintByIDClient { operator: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).isApprovedForAll(owner, operator, overrides); + return await this.contract + .connect(provider) + .isApprovedForAll(owner, operator, { ...defaultGasOverrides, ...overrides }); } /** * @returns the name of the contract as a string. */ public async name(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).name(overrides); + return await this.contract.connect(provider).name({ ...defaultGasOverrides, ...overrides }); } /** @@ -156,7 +159,7 @@ export class ERC721MintByIDClient { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).ownerOf(tokenId, overrides); + return await this.contract.connect(provider).ownerOf(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -169,14 +172,14 @@ export class ERC721MintByIDClient { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).nonces(tokenId, overrides); + return await this.contract.connect(provider).nonces(tokenId, { ...defaultGasOverrides, ...overrides }); } /** * @returns the operator allowlist as a string. */ public async operatorAllowlist(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).operatorAllowlist(overrides); + return await this.contract.connect(provider).operatorAllowlist({ ...defaultGasOverrides, ...overrides }); } /** @@ -188,14 +191,16 @@ export class ERC721MintByIDClient { _salePrice: PromiseOrValue, overrides: CallOverrides = {} ): Promise<[string, BigNumber]> { - return await this.contract.connect(provider).royaltyInfo(_tokenId, _salePrice, overrides); + return await this.contract + .connect(provider) + .royaltyInfo(_tokenId, _salePrice, { ...defaultGasOverrides, ...overrides }); } /** * @returns the symbol of the contract as a string. */ public async symbol(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).symbol(overrides); + return await this.contract.connect(provider).symbol({ ...defaultGasOverrides, ...overrides }); } /** @@ -206,14 +211,14 @@ export class ERC721MintByIDClient { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).tokenURI(tokenId, overrides); + return await this.contract.connect(provider).tokenURI(tokenId, { ...defaultGasOverrides, ...overrides }); } /** * @returns returns the total amount of tokens stored by the contract. */ public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).totalSupply(overrides); + return await this.contract.connect(provider).totalSupply({ ...defaultGasOverrides, ...overrides }); } /** @@ -230,7 +235,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.approve(to, tokenId, overrides); + return await this.contract.populateTransaction.approve(to, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -247,7 +252,10 @@ export class ERC721MintByIDClient { sig: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, overrides); + return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -259,7 +267,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.burn(tokenId, overrides); + return await this.contract.populateTransaction.burn(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -271,7 +279,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.burnBatch(tokenIds, overrides); + return await this.contract.populateTransaction.burnBatch(tokenIds, { ...defaultGasOverrides, ...overrides }); } /** @@ -283,7 +291,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.grantMinterRole(user, overrides); + return await this.contract.populateTransaction.grantMinterRole(user, { ...defaultGasOverrides, ...overrides }); } /** @@ -296,7 +304,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.grantRole(role, account, overrides); + return await this.contract.populateTransaction.grantRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -309,7 +317,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.mint(to, tokenId, overrides); + return await this.contract.populateTransaction.mint(to, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -321,7 +329,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeMintBatch(mints, overrides); + return await this.contract.populateTransaction.safeMintBatch(mints, { ...defaultGasOverrides, ...overrides }); } /** @@ -334,7 +342,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeBurn(owner, tokenId, overrides); + return await this.contract.populateTransaction.safeBurn(owner, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -346,7 +354,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeBurnBatch(burns, overrides); + return await this.contract.populateTransaction.safeBurnBatch(burns, { ...defaultGasOverrides, ...overrides }); } /** @@ -359,7 +367,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.renounceRole(role, account, overrides); + return await this.contract.populateTransaction.renounceRole(role, account, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -371,7 +382,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.revokeMinterRole(user, overrides); + return await this.contract.populateTransaction.revokeMinterRole(user, { ...defaultGasOverrides, ...overrides }); } /** @@ -384,7 +395,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.revokeRole(role, account, overrides); + return await this.contract.populateTransaction.revokeRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -396,7 +407,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeTransferFromBatch(transfers, overrides); + return await this.contract.populateTransaction.safeTransferFromBatch(transfers, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -410,12 +424,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"]( - from, - to, - tokenId, - overrides - ); + return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](from, to, tokenId, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -435,7 +447,7 @@ export class ERC721MintByIDClient { to, tokenId, data, - overrides + { ...defaultGasOverrides, ...overrides } ); } @@ -449,7 +461,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides); + return await this.contract.populateTransaction.setApprovalForAll(operator, approved, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -461,7 +476,7 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides); + return await this.contract.populateTransaction.setBaseURI(baseURI_, { ...defaultGasOverrides, ...overrides }); } /** @@ -473,7 +488,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setContractURI(_contractURI, overrides); + return await this.contract.populateTransaction.setContractURI(_contractURI, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -486,7 +504,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, overrides); + return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -500,7 +521,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, overrides); + return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -514,12 +538,10 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch( - tokenIds, - receiver, - feeNumerator, - overrides - ); + return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(tokenIds, receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -531,6 +553,9 @@ export class ERC721MintByIDClient { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, overrides); + return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, { + ...defaultGasOverrides, + ...overrides, + }); } } diff --git a/clients/erc721.ts b/clients/erc721.ts index 6fa81a64..c4b32f1b 100644 --- a/clients/erc721.ts +++ b/clients/erc721.ts @@ -4,6 +4,7 @@ import type { Provider } from "@ethersproject/providers"; import { ImmutableERC721, ImmutableERC721__factory } from "../typechain-types"; import { ERC721Hybrid } from "../typechain-types/contracts/token/erc721/preset/ImmutableERC721"; import { PromiseOrValue } from "../typechain-types/common"; +import { defaultGasOverrides } from "./config/overrides"; // Struct for specifying token IDs to mint to an address, by quantity. export type Mint = ERC721Hybrid.MintStruct; @@ -33,7 +34,7 @@ export class ERC721Client { * @returns the DEFAULT_ADMIN_ROLE as a string. */ public async DEFAULT_ADMIN_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE(overrides); + return await this.contract.connect(provider).DEFAULT_ADMIN_ROLE({ ...defaultGasOverrides, ...overrides }); } /** @@ -41,14 +42,14 @@ export class ERC721Client { * @return the bytes32 domain separator */ public async DOMAIN_SEPARATOR(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).DOMAIN_SEPARATOR(overrides); + return await this.contract.connect(provider).DOMAIN_SEPARATOR({ ...defaultGasOverrides, ...overrides }); } /** * @returns the MINTER_ROLE as a string. */ public async MINTER_ROLE(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).MINTER_ROLE(overrides); + return await this.contract.connect(provider).MINTER_ROLE({ ...defaultGasOverrides, ...overrides }); } /** @@ -59,21 +60,21 @@ export class ERC721Client { owner: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).balanceOf(owner, overrides); + return await this.contract.connect(provider).balanceOf(owner, { ...defaultGasOverrides, ...overrides }); } /** * @returns the baseURI as a string. */ public async baseURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).baseURI(overrides); + return await this.contract.connect(provider).baseURI({ ...defaultGasOverrides, ...overrides }); } /** * @returns the contractURI as a string. */ public async contractURI(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).contractURI(overrides); + return await this.contract.connect(provider).contractURI({ ...defaultGasOverrides, ...overrides }); } /** @@ -94,14 +95,14 @@ export class ERC721Client { extensions: BigNumber[]; } > { - return await this.contract.connect(provider).eip712Domain(overrides); + return await this.contract.connect(provider).eip712Domain({ ...defaultGasOverrides, ...overrides }); } /** * @returns admin addresses as an array of strings. */ public async getAdmins(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).getAdmins(overrides); + return await this.contract.connect(provider).getAdmins({ ...defaultGasOverrides, ...overrides }); } /** @@ -112,7 +113,7 @@ export class ERC721Client { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getApproved(tokenId, overrides); + return await this.contract.connect(provider).getApproved(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -123,7 +124,7 @@ export class ERC721Client { role: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleAdmin(role, overrides); + return await this.contract.connect(provider).getRoleAdmin(role, { ...defaultGasOverrides, ...overrides }); } /** @@ -135,7 +136,7 @@ export class ERC721Client { index: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleMember(role, index, overrides); + return await this.contract.connect(provider).getRoleMember(role, index, { ...defaultGasOverrides, ...overrides }); } /** @@ -146,7 +147,7 @@ export class ERC721Client { role: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).getRoleMemberCount(role, overrides); + return await this.contract.connect(provider).getRoleMemberCount(role, { ...defaultGasOverrides, ...overrides }); } /** @@ -158,7 +159,7 @@ export class ERC721Client { account: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).hasRole(role, account, overrides); + return await this.contract.connect(provider).hasRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -170,14 +171,16 @@ export class ERC721Client { operator: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).isApprovedForAll(owner, operator, overrides); + return await this.contract + .connect(provider) + .isApprovedForAll(owner, operator, { ...defaultGasOverrides, ...overrides }); } /** * @returns the name of the contract as a string. */ public async name(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).name(overrides); + return await this.contract.connect(provider).name({ ...defaultGasOverrides, ...overrides }); } /** @@ -188,7 +191,7 @@ export class ERC721Client { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).ownerOf(tokenId, overrides); + return await this.contract.connect(provider).ownerOf(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -201,14 +204,14 @@ export class ERC721Client { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).nonces(tokenId, overrides); + return await this.contract.connect(provider).nonces(tokenId, { ...defaultGasOverrides, ...overrides }); } /** * @returns the operator allowlist as a string. */ public async operatorAllowlist(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).operatorAllowlist(overrides); + return await this.contract.connect(provider).operatorAllowlist({ ...defaultGasOverrides, ...overrides }); } /** @@ -220,14 +223,16 @@ export class ERC721Client { _salePrice: PromiseOrValue, overrides: CallOverrides = {} ): Promise<[string, BigNumber]> { - return await this.contract.connect(provider).royaltyInfo(_tokenId, _salePrice, overrides); + return await this.contract + .connect(provider) + .royaltyInfo(_tokenId, _salePrice, { ...defaultGasOverrides, ...overrides }); } /** * @returns the symbol of the contract as a string. */ public async symbol(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).symbol(overrides); + return await this.contract.connect(provider).symbol({ ...defaultGasOverrides, ...overrides }); } /** @@ -238,14 +243,14 @@ export class ERC721Client { tokenId: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.connect(provider).tokenURI(tokenId, overrides); + return await this.contract.connect(provider).tokenURI(tokenId, { ...defaultGasOverrides, ...overrides }); } /** * @returns returns the total amount of tokens stored by the contract. */ public async totalSupply(provider: Provider, overrides: CallOverrides = {}): Promise { - return await this.contract.connect(provider).totalSupply(overrides); + return await this.contract.connect(provider).totalSupply({ ...defaultGasOverrides, ...overrides }); } /** @@ -262,7 +267,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.approve(to, tokenId, overrides); + return await this.contract.populateTransaction.approve(to, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -279,7 +284,10 @@ export class ERC721Client { sig: PromiseOrValue, overrides: CallOverrides = {} ): Promise { - return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, overrides); + return await this.contract.populateTransaction.permit(spender, tokenId, deadline, sig, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -291,7 +299,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.burn(tokenId, overrides); + return await this.contract.populateTransaction.burn(tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -303,7 +311,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.burnBatch(tokenIds, overrides); + return await this.contract.populateTransaction.burnBatch(tokenIds, { ...defaultGasOverrides, ...overrides }); } /** @@ -316,7 +324,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeBurn(owner, tokenId, overrides); + return await this.contract.populateTransaction.safeBurn(owner, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -328,7 +336,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeBurnBatch(burns, overrides); + return await this.contract.populateTransaction.safeBurnBatch(burns, { ...defaultGasOverrides, ...overrides }); } /** @@ -340,7 +348,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.grantMinterRole(user, overrides); + return await this.contract.populateTransaction.grantMinterRole(user, { ...defaultGasOverrides, ...overrides }); } /** @@ -353,7 +361,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.grantRole(role, account, overrides); + return await this.contract.populateTransaction.grantRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -366,7 +374,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.mint(to, tokenId, overrides); + return await this.contract.populateTransaction.mint(to, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -379,7 +387,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeMint(to, tokenId, overrides); + return await this.contract.populateTransaction.safeMint(to, tokenId, { ...defaultGasOverrides, ...overrides }); } /** @@ -392,7 +400,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.mintByQuantity(to, quantity, overrides); + return await this.contract.populateTransaction.mintByQuantity(to, quantity, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -405,7 +416,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeMintByQuantity(to, quantity, overrides); + return await this.contract.populateTransaction.safeMintByQuantity(to, quantity, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -417,7 +431,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.mintBatchByQuantity(mints, overrides); + return await this.contract.populateTransaction.mintBatchByQuantity(mints, { ...defaultGasOverrides, ...overrides }); } /** @@ -429,7 +443,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeMintBatchByQuantity(mints, overrides); + return await this.contract.populateTransaction.safeMintBatchByQuantity(mints, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -441,7 +458,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.mintBatch(mints, overrides); + return await this.contract.populateTransaction.mintBatch(mints, { ...defaultGasOverrides, ...overrides }); } /** @@ -453,7 +470,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeMintBatch(mints, overrides); + return await this.contract.populateTransaction.safeMintBatch(mints, { ...defaultGasOverrides, ...overrides }); } /** @@ -466,7 +483,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.renounceRole(role, account, overrides); + return await this.contract.populateTransaction.renounceRole(role, account, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -478,7 +498,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.revokeMinterRole(user, overrides); + return await this.contract.populateTransaction.revokeMinterRole(user, { ...defaultGasOverrides, ...overrides }); } /** @@ -491,7 +511,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.revokeRole(role, account, overrides); + return await this.contract.populateTransaction.revokeRole(role, account, { ...defaultGasOverrides, ...overrides }); } /** @@ -503,7 +523,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.safeTransferFromBatch(transfers, overrides); + return await this.contract.populateTransaction.safeTransferFromBatch(transfers, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -517,12 +540,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"]( - from, - to, - tokenId, - overrides - ); + return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](from, to, tokenId, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -542,7 +563,7 @@ export class ERC721Client { to, tokenId, data, - overrides + { ...defaultGasOverrides, ...overrides } ); } @@ -556,7 +577,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides); + return await this.contract.populateTransaction.setApprovalForAll(operator, approved, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -568,7 +592,7 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides); + return await this.contract.populateTransaction.setBaseURI(baseURI_, { ...defaultGasOverrides, ...overrides }); } /** @@ -580,7 +604,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setContractURI(_contractURI, overrides); + return await this.contract.populateTransaction.setContractURI(_contractURI, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -593,7 +620,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, overrides); + return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -607,7 +637,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, overrides); + return await this.contract.populateTransaction.setNFTRoyaltyReceiver(tokenId, receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -621,12 +654,10 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch( - tokenIds, - receiver, - feeNumerator, - overrides - ); + return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(tokenIds, receiver, feeNumerator, { + ...defaultGasOverrides, + ...overrides, + }); } /** @@ -638,6 +669,9 @@ export class ERC721Client { from?: PromiseOrValue; } = {} ): Promise { - return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, overrides); + return await this.contract.populateTransaction.setOperatorAllowlistRegistry(_operatorAllowlist, { + ...defaultGasOverrides, + ...overrides, + }); } }