What I have

  • I have my private ehtereum chain running on an AWS EC2 instance.
  • I am able to deploy contracts on my private chain.
  • I am able to call functions of smart contract.

I am using truffle and react.

pragma solidity ^0.4.15;
contract NDA {
bytes32  party1name;
bytes32  party2name;

function NDA(bytes32 _party1name) {
     party1name = _party1name;

function SetParty2(bytes32 _party2name) {
     party2name = _party2name;

function get() constant returns (bytes32, bytes32) {
    return (party1name, party2name);

The above contract saves the 2 parties involved in a contract. I am planning not to make a new contract everytime for 2 new parties but use the same contract as template and serve them from transactions which they do when they go in contract with each other.

To do so I should be able to go through the list of transactions of state update under that contract address for the specified user.

How can I travel back to an older state of a contract and fetch it?

1 Answer 1


I would add a struct like

struct Pair{ bytes32 party1name; bytes32 party2name; }

And then have either an array or a mapping to store previous structs. You can have a variable like Pair currentPair if you want to easily retrieve the most recent one. I'm a little unsure of exactly what you are asking, but I think that this, or some variant of this, would be the best way.

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.