-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSimpleContract.sol
49 lines (44 loc) · 1.02 KB
/
SimpleContract.sol
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
37
38
39
40
41
42
43
44
45
46
47
48
49
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.7.0;
contract SimpleContract {
bytes32 programId;
bytes32 accountId;
bytes32 valBytes32;
address valAddress;
uint256 valUint256;
constructor(
bytes32 _programId,
bytes32 _accountId,
bytes32 _valBytes32,
address _valAddress,
uint256 _valUint256
) {
programId = _programId;
accountId = _accountId;
valBytes32 = _valBytes32;
valAddress = _valAddress;
valUint256 = _valUint256;
}
function setAndGetValues(
bytes32 _newValBytes32,
address _newValAddress,
uint256 _newValUint256
)
public
returns (bytes32, bytes32, bytes memory)
{
valBytes32 = _newValBytes32;
valAddress = _newValAddress;
valUint256 = _newValUint256;
return getValues();
}
function getValues()
public
view
returns (bytes32 _programId, bytes32 _accountId, bytes memory _packedData)
{
_programId = programId;
_accountId = accountId;
_packedData = abi.encode(valBytes32, valAddress, valUint256);
}
}