Skip to content
Contract · Governance

Treasury

Simple Ownable treasury that holds BNB/BNB20 and executes transfers. Pair with Timelock + Governor for full DAOs.

All templates
DAO
~650k gas
BNB Smart Chain
Post-deploy checklist
  1. Deploy with a multisig or Timelock as initial owner when possible
  2. Verify on BscScan before depositing funds
  3. Document who can call execute / withdraw
  4. Pair with Governor for on-chain proposals
Configure & deploy

No constructor fields

This template deploys with no constructor arguments. Review the generated source, then compile and deploy.

Use cases
  • Protocol reserves
  • Grant budgets
  • Multisig-style team wallets (single owner or Timelock)
SimpleTreasury.solsolidity
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0 (Wizard / Contracts MCP patterns)
// Compiled with Solidity ^0.8.24 — BNB Toolset browser solc
pragma solidity ^0.8.24;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

contract SimpleTreasury is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    constructor(address initialOwner) Ownable(initialOwner) {}

    receive() external payable {}

    function withdrawBNB(address payable to, uint256 amount) external onlyOwner nonReentrant {
        (bool ok,) = to.call{value: amount}("");
        require(ok, "bnb transfer failed");
    }

    function withdrawToken(IERC20 token, address to, uint256 amount) external onlyOwner nonReentrant {
        token.safeTransfer(to, amount);
    }
}