Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stdlib]Provide more method for getting chain,block,transaction properties in Move #6

Open
6 tasks
jolestar opened this issue Jan 12, 2022 · 0 comments
Open
6 tasks

Comments

@jolestar
Copy link
Member

jolestar commented Jan 12, 2022

There are some useful methods and properties on EVM for getting block and transaction properties.

blockhash(uint blockNumber) returns (bytes32): hash of the given block when blocknumber is one of the 256 most recent blocks; otherwise returns zero

block.basefee (uint): current block’s base fee (EIP-3198 and EIP-1559)

block.chainid (uint): current chain id

block.coinbase (address payable): current block miner’s address

block.difficulty (uint): current block difficulty

block.gaslimit (uint): current block gaslimit

block.number (uint): current block number

block.timestamp (uint): current block timestamp as seconds since unix epoch

gasleft() returns (uint256): remaining gas

msg.data (bytes calldata): complete calldata

msg.sender (address): sender of the message (current call)

msg.sig (bytes4): first four bytes of the calldata (i.e. function identifier)

msg.value (uint): number of wei sent with the message

tx.gasprice (uint): gas price of the transaction

tx.origin (address): sender of the transaction (full call chain)

We need to provide more methods for getting chain, block, and transaction properties in Move:

  • History block hash, maybe can use the accumulator to retrieve whole chain block history.
  • History state_root hash, the developer can check state proof in Move module.
  • More properties about the current block
  • Properties about Current transaction
  • Maybe we can use the accumulator for support to retrieve the whole transaction history?
  • Maybe properties about chain?
@jolestar jolestar transferred this issue from starcoinorg/starcoin Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant