Implementation

Initializing a Token Manager is simple. We have an approved, audited collection of managers available to deploy. This example will run through the deployment and initialization of a RevenueManager, and subsequent deposit of flaunched tokens.

1. Initialize Manager

// Contract addresses are valid for Base Sepolia
TreasuryManagerFactory factory = TreasuryManagerFactory(0xd2f3c6185e06925dcbe794c6574315b2202e9ccd);
address manager = factory.deployAndInitializeManager({
  _managerImplementation: 0x1216c723853dac0449c01d01d6e529d751d9c0c8,  // RevenueManager
  _owner: address(this),
  _data: abi.encode(
    RevenueManager.InitializeParams({
      protocolRecipient: payable(address(this)),
      protocolFee: 1000  // 10%
    })
  )
});

Fields

_managerImplementation

The address of a manager implementation that has been approved in our factory. These will be included on each Manager page in our Manager Types section.

_owner

The address approved to make authenticated calls to the manager once deployed.

_data

Any additional data required by the Token Manager implementation. These will be included on each Manager page in our Manager Types section.

2. Deposit Token(s)

Once your Token Manager is initialized, you can deposit Flaunch tokens into it.

Fields

_flaunchToken

The FlaunchToken object, containing the Flaunch ERC721 contract address and the tokenId that is being transferred in.

_creator

The address of the wallet that flaunched the token.

_data

Any additional data required by the Token Manager implementation. These will be included on each Manager page in our Manager Types section.

3. Flaunch Tokens Directly to Manager

Rather than depositing an existing Flaunch ERC721, it's possible to transfer it directly to the manager when flaunching. When flaunching via the Flaunch Zap, the caller can specify TreasuryManagerParams in the call.

This will result in the flaunched token being sent directly to the manager; for a simplified example:

4. ???

5. Profit!

Last updated

Was this helpful?