Contract · Governance
Treasury
Simple Ownable treasury that holds BNB/BNB20 and executes transfers. Pair with Timelock + Governor for full DAOs.
DAO
~650k gas
BNB Smart Chain
Post-deploy checklist
- Deploy with a multisig or Timelock as initial owner when possible
- Verify on BscScan before depositing funds
- Document who can call execute / withdraw
- 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);
}
}
