Reference for the DAOTreasury.sol implementation contract.
Source: contracts/DAOTreasury.sol
(Note: Update link if necessary)
The DAOTreasury.sol
contract provides the implementation logic for the DAO’s treasury, responsible for holding and managing the DAO’s funds (native currency like ETH, and ERC20 tokens). It is used behind a DAOTreasuryProxy
.
DAO
contract through the execution of successful governance proposals (specifically proposeTransfer
proposals). Direct transfers by external accounts are not possible.(This section is a placeholder and will be updated after analyzing DAOTreasury.sol
)
transferETH(address payable recipient, uint256 amount)
: Transfers native currency from the treasury. Should only be callable by the associated DAO
contract.transferERC20(address token, address recipient, uint256 amount)
: Transfers ERC20 tokens from the treasury. Should only be callable by the associated DAO
contract.initialize(address daoAddress)
: An initializer function called by the proxy during deployment (specifically, called by the DAOFactory
after the DAO proxy is deployed), linking the treasury to its controlling DAO
contract address.receive() external payable
or fallback() external payable
function to allow the treasury address to receive direct deposits of native currency.transfer
function of the respective ERC20 contract.(This section is a placeholder)
ETHTransfer(address indexed recipient, uint256 amount)
: Emitted when native currency is transferred out.ERC20Transfer(address indexed token, address indexed recipient, uint256 amount)
: Emitted when ERC20 tokens are transferred out.ETHReceived(address indexed sender, uint256 amount)
: Emitted when native currency is received directly.Uses the UUPS proxy pattern. Upgrades are managed via the DAO
contract’s proposeUpgrade
governance process.