From fc5bff2bd1a650b6dcb68c537b40753d1a59d238 Mon Sep 17 00:00:00 2001 From: Colin Platt Date: Mon, 7 Oct 2024 17:42:14 +0200 Subject: [PATCH] basic forwarder --- .gitmodules | 3 +++ lib/solmate | 1 + src/ForwardBribe.sol | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 160000 lib/solmate create mode 100644 src/ForwardBribe.sol diff --git a/.gitmodules b/.gitmodules index 5e007a6c..ee9c92b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 = git@github.com:Transmissions11/solmate diff --git a/lib/solmate b/lib/solmate new file mode 160000 index 00000000..97bdb200 --- /dev/null +++ b/lib/solmate @@ -0,0 +1 @@ +Subproject commit 97bdb2003b70382996a79a406813f76417b1cf90 diff --git a/src/ForwardBribe.sol b/src/ForwardBribe.sol new file mode 100644 index 00000000..234c7403 --- /dev/null +++ b/src/ForwardBribe.sol @@ -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); + } +}