File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: UNLICENSED
22pragma solidity ^ 0.8.28 ;
33
4+ import "./treasury.sol " ;
5+
46
57error Not_Admin ();
68error INVALID_PROPOSAL_STATUS ();
@@ -9,10 +11,13 @@ error PROPOSAL_DOES_NOT_EXIST();
911
1012contract ProposalManager {
1113
14+ Treasury public treasury;
15+
1216 address public admin;
1317
14- constructor (){
18+ constructor (address _treasury ){
1519 admin = msg .sender ;
20+ treasury = Treasury (payable (_treasury))
1621}
1722
1823 enum ProposalStatus {
@@ -47,7 +52,7 @@ constructor(){
4752
4853 event proposalCreated (address indexed proposer , address recipient , uint amount );
4954 event proposalApproved (uint indexed proposer_id );
50- event proposalexecuted (uint indexed proposer );
55+ event proposalexecuted (uint indexed proposer_id );
5156
5257 function createProposal (address _recipient , uint256 _amount ) external {
5358 proposalCount++ ;
@@ -76,6 +81,8 @@ constructor(){
7681 if (proposal.status != ProposalStatus.APPROVED) revert INVALID_PROPOSAL_STATUS ();
7782 proposals[_id].status = ProposalStatus.EXECUTED;
7883
84+ treasury.sendFunds (proposal.recipient, proposal.amount);
85+
7986 emit proposalexecuted (_id);
8087 }
8188
You can’t perform that action at this time.
0 commit comments