contractCall()

contractCall is a method of launcher sdk that allows developers to call any admin related methods on the contract. It also allows developers to read or modify any ERC information of the launcher contracts.

Argumenttypedescription
methodNamestringthe name of the methods you want to call
argumentsany[]the list of arguments that need to be provided to the contract method when calling the
signerSigner?the signer instance to represent the account caller and is only required when calling the write method

Below is a list of admin methods that can be called through contractCall:

Admin Methods

grantRole

grant role(e.g: ADMIN role) to the provided address

Arguments:
  • address: a string that represents the account address
  • role: a string generated from keccak256 hashing of constant "ADMIN\_ROLE"
setFeeToken

Set the paymentToken which is used to pay erc20fee, erc721fee, erc1155fee or nativefee and set the fee amount

Argument
  • paymentToken: string, erc20 token address
  • erc20fee: string, amount of erc20fee
  • erc721fee: string, amount of erc721fee
  • erc1155fee: string, amount of erc1155fee
reclaimSupply

reclaim the airdrop supply given the id

Arguments
  • id: string, the airdrop Id
setContractUri

Change the contract URI of the multiSend contract

Argument
  • contractUri: string, the uri of the contract
setFee

set the fee to newFee

Argument
  • newFee: string, new amount of contract fee
setFeeReceiver

Change payment receiver to a new wallet address

Argument
  • walletAddress: string, new payment receiver address
renounceRole

Revokes role from account

Argument
  • account: string, the wallet address
  • role: string, a string generated from keccak256 hashing of constant "ADMIN\_ROLE"
revokeRole

Revokes role from the calling account.

Argument
  • account: string, the wallet address
  • role: string, a string generated from keccak256 hashing of constant "ADMIN\_ROLE"

Example

const paymentReceiver = <YOUR_PAYMENT_RECEIVER>
const chainId = <CHAIN_ID>
const signer = new Wallet(CONTRACT_OWNER_PRIVATE_KEY, getDefaultProvider(chainId))
await presaleSdk.contractCall("setPaymentReceiver", [paymentReceiver], signer)