Skip to content

Commit

Permalink
Merge pull request #46 from sense-finance/obol
Browse files Browse the repository at this point in the history
feat: add obol claiming to allowlist
  • Loading branch information
jparklev authored Mar 8, 2025
2 parents 350e1ac + 9df3594 commit fa51813
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
30 changes: 30 additions & 0 deletions safe-batches/obol-claiming.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "1.0",
"chainId": "1",
"createdAt": 1741380088421,
"meta": {
"name": "Transactions Batch",
"description": "obol-claiming",
"txBuilderVersion": "1.10.0",
"createdFromSafeAddress": "0x9D89745fD63Af482ce93a9AdB8B0BbDbb98D3e06",
"createdFromOwnerAddress": "",
"checksum": "0x0bc46cb3bdf1526c58ff28527be82d6dfa8b797bfb239203ca120d1c170688ac"
},
"transactions": [
{
"to": "0x9000fef2846a5253fd2c6ed5241de0fddb404302",
"value": "0x0",
"data": "0x5534fa0c000000000000000000000000efd2247fcc3c7aa1fcbe1d2b81e6d0164583eea34a3067b9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
},
{
"to": "0x9000fef2846a5253fd2c6ed5241de0fddb404302",
"value": "0x0",
"data": "0x5534fa0c0000000000000000000000003b9122704a20946e9cb49b2a8616ccc0f0d61adb6198e339000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
},
{
"to": "0x9000fef2846a5253fd2c6ed5241de0fddb404302",
"value": "0x0",
"data": "0x5534fa0c0000000000000000000000000b010000b7624eb9b3dfbc279673c76e9d29d5f7a9059cbb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
}
]
}
59 changes: 59 additions & 0 deletions script/RumpelConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ library RumpelConfig {

// Additional Reward Assets
address public constant MAINNET_LRT2 = 0x8F08B70456eb22f6109F57b8fafE862ED28E6040;
address public constant MAINNET_OBOL_CLAIM = 0xEfd2247fcC3C7aA1FCbE1d2b81e6d0164583eeA3;
address public constant MAINNET_OBOL = 0x0B010000b7624eb9B3DfBC279673C76E9D29D5F7;
address public constant MAINNET_OBOL_LOCKUPS = 0x3b9122704A20946E9Cb49b2a8616CCC0f0d61AdB;

function updateGuardAllowlist(RumpelGuard rumpelGuard, string memory tag) internal {
setupGuardProtocols(rumpelGuard, tag);
Expand Down Expand Up @@ -360,6 +363,8 @@ library RumpelConfig {
return getAdditionalMellowVaultsGuardProtocolConfigs();
} else if (tagHash == keccak256(bytes("fluid-loop-usde-smart-vaults"))) {
return getFluidLoopUSDeSmartVaultsConfigs();
} else if (tagHash == keccak256(bytes("obol-claiming"))) {
return getOBOLProtocolConfigs();
}

revert("Unsupported tag");
Expand Down Expand Up @@ -432,6 +437,8 @@ library RumpelConfig {
return getAdditionalMellowVaultsGuardTokenConfigs();
} else if (tagHash == keccak256(bytes("fluid-loop-usde-smart-vaults"))) {
return getFluidLoopUSDeSmartVaultsTokenConfigs();
} else if (tagHash == keccak256(bytes("obol-claiming"))) {
return getOBOLTokenConfigs();
}

revert("Unsupported tag");
Expand Down Expand Up @@ -501,6 +508,8 @@ library RumpelConfig {
return new TokenModuleConfig[](0);
} else if (tagHash == keccak256(bytes("fluid-loop-usde-smart-vaults"))) {
return new TokenModuleConfig[](0);
} else if (tagHash == keccak256(bytes("obol-claiming"))) {
return new TokenModuleConfig[](0);
}

revert("Unsupported tag");
Expand Down Expand Up @@ -567,6 +576,8 @@ library RumpelConfig {
return new ProtocolModuleConfig[](0);
} else if (tagHash == keccak256(bytes("fluid-loop-usde-smart-vaults"))) {
return new ProtocolModuleConfig[](0);
} else if (tagHash == keccak256(bytes("obol-claiming"))) {
return new ProtocolModuleConfig[](0);
}

revert("Unsupported tag");
Expand Down Expand Up @@ -2219,6 +2230,32 @@ library RumpelConfig {

return configs;
}

function getOBOLTokenConfigs() internal pure returns (TokenGuardConfig[] memory) {
TokenGuardConfig[] memory configs = new TokenGuardConfig[](1);

configs[0] = TokenGuardConfig({
token: MAINNET_OBOL,
transferAllowState: RumpelGuard.AllowListState.ON,
approveAllowState: RumpelGuard.AllowListState.OFF
});

return configs;
}

function getOBOLProtocolConfigs() internal pure returns (ProtocolGuardConfig[] memory) {
ProtocolGuardConfig[] memory configs = new ProtocolGuardConfig[](2);

configs[0] = ProtocolGuardConfig({target: MAINNET_OBOL_CLAIM, selectorStates: new SelectorState[](1)});
configs[0].selectorStates[0] =
SelectorState({selector: IObolClaim.claimAndDelegate.selector, state: RumpelGuard.AllowListState.ON});

configs[1] = ProtocolGuardConfig({target: MAINNET_OBOL_LOCKUPS, selectorStates: new SelectorState[](1)});
configs[1].selectorStates[0] =
SelectorState({selector: IObolLockups.unlock.selector, state: RumpelGuard.AllowListState.ON});

return configs;
}
}

interface IMorphoBundler {
Expand Down Expand Up @@ -2342,6 +2379,28 @@ interface IFluidVaultFactory_ {
function safeTransferFrom(address from_, address to_, uint256 id_) external;
}

interface IObolClaim {
struct SignatureParams {
uint256 nonce;
uint256 expiry;
uint8 v;
bytes32 r;
bytes32 s;
}

function claimAndDelegate(
bytes16 campaignId,
bytes32[] memory proof,
uint256 claimAmount,
address delegatee,
SignatureParams memory delegationSignature
) external payable;
}

interface IObolLockups {
function unlock(uint256) external;
}

// @dev actually a function in ActionMiscV3 called through the RouterProxy
contract IPendleRouterV4 {
struct RedeemYtIncomeToTokenStruct {
Expand Down

0 comments on commit fa51813

Please sign in to comment.