Skip to content

Commit

Permalink
feat: disable reward functionalities (#134)
Browse files Browse the repository at this point in the history
* feat: disable reward functionalities

* chore: fix solhint

* chore: update deployedContracts
  • Loading branch information
adu-web3 authored Dec 30, 2024
1 parent 389fc09 commit 321a7e2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 324 deletions.
15 changes: 7 additions & 8 deletions script/deployedContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
"clientChain": {
"beaconOracle": "0xd3D285cd1516038dAED61B8BF7Ae2daD63662492",
"beaconProxyBytecode": "0xA15Ce26ba8E50ac21ecDa1791BAa3bf22a95b575",
"bootstrap": "0xDf9caDCfb027d9f6264Ecd5eAEc839a8335d8520",
"bootstrapLogic": "0xB97A39004Ba6900FAE801Ac04F8ce4DA70689879",
"capsuleBeacon": "0xB8D032a30a3B950CBcc6c1689E2381ab4290D4BB",
"capsuleImplementation": "0x02266413cdaaaF4092C5e48d6434040B63F62215",
"clientGatewayLogic": "0xf60F5af658C85aF56F6D811c9AA9F94fBe17A67d",
"erc20Token": "0x83E6850591425e3C1E263c054f4466838B9Bd9e4",
"capsuleImplementation": "0x8638502De2001e0dF71BbB5dd503E2008b2Ae948",
"clientChainGateway": "0xDf9caDCfb027d9f6264Ecd5eAEc839a8335d8520",
"clientChainGatewayLogic": "0x92A645a44DFf3e5499F9e6A1d6738520971267AA",
"lzEndpoint": "0x6EDCE65403992e310A62460808c4b910D972f10f",
"proxyAdmin": "0x4317A7f62dA871E4512424Df8CaE91A6Ccc2afEA",
"rewardVaultBeacon": "0xEe75FF2f3A6E49a7cfd0aa2F729563F8c0F7707b",
"rewardVaultImplementation": "0xAE4Aed8C1A66f89D7c19D7B1021BE027846A51e6",
"vaultBeacon": "0x737e311Bf34B838943A30110289C5a9b22eba2A8",
"vaultImplementation": "0x69c1435EF73BA19e11a76481275EE6A8490942Db",
"wstETH": "0xB82381A3fBD3FaFA77B3a7bE693342618240067b"
"vaultImplementation": "0xce7f4AC8D00f5e4aB3BEd9fDD1EDB9cD20516477"
},
"exocore": {
"exocoreGateway": "0xEAf4E4D09b9CeB936492518A852026c914beb11E",
"exocoreGatewayLogic": "0x42397BFa2601B85E838750A10E652eea2238B5B6",
"exocoreGatewayLogic": "0xe522837eB5AC11a1748046F059FeEE42A5F2F6e9",
"exocoreProxyAdmin": "0x9bBDDb68B47b88d3Dd2eF7E1682C1EFE4E2e2315",
"lzEndpoint": "0x6EDCE65403992e310A62460808c4b910D972f10f"
}
Expand Down
46 changes: 11 additions & 35 deletions src/core/BaseRestakingController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pragma solidity ^0.8.19;
import {IBaseRestakingController} from "../interfaces/IBaseRestakingController.sol";
import {IExoCapsule} from "../interfaces/IExoCapsule.sol";
import {IVault} from "../interfaces/IVault.sol";

import {Errors} from "../libraries/Errors.sol";
import {MessagingFee, MessagingReceipt, OAppSenderUpgradeable} from "../lzApp/OAppSenderUpgradeable.sol";
import {ClientChainGatewayStorage} from "../storage/ClientChainGatewayStorage.sol";
import {Action} from "../storage/GatewayStorage.sol";
Expand Down Expand Up @@ -81,47 +83,21 @@ abstract contract BaseRestakingController is
}

/// @inheritdoc IBaseRestakingController
function submitReward(address token, address avs, uint256 amount)
external
payable
isValidAmount(amount)
whenNotPaused
nonReentrant
{
require(token != address(0), "BaseRestakingController: token address cannot be empty or zero address");
require(avs != address(0), "BaseRestakingController: avs address cannot be empty or zero address");
// deposit reward to reward vault
rewardVault.deposit(token, msg.sender, avs, amount);
// send request to exocore, and this would not expect a response since deposit is supposed to be must success by
// protocol
bytes memory actionArgs = abi.encodePacked(bytes32(bytes20(token)), bytes32(bytes20(avs)), amount);
_processRequest(Action.REQUEST_SUBMIT_REWARD, actionArgs, bytes(""));
/// @dev Reward functionalities are not yet activated
function submitReward(address, address, uint256) external payable {
revert Errors.NotYetSupported();
}

/// @inheritdoc IBaseRestakingController
function claimRewardFromExocore(address token, uint256 amount)
external
payable
isValidAmount(amount)
whenNotPaused
nonReentrant
{
require(token != address(0), "BaseRestakingController: token address cannot be empty or zero address");
bytes memory actionArgs = abi.encodePacked(bytes32(bytes20(token)), bytes32(bytes20(msg.sender)), amount);
bytes memory encodedRequest = abi.encode(token, msg.sender, amount);
_processRequest(Action.REQUEST_CLAIM_REWARD, actionArgs, encodedRequest);
/// @dev Reward functionalities are not yet activated
function claimRewardFromExocore(address, uint256) external payable {
revert Errors.NotYetSupported();
}

/// @inheritdoc IBaseRestakingController
function withdrawReward(address token, address recipient, uint256 amount)
external
isValidAmount(amount)
whenNotPaused
nonReentrant
{
require(token != address(0), "BaseRestakingController: token address cannot be empty or zero address");
require(recipient != address(0), "BaseRestakingController: recipient address cannot be empty or zero address");
rewardVault.withdraw(token, msg.sender, recipient, amount);
/// @dev Reward functionalities are not yet activated
function withdrawReward(address, address, uint256) external pure {
revert Errors.NotYetSupported();
}

/// @dev Processes the request by sending it to Exocore.
Expand Down
281 changes: 0 additions & 281 deletions test/foundry/WithdrawReward.t.sol

This file was deleted.

0 comments on commit 321a7e2

Please sign in to comment.