代码如下:
// 平台币 例如BNB,ETH
function contribute(uint fundingId) public payable {
require(fundingId <= fundingsNums && fundingId >= 1);
Funding storage funding = fundings[fundingId];
require(funding.status == 1);
//如何在此处,判断用户是否取消了支付?
// 本池子累加1
funding.balance += msg.value;
// 补充投资人信息
funding.funderNum += 1;
// 投资人数增加
fundersNums++;
uint amount = msg.value;
addFunder(funding,fundingId,amount);
}