Skip to content
Verified contractPartialGPL-3.0-or-later

BolderCashProxy

Address0x50bc019abdb9951602bc4fe92947d3c15d5e45df
Balance

0 ETH

 

Transactions

223

 

Compiler

solc 0.8.28

 

Same code

8 more contracts

 

Details

Compiler
solc 0.8.28+commit.7893614a
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
GPL-3.0-or-later
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
21,775,994
Creation transaction
0x91e4e8a717…7f9798a7e5

BolderCashProxy.sol

/*
 * Copyright (C) 2025 - https://bolder.cash
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
pragma solidity ^0.8.28;

contract BolderCashProxy {
    mapping(address => bool) public admins;
    mapping(address => bool) public callers;
    mapping(uint256 => bool) public correlations;

    event Admin(address indexed setter, address indexed param, bool state);
    event Caller(address indexed setter, address indexed param, bool state);
    event Action(uint256 indexed correlation, address indexed caller, address indexed target, uint8 action, bool success, bytes result);

    constructor(address admin) {
        admins[admin] = true;
        emit Admin(msg.sender, admin, true);
    }

    function setAdmin(address admin, bool state) public {
        require(admins[msg.sender], "Not admin");
        require(msg.sender != admin, "Not self");
        admins[admin] = state;
        emit Admin(msg.sender, admin, state);
    }

    function setCaller(address caller, bool state) public {
        require(admins[msg.sender], "Not admin");
        callers[caller] = state;
        emit Caller(msg.sender, caller, state);
    }

    function doCall(uint256 correlation, address target, bytes memory code) public returns (bool, bytes memory) {
        require(callers[msg.sender], "Not caller");
        require(correlations[correlation] == false, "Correlated");
        (bool success, bytes memory result) = target.call(code);
        correlations[correlation] = true;
        emit Action(correlation, msg.sender, target, 1, success, result);
        return (success, result);
    }

    function doDelegateCall(uint256 correlation, address target, bytes memory code) public returns (bool, bytes memory) {
        require(callers[msg.sender], "Not caller");
        require(correlations[correlation] == false, "Correlated");
        (bool success, bytes memory result) = target.delegatecall(code);
        correlations[correlation] = true;
        emit Action(correlation, msg.sender, target, 2, success, result);
        return (success, result);
    }

    function doStaticCall(uint256 correlation, address target, bytes memory code) public returns (bool, bytes memory) {
        require(callers[msg.sender], "Not caller");
        require(correlations[correlation] == false, "Correlated");
        (bool success, bytes memory result) = target.staticcall(code);
        correlations[correlation] = true;
        emit Action(correlation, msg.sender, target, 3, success, result);
        return (success, result);
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.