File tree 1 file changed +27
-0
lines changed
Contract/Contract_Code/contracts
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,33 @@ contract FundRaisingContract is ERC20MintBurnTransferContract {
70
70
}
71
71
}
72
72
73
+ // 분배 함수
74
+ function distributeFundWithoutCondition () external {
75
+ require (msg .sender == owner, "Only owner can call this function " );
76
+ require (
77
+ raisedAmount >= (initialSupply * 4 ) / 5 ,
78
+ "Fundraising goal not reached "
79
+ );
80
+
81
+ // ART 토큰 컨트랙트의 인스턴스 생성
82
+ IERC20 artToken = IERC20 (artTokenAddress);
83
+
84
+ // 컨트랙트 내의 모든 ART 토큰을 owner에게 전송
85
+ uint256 balance = artToken.balanceOf (address (this ));
86
+ require (balance > 0 , "No ART tokens to distribute " );
87
+ artToken.transfer (owner, balance);
88
+
89
+ for (uint256 i = 0 ; i < listOfContributors.length ; i++ ) {
90
+ address contributor = listOfContributors[i];
91
+ uint256 amount = newCoins[contributor];
92
+
93
+ if (amount > 0 ) {
94
+ newCoins[contributor] = 0 ;
95
+ _transfer (owner, contributor, amount); // 현재는 분배를 1:1로 진행
96
+ }
97
+ }
98
+ }
99
+
73
100
// 환불 함수
74
101
function refundContributors () external {
75
102
require (msg .sender == owner, "Only owner can call this function " );
You can’t perform that action at this time.
0 commit comments