-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path20.sol
More file actions
36 lines (27 loc) · 737 Bytes
/
20.sol
File metadata and controls
36 lines (27 loc) · 737 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: Unlicense
pragma solidity ^0.8.0;
contract SecretVault{
string private secret;
constructor (string memory _secret) {
secret = _secret;
}
function setSecret (string memory _secret) external {
secret = _secret;
}
function getSecret () external view returns (string memory)
{
return secret;
}
}
contract myContract{
SecretVault public secretVault;
constructor(SecretVault _secretVault){
secretVault = _secretVault;
}
function setSecret(string memory _secret) public {
secretVault.setSecret(_secret);
}
function getSecret() public view returns(string memory){
return secretVault.getSecret();
}
}