// SPDX 许可证标识符:MIT 杂注可靠性 ^0.8.0;
合约银行账户{ uint私人余额;
// Deposit function: adds an amount to the balance
function deposit(uint amount) public {
balance += amount;
}
// Withdraw function: deducts an amount from the balance
function withdraw(uint amount) public {
require(amount <= balance, 'Insufficient balance');
balance -= amount;
}
// View function to check balance
function getBalance() public view returns (uint) {
return balance;
}
// Pure function to calculate simple interest
function calculateInterest(uint principal, uint rate, uint time) public pure returns (uint) {
return (principal * rate * time) / 100;
}
} 这是我的合同,但是当我尝试编译它时,它显示:> 正在编译