// SPDX-License-Identifier: MIT
pragma solidity >=0.4.11 Funder) funders;
}
uint numCampaigns;
mapping (uint => Campaign) campaigns;服务器托管
function newCampaign(address beneficiary, uint goal) public returns (uint ) {
uint campaignID = numCampaigns++;
Campaign storage c = campaigns[campaignID];
c.beneficiary=payable(beneficiary);
c.fundingGoal=goal;
c.amount=0;
c.numFunders=0;
return campaignID;
}
function contribute(uint campaignID) public payable {
Campaign storage c = campaigns[campaignID];
c.funders[c.numFunders++] = Funder({addr: msg.sender, amount: msg.value});
c.amount 服务器托管+= msg.value;
}
function checkGoalReached(uint campaignID) public returns (bool reached) {
Campaign storage c = campaigns[campaignID];
if (c.amount
Remix – Ethereum IDE
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
学习流程 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————…