Skip to content

Commit a6f8acb

Browse files
committed
Merge branch 'develop-bc' into 'develop'
Merge develop-bc into develop See merge request s10-blockchain-contract-sub2/S10P22A708!218
2 parents 02082ab + cef9933 commit a6f8acb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Contract/Contract_Code/contracts/FundRaising.sol

+27
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,33 @@ contract FundRaisingContract is ERC20MintBurnTransferContract {
7070
}
7171
}
7272

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+
73100
// 환불 함수
74101
function refundContributors() external {
75102
require(msg.sender == owner, "Only owner can call this function");

0 commit comments

Comments
 (0)