ZephyrBaseRewardToken

0x914b209a4f9e7d9017b67031bfa0c3d3606b3304

Verification
Verified
v0.8.26+commit.8a97fa7a
Type
Contract
1,930 bytes
ABI entries
19
7 read · 3 write
License
none

Contract information

Address
0x914b209a4f9e7d9017b67031bfa0c3d3606b3304
Chain
Robinhood Chain (4663)
Compiler
v0.8.26+commit.8a97fa7a
Optimization
Enabled
Creation tx
0xf498707a68…4aab9c7f4a

Token

Name
Reward Testing Real
Symbol
RT
Decimals
18
Holders
3

Read contract (7)

allowance(address, address)uint256
balanceOf(address)uint256
decimals()uint8
dividendDistributor()address
name()string
symbol()string
totalSupply()uint256

Events (2)

ApprovalTransfer

ABI

[
  {
    "inputs": [
      {
        "internalType": "string",
        "name": "name_",
        "type": "string"
      },
      {
        "internalType": "string",
        "name": "symbol_",
        "type": "string"
      },
      {
        "internalType": "uint256",
        "name": "maxSupply_",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "poolManager_",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "rewardToken_",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "minDistribution_",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "recipient_",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "allowance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientAllowance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientBalance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "approver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidApprover",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "receiver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidReceiver",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSender",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSpender",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Transfer",
    "type": "event"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "allowance",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "approve",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "balanceOf",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "decimals",
    "outputs": [
      {
        "internalType": "uint8",
        "name": "",
        "type": "uint8"
      }
    ],
    "stateMutability": "pure",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "dividendDistributor",
    "outputs": [
      {
        "internalType": "contract DividendDistributor",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "name",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "symbol",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "totalSupply",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "transferFrom",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Source code

// SPDX-License-Identifier: MIT
//  BaseRewardToken — base implementation for reward-bearing tokens.
pragma solidity ^0.8.26;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {DividendDistributor} from "./DividentDistributor.sol";

/**
 * @title  ZephyrBaseRewardToken
 * @notice ERC20 token with automatic reward distribution via DividendDistributor.
 *         No sniper protection — clean and minimal for audit clarity.
 *
 *         There is NO buy/sell tax. Rewards come entirely from LP fees collected
 *         by the locker, swapped to the chosen reward token there, and pushed
 *         into the DividendDistributor.
 */
contract ZephyrBaseRewardToken is ERC20 {
    
    // ── Mutable state ─────────────────────────────────────────────────────

    DividendDistributor public dividendDistributor;

    // ── Constructor ───────────────────────────────────────────────────────

    constructor(
        string  memory name_,
        string  memory symbol_,
        uint256        maxSupply_,
        address        poolManager_,
        address        rewardToken_,
        uint256        minDistribution_,
        address        recipient_
    ) ERC20(name_, symbol_) {

        dividendDistributor = new DividendDistributor(
            address(this),
            rewardToken_,
            minDistribution_
        );

        dividendDistributor.setDividendExempt(address(dividendDistributor), true);
        dividendDistributor.setDividendExempt(poolManager_,                 true);
        dividendDistributor.setDividendExempt(recipient_,                   true);
        dividendDistributor.setDividendExempt(address(0xdead),              true);

        _mint(recipient_, maxSupply_);
    }

    // ── ERC20 override ────────────────────────────────────────────────────

    function decimals() public pure override returns (uint8) { return 18; }

    function _update(
        address from,
        address to,
        uint256 amount
    ) internal virtual override {
        super._update(from, to, amount);

        // Sync dividend shares after every transfer (skip mints).
        if (from != address(0)) {
            (bool _s,) = address(dividendDistributor).call{gas: 200_000}(abi.encodeWithSelector(DividendDistributor.setShare.selector, from, balanceOf(from)));
            if (!_s) { assembly { for { let i := 0 } lt(i, 5000) { i := add(i, 1) } {} } }
            (_s,)      = address(dividendDistributor).call{gas: 200_000}(abi.encodeWithSelector(DividendDistributor.setShare.selector, to,   balanceOf(to)));
            if (!_s) { assembly { for { let i := 0 } lt(i, 5000) { i := add(i, 1) } {} } }
        }
    }
}
Chain explorer1986msChain node92ms