-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinheritance.sol
More file actions
36 lines (30 loc) · 813 Bytes
/
inheritance.sol
File metadata and controls
36 lines (30 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Bitcoin{
function places() public returns(string memory){
return "so this love";
}
}
contract Ethereum is Bitcoin{
function user() public returns(string memory){
return "This is from ethereum";
}
}
/*Class Work
Create a contract tech4dev followed
by a function which takes in string.
Return how are you.
In the second contract named Damilare,
which will inherit the first contract.
Create a function which takes in string, and return
this is the second contract.*/
contract tech4dev{
function data() public returns(string memory){
return "How are you?";
}
}
contract Damilare is tech4dev{
function user() public returns(string memory){
return "this is the second contract";
}
}