Linked Questions

2
votes
1answer
829 views

Write current transaction hash in struct [duplicate]

My contract is pragma solidity ^0.4.11; contract UserBasic { struct Record { bytes32 _id; address _addedBy; uint _dateAdded; bytes32 _transactionHash; ...
1
vote
2answers
299 views

Decode transaction input INSIDE contract with solidity? [duplicate]

I would like to know if it is possible to read blockchain transactions from a smart contract. How web3 has the possibility to scroll, read and decrypt the input data of the transactions, does solidity ...
1
vote
0answers
268 views

Is there a way to get the hash of a transaction from a contract? [duplicate]

I've found that tx.hash is not defined in contracts, is there a way to get or calculate the hash of the tx ? And if not, What is the reason for that? Is there a pattern to store information about a ...
9
votes
1answer
2k views

Can a contract view the details of a transaction, given a transaction id?

Can a contract view the details of a transaction, given a transaction id? More generally, what details of the blockchain is a given contract aware of?
1
vote
2answers
2k views

Is it possible to create a unique hash inside geth?

When we make a transaction call, we get the transaction hash right away. As mentioned here we could not get transaction's hash inside the contract's function. Would it be good idea to set a variable ...
1
vote
1answer
801 views

Get latest transaction hashes from inside a contract

I am working on private test net. Can I get the latest transaction address inside my contract. At the basic level I am trying to have a function getLatestTransaction() which will return me the latest ...
1
vote
1answer
697 views

Given a blockhash, how can I prove a transaction with a given hash has been mined?

I'm working on a proof-of-relay contract that pays out if and only if a given transaction hash has been mined. I imagine there is some kind of merkle proof that would make this possible?
3
votes
0answers
750 views

Why is the transaction hash (tx.hash) not available in Solidity?

Why not solidity provide tx.TxHash (only tx.gasprice , tx.origin)? reference https://solidity.readthedocs.io/en/develop/units-and-global-variables.html, tx.TxHash,Transaction(ID) Hash, it should be ...
1
vote
0answers
97 views

Why transaction hash isn't available inside solidity function call

I recently bumped into this Is it possible to get the transaction hash from within a Solidity function call? while I was looking for a way to save the transaction hash inside my contract. And ...
0
votes
0answers
10 views

Generate a 'view on etherscan' link in a solidity smart contract

I'm trying to generate a link like this one https://etherscan.io/tx/0x8480c1eb040becbf86f0e466d88f0f76fa302b7a37f48b5e6fe75d21e69e1766 In a smart contract. I've read the Units and global variables ...