Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[Private transactions] Public wrapper contract: emit an event on successful private state change with the initiator's address? #9719

Closed
ngyam opened this issue Oct 8, 2018 · 5 comments
Assignees
Labels
F8-enhancement 🎊 An additional feature request. P9-somedaymaybe 🌞 Issue might be worth doing eventually.
Milestone

Comments

@ngyam
Copy link
Contributor

ngyam commented Oct 8, 2018

Hi all,

Is it possible to add an Event that gets emitted on a state change of the private contract?
Is it possible to know the address who initiated the state change (the caller of private_sendTransaction). What about including the initiator address in such an event?

Might be related to this other issue I already opened.

@jam10o-new jam10o-new added F8-enhancement 🎊 An additional feature request. P9-somedaymaybe 🌞 Issue might be worth doing eventually. labels Oct 8, 2018
@jam10o-new
Copy link
Contributor

This would be a fairly trivial change in the contract code (add the event call after the state change occurs) https://github.com/parity-contracts/private-tx/blob/master/contracts/PrivateContract.sol and you can easily deploy your own version of the contract instead of the one provided by Parity if you want to have this functionality now.

@jam10o-new jam10o-new added this to the 2.4 & ... milestone Oct 8, 2018
@ngyam
Copy link
Contributor Author

ngyam commented Oct 8, 2018

Neat, can you show me an example to do that? The examples are shown with private_composeDeploymentTransaction, and I haven't seen option to add a custom public contract data as a parameter. How do I compose with a custom public contract?

@jam10o-new
Copy link
Contributor

Yeah, you wouldn't use composeDeploymentTransaction, you'd have to manually deploy. (this clearly isn't a recommended way to set up a private contract). Let me double check what initialCode and initialState are set to (they are extracted from the signed transaction that you pass to private_composeDeploymentTransaction).

@jam10o-new
Copy link
Contributor

There's more going on than I thought, and it's not as simple as unwrapping the signed transaction and passing it on to your own deployment transaction unfortunately. Sorry about that.

@ngyam
Copy link
Contributor Author

ngyam commented Oct 8, 2018

No worries, then I wait :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F8-enhancement 🎊 An additional feature request. P9-somedaymaybe 🌞 Issue might be worth doing eventually.
Projects
None yet
Development

No branches or pull requests

4 participants