Skip to content

Commit

Permalink
basic forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinPlatt committed Oct 7, 2024
1 parent c0aa023 commit fc5bff2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/v4-core"]
path = lib/v4-core
url = https://github.com/Uniswap/v4-core
[submodule "lib/solmate"]
path = lib/solmate
url = [email protected]:Transmissions11/solmate
1 change: 1 addition & 0 deletions lib/solmate
Submodule solmate added at 97bdb2
24 changes: 24 additions & 0 deletions src/ForwardBribe.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {BribeInitiative} from "./BribeInitiative.sol";

contract ForwardBribe is BribeInitiative {
address public immutable receiver;

constructor(address _governance, address _bold, address _bribeToken, address _receiver)
BribeInitiative(_governance, _bold, _bribeToken)
{
receiver = _receiver;
}

function forwardBribe() external {
governance.claimForInitiative(address(this));

uint boldAmount = bold.balanceOf(address(this));
uint bribeTokenAmount = bribeToken.balanceOf(address(this));

if (boldAmount != 0) bold.safeTransfer(receiver, boldAmount);
if (bribeTokenAmount != 0) bribeToken.safeTransfer(receiver, bribeTokenAmount);
}
}

0 comments on commit fc5bff2

Please sign in to comment.