DeployDividendTracker
0xb32ac9eee52440ecff43798e7b5f04bd0198e5ee
Verification
Verified
v0.8.35+commit.47b9dedd
Type
Contract
1,383 bytes
ABI entries
4
0 read · 1 write
License
none
Contract information
- Address
- 0xb32ac9eee52440ecff43798e7b5f04bd0198e5ee
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.35+commit.47b9dedd
- Optimization
- Enabled
- Creator
- 0xDb15B843A2…1703C5060f
- Creation tx
- 0xd025366c1f…dc7ebbe9b1
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
);
// Exclude standard addresses from dividends
_excludeStandardAddresses(newTracker, config.tokenContract, config.tokenOwner);
// Transfer ownership to token contract
DividendTokenDividendTracker(payable(newTracker)).transferOwnership(
config.tokenContract
);
emit TrackerDeployed(
newTracker,
config.tokenContract,
config.minimumTokenBalanceForDividends,
config.rewardTokens.length
);
}
/**
* @dev Helper function to exclude standard addresses from dividend processing
*/
function _excludeStandardAddresses(
address tracker,
address tokenContract,
address tokenOwner
) internal {
DividendTokenDividendTracker tracker_ = DividendTokenDividendTracker(payable(tracker));
// Exclude tracker itself
tracker_.excludeFromDividends(tracker);
// Exclude token contract
tracker_.excludeFromDividends(tokenContract);
// Exclude token owner
tracker_.excludeFromDividends(tokenOwner);
// Exclude dead address
tracker_.excludeFromDividends(address(0xdead));
}
}
Chain explorer1446msChain node84ms