Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit db38866

Browse files
committed
fix: rewards delegate
1 parent 4a9795e commit db38866

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contracts/compound/CErc20RewardsDelegate.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ import "./CErc20Delegate.sol";
55
import "./EIP20Interface.sol";
66

77
contract CErc20RewardsDelegate is CErc20Delegate {
8+
function _getExtensionFunctions() public pure virtual override returns (bytes4[] memory functionSelectors) {
9+
uint8 fnsCount = 2;
10+
11+
bytes4[] memory superFunctionSelectors = super._getExtensionFunctions();
12+
functionSelectors = new bytes4[](superFunctionSelectors.length + fnsCount);
13+
14+
for (uint256 i = 0; i < superFunctionSelectors.length; i++) {
15+
functionSelectors[i] = superFunctionSelectors[i];
16+
}
17+
18+
functionSelectors[--fnsCount + superFunctionSelectors.length] = this.claim.selector;
19+
functionSelectors[--fnsCount + superFunctionSelectors.length] = this.approve.selector;
20+
21+
require(fnsCount == 0, "use the correct array length");
22+
}
23+
824
/// @notice A reward token claim function
925
/// to be overridden for use cases where rewardToken needs to be pulled in
1026
function claim() external {}

0 commit comments

Comments
 (0)