1

I'm hoping to implement something like this, for even external tokens:

transaction_details(address, token_contract)

which will return the transaction history, i.e. sender, receiver, amount, timestamp...

Is this possible from inside a smart contract?

1
  • I have the same doubt. Did you understand how to do it? May 13, 2021 at 12:25

1 Answer 1

1

You can, but it's going to be nontrivial, as smart contracts do not have direct access to the transaction history of the blockchain, only to the current state.

With a tool like Oraclize you can get data from outside the smart contract ecosystem and use them inside of it. Depending on your use-case however, you probably had better keep this functionality off-chain.

1
  • is there a way with web3js to get transaction history amount from a smart contract?
    – chovy
    Dec 11, 2021 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.