i just start learning the solidity and smart contract and i got this error
DeclarationError : Only constant variables are allowed at file level this is my code :
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
contract SimpleStorage {
address Address;
string name;
}
struct People {
string Name;
address Address;
}
People[] people;
mapping(string => address) NametoAddress;
function addPerson(string memory _Name, address memory _address) {
people.push(People(_Name, _address));
NametoAddress [_Name] = _address;
}
the error is in this 3 lines :
People[] people;
mapping(string => address) NametoAddress;
function addPerson(string memory _Name, address memory _address) {