的 “我们如何改变费率取决于msg.value(如果> 20 ETH另一个价格)?” 强>
uint public constant regularPrice = 100; uint public constant moreThan20EthContributionPrice = 75; function () payable { //fallback function that is called when ETH is sent to contract ... some code ... uint price = calculatePrice(); ... some code ... } function calculatePrice() internal constant returns (uint) { if (msg.value > 20 ether) return moreThan20EthContributionPrice; return regularPrice; }