pragma Solidity 给出错误,即使我添加了最新版本。请问有人可以帮助我吗?

问题描述 投票:0回答:0

// 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;
}

} 这是我的合同,但是当我尝试编译它时,它显示:> 正在编译

compiler-errors compilation solidity smartcontracts pragma
© www.soinside.com 2019 - 2024. All rights reserved.