oh that simple. I was using the address that I was using when I deployed the govt contract. I did see that the address showing in the govt contract was different.
Thanks for you help. I had tried almost everything
- What is the base contract?
The contract that gets inherited by another contract.
- Which functions are available for derived contracts?
All public and internal scoped variables as well as state variables!
- What is hierarchical inheritance?
When a base contract is inherited by more than one child contracts.
- What is the base contract?
It is the contract that is inherited. So called parent contract. - Which functions are available for derived contracts?
Public and internal scoped functions - What is hierarchical inheritance?
Hierarchical inheritance is when several contracts are derived from a base contract.
Hey Carlos,
I lost all my files on the REmix.I dont know what happen to them. Usually when I open up the browser with remix then all my files show up but now they don’t. Is there a way to get my files back. Its seems that they don’t save to the hard drive. I dont know where they save to.
-
What is the base contract?
The base contract is the parent contract. It is the contract from which one or several other contracts inherit functions and state variables. -
Which functions are available for derived contracts?
Inheritance helps in inheriting the variables, functions, modifiers, and events of base contracts into the derived class. -
What is hierarchical inheritance?
A single contract acts as a base contract for multiple derived contracts.
Hey @Imhotep, hope you are great.
Sadly the remix files are storage on the browser data, when you clean the data from the browser it also remove the code, so i suggest to save your code properly in a github repository.
Maybe you are opening remix with a different browser than the usual you have been working on, or if you clean the data of your browser, sadly you lost those files.
Carlos Z
They never warned us about this. It should be added to the lesson. I am still using the same browser. It closed when I was working on another site and when I reopened it all my sites reopened but when I opened remix it had no files in it. How do we save the files on git hub? this was not a part of the lesson. I was hoping that it saved in the folder the remix was saved to which was the C drive programs folder but nothing is there. I had all my files since the beginning of the course and the Project file that I was working on. This is a pity.
Hi I am trying to deploy my Bank Contract but for some reason Remix no longer acknowledges this it exists. Gov, Destroy and Ownable are all available yet this one is not. Can anyone see why from the attachment? I am on the correct tab.
Sadly that happens to me also long ago, i suggest you to watch some videos on youtube about github to get a better idea, its pretty easy when you understand it.
Here is a tutorial video for gitub: https://www.youtube.com/watch?v=iv8rSLsi1xo
If you have any more questions, please let us know so we can help you!
Carlos Z.
You have to first compile the contract, then it will be showed in that list.
If you have any more questions, please let us know so we can help you!
Carlos Z.
I have done that but it still wont allow me to deploy it.
I have managed to work it out. There were errors in the other contracts so I am now guessing that if there are errors in contracts that we are connecting to when using Remix then Remix won’t allow us to deploy the contracts.
- The base contract is the parent contract; other contracts inherit from the base contract.
- For derived contracts, all functions from the base contract are available, except the private ones.
- Hierarchical inheritance is when 2 derived contracts both inherit form the base contract, but not from each other.
When creating a balance function am I correct in assuming that I do not need to write - ‘mapping(address => uint) balance;’ -
I have written the function -
function getBalance() public view returns (uint) {
return address(this).balance;
}
This appears to be working or but am I correct with this?
ok thanks thecil
Regards
Imhotep
What is the base contract?
It is the first parent contract that we can reuse.
Which functions are available for derived contracts?
Public and internal scoped functions and state variables.
What is hierarchical inheritance?
It is when a single contract acts as a base contract for multiple derived contracts.
- What is the base contract?
The parent contract is the base contract.
- Which functions are available for derived contracts?
There is a is-a relationship between base and derived contracts and all public and internal scoped
functions and state variables are available to derived contracts.
Single inheritance helps in inheriting the variables, functions, modifiers, and events of base contracts into the derived class.
- What is hierarchical inheritance?
A single contract acts as a base contract for multiple derived contracts.
contract Destroyable {
address public owner;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
constructor() {
owner = msg.sender;
}
function close() public onlyOwner {
selfdestruct(owner);
}
Anyone else getting this error?
pragma solidity 0.7.5;
contract DoomsDayDevice {
address owner;
modifier onlyOwner {
require(msg.sender == owner);
_; //run calling function
}
constructor() {
owner = msg.sender; // will be the person who deploys the contract
}
function redButton () public onlyOwner {
selfdestruct(owner);
}
}