5

I need to sign my contract with two different parties:

await stateMachine.sign({ from: userOne.address });
await stateMachine.sign({ from: userTwo.address });

in order to meet the following condition:

  function acceptPreCondition(
    bytes32, /*fromState*/
    bytes32 /*toState*/
  ) internal view {
    require(signatures[party1], 'Party 1 did not sign yet');
    require(signatures[party2], 'Party 2 did not sign yet');
  }

But when I do so I have the title issue, any idea on how to solve this? I also tried with the following fix I found from a github issue (does not work):

await stateMachine.sign({ from: userOne.address });
await stateMachine.connect();
await stateMachine.sign({ from: userTwo.address });

Thanks for the help

1 Answer 1

4
await stateMachine.connect(userOne).sign();
await stateMachine.connect(userTwo).sign();

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.