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.
Parameter
Argument | type | description |
---|---|---|
methodName | string | the name of the methods you want to call |
arguments | any[] | the list of arguments that need to be provided to the contract method when calling the |
signer | Signer? | 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:
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"
setPaymentToken
Set the paymenToken
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
emergencyWithdraw
Transfer the specified token stored in multisend contract to a to
address
Arguments
- token: string, an erc20 token address
- to: string, target token address
setContractUri
Change the contract URI of the multiSend contract
Argument
- contractUri: string, the uri of the contract
setERC20Fee
set the erc20 transfer fee to newTransferFee
Argument
- newTransferFee: string, new amount of erc20 transfer fee
setERC721Fee
set the erc721 transfer fee to newTransferFee
Argument
- newTransferFee: string, new amount of erc721 transfer fee
setERC1155Fee
set the erc1155 transfer fee to newTransferFee
Argument
- newTransferFee: string, new amount of erc1155 transfer fee
setNativeFee
set the native transfer fee to newTransferFee
Argument
- newTransferFee: string, new amount of native transfer fee
setPaymentReceiver
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)