-2

Хорошего настроения! я получаю ошибку в строке 18 (function getBalance) такого характера (ParserError: Expected ',' but got '.')

here is my code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Demo {

    address public myAddress = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;

    function receiveFunds() public payable {


    }

    function transferTo(address targetAddr, uint amount) public {

        address payable_to = payable(targetAddr);
    }

    function getBalance(address target.Addr) public view returns(uint) {
        
        return targetAddr.balance;
    }

    string public myStr = "test";

    function demo(string memory newValueStr) public {
                
    string memory myTempStr = "temp";
    myStr = newValueStr;

    }
    
}

I can't understand what's the matter, google requests didn't reveal the secret to me

requests to google

pragma solidity ^0.8.0;

1 Answers1

0

You made a typo in the parameter name, You've written target.Addr instead of targetAddr.

So it can't compile the code.

Вы сделали опечатку в имени параметра, Вы написали target.Addr вместо targetAddr.

Так что компилировать нельзя.

Arian Hosseini
  • 138
  • 1
  • 1
  • 11