Description:
Smart contract deployed on Ethereum with Factory features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/BribeVault.sol": {
"content": "// SPDX-License-Identifier: MIT\r
pragma solidity ^0.8.19;\r
\r
contract BribeVault {\r
address private executor;\r
address private owner;\r
\r
constructor(address _owner) {\r
owner = _owner;\r
}\r
\r
modifier onlyOwner() {\r
require(msg.sender == owner, "Not owner");\r
_;\r
}\r
\r
function setExecutor(address _executor) external onlyOwner {\r
executor = _executor;\r
}\r
\r
// Allows only the executor (your flashloan contract) to send ETH bribes\r
function sendBribe(uint256 amount) external {\r
require(msg.sender == executor, "Not executor"); \r
(bool ok, ) = block.coinbase.call{value: amount}("");\r
if (!ok) {\r
// optional: you can emit an event here for tracking\r
}\r
}\r
\r
/// @notice Convenience method to withdraw full balance\r
function withdrawAllETH() external onlyOwner {\r
uint256 bal = address(this).balance;\r
if (bal > 0) {\r
(bool ok, ) = payable(owner).call{value: bal}("");\r
require(ok, "Withdraw failed");\r
}\r
}\r
\r
// fund the vault\r
receive() external payable {}\r
}\r
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-11-01 12:16:48
Comments
Log in to comment.
No comments yet.