Created
April 3, 2024 10:13
-
-
Save Apolloelephen/867ce4a68394a9805531445bb102fb6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.7; | |
contract Message { | |
address public sender; | |
uint256 public value; | |
uint256 public gas; | |
uint256 public gasPrice; | |
uint256 public blockNumber; | |
constructor() payable { | |
sender = msg.sender; | |
value = msg.value; | |
gas = gasleft(); | |
gasPrice = tx.gasprice; | |
blockNumber = block.number; | |
} | |
function getMessage() | |
public | |
view | |
returns ( | |
address, | |
uint256, | |
uint256, | |
uint256, | |
uint256 | |
) | |
{ | |
return (sender, value, gas, gasPrice, blockNumber); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment