More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
4078047 | 13 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
FeeRecipient
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 1633 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; import {IFeeDistributor} from "./interfaces/IFeeDistributor.sol"; import {IFeeRecipient} from "./interfaces/IFeeRecipient.sol"; import {IFeeRecipientFactory} from "./interfaces/IFeeRecipientFactory.sol"; /// @notice Pair Fees contract is used as a 1:1 pair relationship to split out fees, this ensures that the curve does not need to be modified for LP shares contract FeeRecipient is IFeeRecipient { /// @notice The pair it is bonded to address public immutable pair; /// @notice voter contract which fees are gated to be claimed by address public immutable voter; /// @notice feedist contract where fees will be sent to address public feeDistributor; /// @notice factory contract for feeRecipient (legacy fees) address public immutable feeRecipientFactory; constructor(address _pair, address _voter, address _feeRecipientFactory) { pair = _pair; voter = _voter; feeRecipientFactory = _feeRecipientFactory; } /// @notice initialize the FeeRecipient contract and approve the LP tokens to the feeDist, gated to voter function initialize(address _feeDistributor) external { require(msg.sender == voter, NOT_AUTHORIZED()); feeDistributor = _feeDistributor; IERC20(pair).approve(_feeDistributor, type(uint256).max); } /// @notice notifies the fees function notifyFees() external { /// @dev limit calling notifyFees() to the voter contract require(msg.sender == voter, NOT_AUTHORIZED()); /// @dev fetch balance of LP in the contract uint256 amount = IERC20(pair).balanceOf(address(this)); /// @dev terminate early if there's no rewards if (amount == 0) return; /// @dev calculate treasury share uint256 feeToTreasury = IFeeRecipientFactory(feeRecipientFactory) .feeToTreasury(); /// @dev if any to treasury if (feeToTreasury > 0) { /// @dev fetch treasury from factory address treasury = IFeeRecipientFactory(feeRecipientFactory) .treasury(); /// @dev mulDiv uint256 amountToTreasury = (amount * feeToTreasury) / 10_000; /// @dev decrement amount amount -= amountToTreasury; /// @dev naked transfer to treasury, no staking IERC20(pair).transfer(treasury, amountToTreasury); } /// @dev if there's any fees if (amount > 0) { IFeeDistributor(feeDistributor).notifyRewardAmount(pair, amount); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.26; interface IFeeDistributor { error NOT_AUTHORIZED(); error ZERO_AMOUNT(); error NOT_FINALIZED(); error TOKEN_ERROR(address); event Deposit(address owner, uint256 amount); event Withdraw(address owner, uint256 amount); event NotifyReward( address indexed from, address indexed reward, uint256 amount, uint256 period ); event VotesIncentivized( address indexed from, address indexed reward, uint256 amount, uint256 period ); event ClaimRewards( uint256 period, address owner, address receiver, address reward, uint256 amount ); event RewardsRemoved(address _reward); /// @notice the address of the voter contract function voter() external view returns (address); /// @notice the address of the voting module function voteModule() external view returns (address); /// @notice the address of the feeRecipient contract function feeRecipient() external view returns (address); /// @notice the first period (epoch) that this contract was deployed function firstPeriod() external view returns (uint256); /// @notice balance of the voting power for a user /// @param owner the owner /// @return amount the amount of voting share function balanceOf(address owner) external view returns (uint256 amount); /// @notice total cumulative amount of voting power per epoch /// @param period the period to check /// @return weight the amount of total voting power function votes(uint256 period) external view returns (uint256 weight); /// @notice "internal" function gated to voter to add votes /// @dev internal notation inherited from original solidly, kept for continuity function _deposit(uint256 amount, address owner) external; /// @notice "internal" function gated to voter to remove votes /// @dev internal notation inherited from original solidly, kept for continuity function _withdraw(uint256 amount, address owner) external; /// @notice function to claim rewards on behalf of another /// @param owner owner's address /// @param tokens an array of the tokens function getRewardForOwner(address owner, address[] memory tokens) external; /// @notice function for sending fees directly to be claimable (in system where fees are distro'd through the week) /// @dev for lumpsum - this would operate similarly to incentivize /// @param token the address of the token to send for notifying /// @param amount the amount of token to send function notifyRewardAmount(address token, uint256 amount) external; /// @notice gives an array of reward tokens for the feedist /// @return _rewards array of rewards function getRewardTokens() external view returns (address[] memory _rewards); /// @notice shows the earned incentives in the feedist /// @param token the token address to check /// @param owner owner's address /// @return reward the amount earned/claimable function earned( address token, address owner ) external view returns (uint256 reward); /// @notice function to submit incentives to voters for the upcoming flip /// @param token the address of the token to send for incentivization /// @param amount the amount of token to send function incentivize(address token, uint256 amount) external; /// @notice get the rewards for a specific period /// @param owner owner's address function getPeriodReward( uint256 period, address owner, address token ) external; /// @notice get the fees and incentives function getReward(address owner, address[] memory tokens) external; /// @notice remove a reward from the set function removeReward(address _token) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.26; interface IFeeRecipient { error STF(); error NOT_AUTHORIZED(); function initialize(address _feeDistributor) external; function notifyFees() external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IFeeRecipientFactory { error INVALID_TREASURY_FEE(); error NOT_AUTHORIZED(); /// @notice the pair fees for a specific pair /// @param pair the pair to check /// @return feeRecipient the feeRecipient contract address for the pair function feeRecipientForPair( address pair ) external view returns (address feeRecipient); /// @notice the last feeRecipient address created /// @return _feeRecipient the address of the last pair fees contract function lastFeeRecipient() external view returns (address _feeRecipient); /// @notice create the pair fees for a pair /// @param pair the address of the pair /// @return _feeRecipient the address of the newly created feeRecipient function createFeeRecipient( address pair ) external returns (address _feeRecipient); /// @notice the fee % going to the treasury /// @return _feeToTreasury the fee % function feeToTreasury() external view returns (uint256 _feeToTreasury); /// @notice get the treasury address /// @return _treasury address of the treasury function treasury() external view returns (address _treasury); /// @notice set the fee % to be sent to the treasury /// @param _feeToTreasury the fee % to be sent to the treasury function setFeeToTreasury(uint256 _feeToTreasury) external; /// @notice set a new treasury address /// @param _treasury the new address function setTreasury(address _treasury) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
{ "remappings": [ "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@forge-std-1.9.4/=dependencies/forge-std-1.9.4/", "@layerzerolabs/=node_modules/@layerzerolabs/", "@layerzerolabs/lz-evm-protocol-v2/=node_modules/@layerzerolabs/lz-evm-protocol-v2/", "@openzeppelin-contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@openzeppelin-contracts/contracts/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.1.0/", "erc4626-tests/=dependencies/erc4626-property-tests-1.0/", "forge-std/=dependencies/forge-std-1.9.4/src/", "permit2/=lib/permit2/", "@openzeppelin-3.4.2/=node_modules/@openzeppelin-3.4.2/", "@openzeppelin-contracts-5.1.0/=dependencies/@openzeppelin-contracts-5.1.0/", "@openzeppelin-contracts-upgradeable-5.1.0/=dependencies/@openzeppelin-contracts-upgradeable-5.1.0/", "@uniswap/=node_modules/@uniswap/", "base64-sol/=node_modules/base64-sol/", "ds-test/=node_modules/ds-test/", "erc4626-property-tests-1.0/=dependencies/erc4626-property-tests-1.0/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std-1.9.4/=dependencies/forge-std-1.9.4/src/", "hardhat/=node_modules/hardhat/", "solidity-bytes-utils/=node_modules/solidity-bytes-utils/", "solmate/=node_modules/solmate/" ], "optimizer": { "enabled": true, "runs": 1633 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_feeRecipientFactory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NOT_AUTHORIZED","type":"error"},{"inputs":[],"name":"STF","type":"error"},{"inputs":[],"name":"feeDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeRecipientFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDistributor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"notifyFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e0346100b557601f61074f38819003918201601f19168301916001600160401b038311848410176100b9578084926060946040528339810103126100b557610047816100cd565b906100606040610059602084016100cd565b92016100cd565b9160805260a05260c05260405161066d90816100e2823960805181818161016601528181610210015261035d015260a05181818160d40152818161026b0152610309015260c051818181607d01526103cd0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036100b55756fe6080806040526004361015610012575f80fd5b5f3560e01c9081630d43e8ad1461028f5750806346c96aac1461024c5780634c4f2a9514610234578063a8aa1b31146101f1578063c4d66de8146100a55763d32af6c11461005e575f80fd5b346100a1575f3660031901126100a15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b5f80fd5b346100a15760203660031901126100a1576004356001600160a01b0381168091036100a1576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101c957807fffffffffffffffffffffffff00000000000000000000000000000000000000005f5416175f55604051907f095ea7b300000000000000000000000000000000000000000000000000000000825260048201525f1960248201526020816044815f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af180156101be5761019457005b6101b59060203d6020116101b7575b6101ad81836102b1565b8101906102e7565b005b503d6101a3565b6040513d5f823e3d90fd5b7f3d83866f000000000000000000000000000000000000000000000000000000005f5260045ffd5b346100a1575f3660031901126100a15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a1575f3660031901126100a1576101b56102ff565b346100a1575f3660031901126100a15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100a1575f3660031901126100a1576020906001600160a01b035f54168152f35b90601f8019910116810190811067ffffffffffffffff8211176102d357604052565b634e487b7160e01b5f52604160045260245ffd5b908160209103126100a1575180151581036100a15790565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101c9576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b038116602083602481845afa9283156101be575f93610603575b508280156105fd576040517fc2ab87660000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602082600481845afa9182156101be575f926105c9575b5081610496575b5050505081610420575050565b6001600160a01b035f541691823b156100a1576040517fb66503cf0000000000000000000000000000000000000000000000000000000081526001600160a01b039290921660048301526024820152905f908290604490829084905af180156101be5761048a5750565b5f610494916102b1565b565b60049550602090604051968780927f61d027b30000000000000000000000000000000000000000000000000000000082525afa9485156101be575f95610585575b508082029082820403610571576127109004808203918211610571576040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0395909516600486015260248501529290602090829060449082905f905af180156101be57610552575b808080610413565b61056a9060203d6020116101b7576101ad81836102b1565b505f61054a565b634e487b7160e01b5f52601160045260245ffd5b9094506020813d6020116105c1575b816105a1602093836102b1565b810103126100a157516001600160a01b03811681036100a157935f6104d7565b3d9150610594565b9091506020813d6020116105f5575b816105e5602093836102b1565b810103126100a15751905f61040c565b3d91506105d8565b50505050565b9092506020813d60201161062f575b8161061f602093836102b1565b810103126100a15751915f61039d565b3d915061061256fea2646970667358221220e7248a995ee48385233f1048e0cbc130086f23f11c4045ff943ef6b2fb61f0be64736f6c634300081c0033000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd00000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b5f3560e01c9081630d43e8ad1461028f5750806346c96aac1461024c5780634c4f2a9514610234578063a8aa1b31146101f1578063c4d66de8146100a55763d32af6c11461005e575f80fd5b346100a1575f3660031901126100a15760206040516001600160a01b037f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1168152f35b5f80fd5b346100a15760203660031901126100a1576004356001600160a01b0381168091036100a1576001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f1633036101c957807fffffffffffffffffffffffff00000000000000000000000000000000000000005f5416175f55604051907f095ea7b300000000000000000000000000000000000000000000000000000000825260048201525f1960248201526020816044815f6001600160a01b037f000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0165af180156101be5761019457005b6101b59060203d6020116101b7575b6101ad81836102b1565b8101906102e7565b005b503d6101a3565b6040513d5f823e3d90fd5b7f3d83866f000000000000000000000000000000000000000000000000000000005f5260045ffd5b346100a1575f3660031901126100a15760206040516001600160a01b037f000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0168152f35b346100a1575f3660031901126100a1576101b56102ff565b346100a1575f3660031901126100a15760206040516001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f168152f35b346100a1575f3660031901126100a1576020906001600160a01b035f54168152f35b90601f8019910116810190811067ffffffffffffffff8211176102d357604052565b634e487b7160e01b5f52604160045260245ffd5b908160209103126100a1575180151581036100a15790565b6001600160a01b037f0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f1633036101c9576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd06001600160a01b038116602083602481845afa9283156101be575f93610603575b508280156105fd576040517fc2ab87660000000000000000000000000000000000000000000000000000000081527f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c16001600160a01b0316602082600481845afa9182156101be575f926105c9575b5081610496575b5050505081610420575050565b6001600160a01b035f541691823b156100a1576040517fb66503cf0000000000000000000000000000000000000000000000000000000081526001600160a01b039290921660048301526024820152905f908290604490829084905af180156101be5761048a5750565b5f610494916102b1565b565b60049550602090604051968780927f61d027b30000000000000000000000000000000000000000000000000000000082525afa9485156101be575f95610585575b508082029082820403610571576127109004808203918211610571576040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0395909516600486015260248501529290602090829060449082905f905af180156101be57610552575b808080610413565b61056a9060203d6020116101b7576101ad81836102b1565b505f61054a565b634e487b7160e01b5f52601160045260245ffd5b9094506020813d6020116105c1575b816105a1602093836102b1565b810103126100a157516001600160a01b03811681036100a157935f6104d7565b3d9150610594565b9091506020813d6020116105f5575b816105e5602093836102b1565b810103126100a15751905f61040c565b3d91506105d8565b50505050565b9092506020813d60201161062f575b8161061f602093836102b1565b810103126100a15751915f61039d565b3d915061061256fea2646970667358221220e7248a995ee48385233f1048e0cbc130086f23f11c4045ff943ef6b2fb61f0be64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd00000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
-----Decoded View---------------
Arg [0] : _pair (address): 0xF19748a0E269c6965a84f8C98ca8C47A064D4dd0
Arg [1] : _voter (address): 0x3aF1dD7A2755201F8e2D6dCDA1a61d9f54838f4f
Arg [2] : _feeRecipientFactory (address): 0x5712bD693aC758158146aa151F31BD74CFBF37c1
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0
Arg [1] : 0000000000000000000000003af1dd7a2755201f8e2d6dcda1a61d9f54838f4f
Arg [2] : 0000000000000000000000005712bd693ac758158146aa151f31bd74cfbf37c1
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.