fa77bae105
* Refactor * add script to run all tests * Spawn ethermintd in node script * Update README * kill process when test finished * add new test case * add yarn.lock inside tests to be tracked
37 lines
680 B
Solidity
37 lines
680 B
Solidity
// SPDX-License-Identifier: GPL-3.0
|
|
|
|
pragma solidity >=0.7.0 <0.9.0;
|
|
|
|
/**
|
|
* @title Storage
|
|
* @dev Store & retrieve value in a variable
|
|
*/
|
|
contract EventTest {
|
|
|
|
uint256 number;
|
|
|
|
event ValueStored1(
|
|
uint value1
|
|
);
|
|
event ValueStored2(
|
|
string msg,
|
|
uint value1
|
|
);
|
|
event ValueStored3(
|
|
string msg,
|
|
uint indexed value1,
|
|
uint value2
|
|
);
|
|
|
|
function store(uint256 num) public {
|
|
number = num;
|
|
}
|
|
|
|
function storeWithEvent(uint256 num) public {
|
|
number = num;
|
|
emit ValueStored1(num);
|
|
emit ValueStored2("TestMsg", num);
|
|
emit ValueStored3("TestMsg", num, num);
|
|
}
|
|
|
|
} |