0

See this transaction:

https://rinkeby.etherscan.io/tx/0xf38b9f1fdb1a6f309bb4671bbcee235c9b75685ac96f99955d59b9a112db1156

Is referred to the creation of this contract:

https://rinkeby.etherscan.io/address/0xc05e3556824a30d9ac2187339c9a60b954b127c1

This is the code

pragma solidity >=0.6.0;

contract test001 {

    int private age;

    function setAge(int _age) public {
        age = _age;
    }

}

I invoice setAge passing 25 as parameter, see the tx

https://rinkeby.etherscan.io/tx/0xbeee3e737020e9ca41e08f26a49f7890e42ccc1f6475637dd01f1682848dd762

My goal: I'd like to be able, saving the txid, to retrieve the data I sent; in this specific case, can I see that use setted 'age' = 25.

The ultimate goal is to save persistent certification data (a little group of integers and short strings) into the blockchain and be able to consult the data sent invoking a contract's function.

I have NOT the need to store all data into the contract, I think, if I am able to consult data sent using a common blockchain explorer link etherscan.io

If is it possible to consult the data I sent, how can I do this?

Probably I totally misunderstood visibility of data on the blockchain. Be patient, I'm new

1

You can see the "25" in the state change tab (switch to 'number'). But the easiest is probably to make the contract emit an event, as it is easy to read all events of contract from web3.

| improve this answer | |
0

If your goal is to have persistent certification data storage on the blockchain, and retrieve the same, you can make use of setter and getter methods.

Solidity creates a getter method for public state variables by default. In case of private state variables, you need to define a getter method to read the stored value.

| improve this answer | |
  • Thanks for reply, but (I think) you've not answer to my exact question: if data store on blocks is public and not encrypted, how can I see transaction data using a block explorer? – realtebo Jan 9 at 8:51
  • 1
    You can see the input data for a transaction in the block explorer but it will be in hexadecimal/binary. If your contract is verified on Etherscan, you can decode it under the Input Data ⇾ View input As section. – Sudeep Jan 9 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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