DeployDividendTracker

0xe7aa5baf47dd0a4a7a19aa9a78802d93d4d8191e

Verification
Verified
v0.8.35+commit.47b9dedd
Type
Contract
990 bytes
ABI entries
4
0 read · 1 write
License
none

Contract information

Address
0xe7aa5baf47dd0a4a7a19aa9a78802d93d4d8191e
Chain
Robinhood Chain (4663)
Compiler
v0.8.35+commit.47b9dedd
Optimization
Enabled
Creation tx
0xa3ad54dd7f…d7b73c4d3b

Token

Not a token

This contract does not expose ERC-20 metadata.

Read contract (0)

No read functions

The ABI is unavailable or exposes no view functions.

Events (1)

TrackerDeployed

ABI

[
  {
    "inputs": [],
    "name": "FailedDeployment",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "InsufficientBalance",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "tracker",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "tokenContract",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "minimumBalance",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "rewardTokenCount",
        "type": "uint256"
      }
    ],
    "name": "TrackerDeployed",
    "type": "event"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "address[]",
            "name": "rewardTokens",
            "type": "address[]"
          },
          {
            "internalType": "uint256",
            "name": "minimumTokenBalanceForDividends",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "v4Hook",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "tokenContract",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "tokenOwner",
            "type": "address"
          }
        ],
        "internalType": "struct DeployDividendTracker.TrackerConfig",
        "name": "config",
        "type": "tuple"
      }
    ],
    "name": "deployTracker",
    "outputs": [
      {
        "internalType": "address",
        "name": "newTracker",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;

import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {DividendTokenDividendTracker} from "./DividendTokenDividendTracker.sol";

/**
 * @title DeployDividendTracker
 * @dev Script to clone and configure a new DividendTokenDividendTracker
 */
contract DeployDividendTracker {
    address constant IMPLEMENTATION = 0x9C25B6ff9123C29D61ad8989D5F540714054f667;

    struct TrackerConfig {
        address[] rewardTokens;
        uint256 minimumTokenBalanceForDividends;
        address v4Hook;
        address tokenContract;
        address tokenOwner;
    }

    event TrackerDeployed(
        address indexed tracker,
        address indexed tokenContract,
        uint256 minimumBalance,
        uint256 rewardTokenCount
    );

    /**
     * @dev Clones and initializes a new DividendTokenDividendTracker
     * @param config Configuration struct containing all initialization parameters
     * @return newTracker Address of the newly deployed tracker
     */
    function deployTracker(TrackerConfig calldata config)
        external
        returns (address newTracker)
    {
        // Clone the implementation
        newTracker = Clones.clone(IMPLEMENTATION);

        // Initialize the tracker
        DividendTokenDividendTracker(payable(newTracker)).initialize(
            config.rewardTokens,
            config.minimumTokenBalanceForDividends,
            config.v4Hook
        );
    
        // Transfer ownership to token contract
        DividendTokenDividendTracker(payable(newTracker)).transferOwnership(
            config.tokenContract
        );

        emit TrackerDeployed(
            newTracker,
            config.tokenContract,
            config.minimumTokenBalanceForDividends,
            config.rewardTokens.length
        );
    }


}
Chain explorer1550msChain node73ms