# How can I change the signatory of a contract from one party to another

**URL:** <https://forum.canton.network/t/how-can-i-change-the-signatory-of-a-contract-from-one-party-to-another/6571>\
**Category:** App Development\
**Tags:** daml\
**Created:** [May 18, 2023, 12:24am UTC](https://forum.canton.network/t/how-can-i-change-the-signatory-of-a-contract-from-one-party-to-another/6571 "2023-05-18T00:24:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cohen.avraham](https://avatars.discourse-cdn.com/v4/letter/c/a87d85/32.png) [@cohen.avraham](https://forum.canton.network/u/cohen.avraham)\
**Post date:** [May 18, 2023, 12:24am UTC](https://forum.canton.network/t/how-can-i-change-the-signatory-of-a-contract-from-one-party-to-another/6571/1 "2023-05-18T00:24:10Z")

</div>

G-d willing

Hello,  
I am having the following template

```haskell
template Product
  with
    id: Text
    owner: Party
    responsible: Party
  where
    signatory owner, responsible

    choice ChangeResponsible : ContractId Product
      with
        newRespobsible : Party
      controller responsible, newRespobsible
        do
          create this with responsible = newRespobsible

```

Say that the owner of the product would like to propose to candidates to be responsible for the product, meaning to be the responsible party of the contract. So, I created a proposal template to represent it:

```haskell
template ProductResponsibleProposal
  with
    lessor: Party
    lessee: Party
    product: ContractId Product
  where
    signatory lessor
    observer lessee

    choice AcceptResponsibleProposal : ContractId RentAgreement
      controller lessee
        do
          exercise product ChangeResponsible with newRespobsible = lessee

```

I created a script for that:

```haskell
setup : Script ()
setup = script do

  alice <- allocateParty "alice"
  bob <- allocateParty "bob"

  pen <- submit alice do
    createCmd Product with owner = alice, responsible = alice, id ="1"

  proposalId <- submit alice do
    createCmd ProductResponsibleProposal with
      lessor = alice
      lessee = bob
      product = pen

  submit bob do
    exerciseCmd proposalId AcceptResponsibleProposal

  pure ()

```

However, that does not work since the bob, the lesser, is not visible in the Product contract. So, I tried creating an agreement between them before exercising the choice.  
I created the following template:

```haskell
template ProductResponsibleAgreement
  with
    lessor: Party
    lessee: Party
    product: ContractId Product
  where
    signatory lessor, lessee

    choice ChangeResponsibility : ContractId Product
      controller lessee, lessor
        do
          exercise product ChangeResponsible with newRespobsible = lessee

```

I updated the choice in the proposal for the following;

```haskell
    choice AcceptResponsibleProposal : ContractId ProductResponsibleAgreement
      controller lessee
        do
          a <- create ProductResponsibleAgreement with ..

          exercise a ChangeResponsibility

          return a

```

And, since the agreement has both signatories, bob & alice, exercising the choice from the agreement should work. However, that does not work as again for the same visibility error.  
How can I resolve this, so bob can be the responsible party for the product in one step only on accepting the proposal?  
I don’t want to create the agreement first, and then ask bob (as a second step) to exercise the `AcceptResponsibleProposal ` choice at another time. I want it all in one go.

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [May 22, 2023, 12:24pm UTC](https://forum.canton.network/t/how-can-i-change-the-signatory-of-a-contract-from-one-party-to-another/6571/2 "2023-05-22T12:24:39Z")

</div>

It’s a bit unclear to me exactly what your workflow is supposed to do here, but the gist of the answer is, I think, that in order for Bob to be able to exercise a choice that requires a Product, Bob needs to be an observer on that Product.
