2021-10-28 11:01:56 +00:00
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
2021-09-28 06:58:43 +00:00
|
|
|
|
2021-10-28 11:01:56 +00:00
|
|
|
pragma solidity ^0.8.0;
|
|
|
|
|
|
|
|
contract Example {
|
|
|
|
uint256 private _test;
|
|
|
|
|
2022-08-17 10:55:49 +00:00
|
|
|
mapping (address => uint128) public addressUintMap;
|
|
|
|
|
2021-11-23 05:53:47 +00:00
|
|
|
struct Bid {
|
|
|
|
uint128 bidAmount1;
|
|
|
|
uint128 bidAmount2;
|
|
|
|
}
|
|
|
|
|
2021-11-26 12:18:08 +00:00
|
|
|
event Test(string param1, uint8 param2, uint256 param3);
|
2021-09-28 06:58:43 +00:00
|
|
|
|
2022-08-17 10:55:49 +00:00
|
|
|
constructor() {
|
|
|
|
_test = 1;
|
|
|
|
addressUintMap[address(0)] = 123;
|
|
|
|
}
|
|
|
|
|
2021-09-28 06:58:43 +00:00
|
|
|
function getMethod() public view virtual returns (string memory)
|
|
|
|
{
|
|
|
|
return 'test';
|
|
|
|
}
|
2021-10-28 11:01:56 +00:00
|
|
|
|
2021-11-23 05:53:47 +00:00
|
|
|
function addMethod(uint128 bidAmount1, uint128 bidAmount2) public pure returns (uint) {
|
|
|
|
return bidAmount1 + bidAmount2;
|
|
|
|
}
|
|
|
|
|
|
|
|
function structMethod(uint128 bidAmount1, uint128 bidAmount2) public pure returns (Bid memory) {
|
|
|
|
Bid memory bid;
|
|
|
|
bid.bidAmount1 = bidAmount2;
|
|
|
|
bid.bidAmount2 = bidAmount1;
|
|
|
|
|
|
|
|
return bid;
|
|
|
|
}
|
|
|
|
|
2021-10-28 11:01:56 +00:00
|
|
|
function emitEvent() public virtual returns (bool) {
|
2021-11-26 12:18:08 +00:00
|
|
|
emit Test('abc', 150, 564894232132154);
|
2021-11-23 05:53:47 +00:00
|
|
|
|
2021-10-28 11:01:56 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|