lesson 5: brownie error #1190
Replies: 5 comments 3 replies
-
|
tried looking everywhere to fix the issue, couldnt find anything helpful |
Beta Was this translation helpful? Give feedback.
-
//need to add spdx license identifier: MIT
//just do brownie compile
//brownie stores compiled code in the build folder
//brownie will automatically read the version of solidity and then store all of the compiled information in the builds folder
//to deploy this simplestorage contract, we have to write a script which will allow us to do whatever we want.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.0 <0.9.0;
contract SimpleStorage {
//all the solidity code we wrote and interacted with the blockchain, all this solidity was compiled down to the EVM
//eth virtual machine
uint256 favouriteNumber; // defining a variable upto 256 number , leaving it black will be automatically initialized to 0
bool favouriteBool = false;
struct People {
uint256 favouriteNumber;
string name;
}
//array: a way of storing a list of an object or type. Dynamic array : an array that can change size. there is also fixed size arrays
People[] public people;
//mapping: A dictionary like data structure with 1 value per key
mapping(string => uint256) public nametoFavouriteNumber;
People public person = People({favouriteNumber: 2, name: "Patrick"});
// view and Pure are non-state changing functions
function store(uint256 _favouriteNumber) public returns (uint256) {
favouriteNumber = _favouriteNumber;
return favouriteNumber;
// uint256 test = 4; //cant use this outside the function, its local, not global
}
//view reads the state of the blockchain, no state change happens
//public variables also have a view functions
//pure functions that purely do some kind of math
function retrieve() public view returns (uint256) {
return favouriteNumber;
}
// memory keyword: you can store info in memory or storage. Memory: data will only be stored during the execution of the function,
//and after the function is executed, the
//storing in storage instead of memory means that the data will persist even after the function executes
// Strings are actually an object: An array of bites
function addPerson(string memory _name, uint256 _favouriteNumber) public {
people.push(People({favouriteNumber: _favouriteNumber, name: _name})); // or we could have not written favouriteNumber and name, and just
// People(_favouriteNumber, _name)
nametoFavouriteNumber[_name] = _favouriteNumber;
}
}
//"Live" means "Mainnet" or "testnet"
//recap: first thing to do is in your smart contracts is name the solidity version, name your contract (its like a classs). |
Beta Was this translation helpful? Give feedback.
-
|
above is my simple storage code |
Beta Was this translation helpful? Give feedback.
-
|
From your sample code above, it seems your deploy_simple_storage() only does this: So the program is behaving correctly as it asks for your password, and ends itself gracefully because there's no code after it. If you want to deploy the smart contract and see it in the log, you may want to add the actual deploy code |
Beta Was this translation helpful? Give feedback.
-
|
@rishigarg256 is not the output the address you are looking for? |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
when i run the brownie deploy script, i get this error
INFO: Could not find files for the given pattern(s).
Brownie v1.18.1 - Python development framework for Ethereum
BrownieSimpleStorageProject is the active project.
Launching 'ganache-cli.cmd --chain.vmErrorsOnRPCResponse true --server.port 8545 --miner.blockGasLimit 12000000 --wallet.totalAccounts 10 --hardfork istanbul --wallet.mnemonic brownie'...
Running 'scripts\deploy.py::main'...
Enter password for "freecodecamp-account":
Terminating local RPC client...
basically, i enter my password, and it just terminates instead of showing me the account details
below is my code
Beta Was this translation helpful? Give feedback.
All reactions