Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Apolloelephen/867ce4a68394a9805531445bb102fb6d to your computer and use it in GitHub Desktop.
Save Apolloelephen/867ce4a68394a9805531445bb102fb6d to your computer and use it in GitHub Desktop.
// 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