SDKs@solio/coreContractsMixedTokensetTreasury

setTreasury()

function setTreasury(client, props): Promise<`0x${string}`>

Sets the treasury address of a mixed token contract.

Parameters

ParameterTypeDescription
clientWriteClientWriteClient The write client to use.
propsMixedTokenSetTreasuryPropsMixedTokenSetTreasuryProps The properties to use for setting the treasury address.
type MixedTokenSetTreasuryProps: WriteContractBaseProps & {
  address: Address;
  treasuryAddress: Address;
};

Returns

Promise<`0x${string}`>

A promise that resolves to the result of the write contract.

Example

mixed-token.ts
import { mixedToken } from '@solio/core';
import { createWalletClient, custom } from 'viem';
import { sepolia } from 'viem/chains';
const writeClient = createWalletClient({
 chain: sepolia,
 transport: custom(window.ethereum),
});
const hash = await mixedToken.write.setTreasury(writeClient, {
 address: '0x...',
 treasuryAddress: '0x...'
});
console.log(hash);