Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Affichage
Vue
Divisé
Unifié
Éditeur live
Masquer les espaces
Cacher identiques
Sans retour à la ligne
Niveau de précision
Intelligent
Syntaxe
Aucun
Modifier l’apparence
Traitement
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
FeeReciever
Créé
il y a 12 mois
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
4 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
71 lignes
Copier tout
7 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
74 lignes
Copier tout
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: BUSL-1.1
Copier
Copié
Copier
Copié
pragma solidity 0.8.
21
;
pragma solidity 0.8.
27
;
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import { LRTConstants } from "./utils/LRTConstants.sol";
import { LRTConstants } from "./utils/LRTConstants.sol";
import { ILRTDepositPool } from "./interfaces/ILRTDepositPool.sol";
import { ILRTDepositPool } from "./interfaces/ILRTDepositPool.sol";
import { IFeeReceiver } from "./interfaces/IFeeReceiver.sol";
import { IFeeReceiver } from "./interfaces/IFeeReceiver.sol";
/// @title FeeReceiver
/// @title FeeReceiver
Copier
Copié
Copier
Copié
/// @notice Rec
ie
ves Mev/Execution-layer rewards
/// @notice Rec
ei
ves Mev/Execution-layer rewards
/// @dev also known as RewardRec
ie
ver Contract in LRTConstants.sol
/// @dev also known as RewardRec
ei
ver Contract in LRTConstants.sol
contract FeeReceiver is IFeeReceiver, Initializable, AccessControlUpgradeable {
contract FeeReceiver is IFeeReceiver, Initializable, AccessControlUpgradeable {
address public _legacyProtocolTreasury;
address public _legacyProtocolTreasury;
address public depositPool;
address public depositPool;
uint256 public _legacyProtocolFeePercentInBPS;
uint256 public _legacyProtocolFeePercentInBPS;
/// @custom:oz-upgrades-unsafe-allow constructor
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
constructor() {
_disableInitializers();
_disableInitializers();
}
}
function initialize(
function initialize(
address _protocolTreasury,
address _protocolTreasury,
address _depositPool,
address _depositPool,
uint256 _protocolFeePercentInBPS,
uint256 _protocolFeePercentInBPS,
address admin,
address admin,
address manager
address manager
)
)
Copier
Copié
Copier
Copié
public
external
initializer
initializer
{
{
if (
if (
_protocolTreasury == address(0) || _depositPool == address(0) || _protocolFeePercentInBPS == 0
_protocolTreasury == address(0) || _depositPool == address(0) || _protocolFeePercentInBPS == 0
|| admin == address(0) || manager == address(0)
|| admin == address(0) || manager == address(0)
) {
) {
revert InvalidEmptyValue();
revert InvalidEmptyValue();
}
}
_legacyProtocolTreasury = _protocolTreasury;
_legacyProtocolTreasury = _protocolTreasury;
depositPool = _depositPool;
depositPool = _depositPool;
_legacyProtocolFeePercentInBPS = _protocolFeePercentInBPS;
_legacyProtocolFeePercentInBPS = _protocolFeePercentInBPS;
__AccessControl_init();
__AccessControl_init();
_setupRole(DEFAULT_ADMIN_ROLE, admin);
_setupRole(DEFAULT_ADMIN_ROLE, admin);
_setupRole(LRTConstants.MANAGER, manager);
_setupRole(LRTConstants.MANAGER, manager);
}
}
/// @dev fallback to receive funds
/// @dev fallback to receive funds
receive() external payable { }
receive() external payable { }
/// @dev send all rewards to deposit pool
/// @dev send all rewards to deposit pool
function sendFunds() external {
function sendFunds() external {
uint256 balance = address(this).balance;
uint256 balance = address(this).balance;
ILRTDepositPool(depositPool).receiveFromRewardReceiver{ value: balance }();
ILRTDepositPool(depositPool).receiveFromRewardReceiver{ value: balance }();
emit MevRewardsAddedToTVL(balance);
emit MevRewardsAddedToTVL(balance);
}
}
/*//////////////////////////////////////////////////////////////
/*//////////////////////////////////////////////////////////////
MANAGER FUNCTIONS
MANAGER FUNCTIONS
//////////////////////////////////////////////////////////////*/
//////////////////////////////////////////////////////////////*/
/// @dev Set the deposit pool
/// @dev Set the deposit pool
/// @param _depositPool Address of the deposit pool
/// @param _depositPool Address of the deposit pool
function setDepositPool(address _depositPool) external onlyRole(LRTConstants.MANAGER) {
function setDepositPool(address _depositPool) external onlyRole(LRTConstants.MANAGER) {
if (_depositPool == address(0)) revert InvalidEmptyValue();
if (_depositPool == address(0)) revert InvalidEmptyValue();
depositPool = _depositPool;
depositPool = _depositPool;
Copier
Copié
Copier
Copié
emit DepositPoolSet(_depositPool);
}
}
}
}
Copier
Copié
Copier
Copié
Différences enregistrées
Texte d'origine
Ouvrir un fichier
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { LRTConstants } from "./utils/LRTConstants.sol"; import { ILRTDepositPool } from "./interfaces/ILRTDepositPool.sol"; import { IFeeReceiver } from "./interfaces/IFeeReceiver.sol"; /// @title FeeReceiver /// @notice Recieves Mev/Execution-layer rewards /// @dev also known as RewardReciever Contract in LRTConstants.sol contract FeeReceiver is IFeeReceiver, Initializable, AccessControlUpgradeable { address public _legacyProtocolTreasury; address public depositPool; uint256 public _legacyProtocolFeePercentInBPS; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address _protocolTreasury, address _depositPool, uint256 _protocolFeePercentInBPS, address admin, address manager ) public initializer { if ( _protocolTreasury == address(0) || _depositPool == address(0) || _protocolFeePercentInBPS == 0 || admin == address(0) || manager == address(0) ) { revert InvalidEmptyValue(); } _legacyProtocolTreasury = _protocolTreasury; depositPool = _depositPool; _legacyProtocolFeePercentInBPS = _protocolFeePercentInBPS; __AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, admin); _setupRole(LRTConstants.MANAGER, manager); } /// @dev fallback to receive funds receive() external payable { } /// @dev send all rewards to deposit pool function sendFunds() external { uint256 balance = address(this).balance; ILRTDepositPool(depositPool).receiveFromRewardReceiver{ value: balance }(); emit MevRewardsAddedToTVL(balance); } /*////////////////////////////////////////////////////////////// MANAGER FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @dev Set the deposit pool /// @param _depositPool Address of the deposit pool function setDepositPool(address _depositPool) external onlyRole(LRTConstants.MANAGER) { if (_depositPool == address(0)) revert InvalidEmptyValue(); depositPool = _depositPool; } }
Texte modifié
Ouvrir un fichier
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.27; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { LRTConstants } from "./utils/LRTConstants.sol"; import { ILRTDepositPool } from "./interfaces/ILRTDepositPool.sol"; import { IFeeReceiver } from "./interfaces/IFeeReceiver.sol"; /// @title FeeReceiver /// @notice Receives Mev/Execution-layer rewards /// @dev also known as RewardReceiver Contract in LRTConstants.sol contract FeeReceiver is IFeeReceiver, Initializable, AccessControlUpgradeable { address public _legacyProtocolTreasury; address public depositPool; uint256 public _legacyProtocolFeePercentInBPS; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address _protocolTreasury, address _depositPool, uint256 _protocolFeePercentInBPS, address admin, address manager ) external initializer { if ( _protocolTreasury == address(0) || _depositPool == address(0) || _protocolFeePercentInBPS == 0 || admin == address(0) || manager == address(0) ) { revert InvalidEmptyValue(); } _legacyProtocolTreasury = _protocolTreasury; depositPool = _depositPool; _legacyProtocolFeePercentInBPS = _protocolFeePercentInBPS; __AccessControl_init(); _setupRole(DEFAULT_ADMIN_ROLE, admin); _setupRole(LRTConstants.MANAGER, manager); } /// @dev fallback to receive funds receive() external payable { } /// @dev send all rewards to deposit pool function sendFunds() external { uint256 balance = address(this).balance; ILRTDepositPool(depositPool).receiveFromRewardReceiver{ value: balance }(); emit MevRewardsAddedToTVL(balance); } /*////////////////////////////////////////////////////////////// MANAGER FUNCTIONS //////////////////////////////////////////////////////////////*/ /// @dev Set the deposit pool /// @param _depositPool Address of the deposit pool function setDepositPool(address _depositPool) external onlyRole(LRTConstants.MANAGER) { if (_depositPool == address(0)) revert InvalidEmptyValue(); depositPool = _depositPool; emit DepositPoolSet(_depositPool); } }
Trouver la différence