Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How do I find the ContractId of the currently executing contract?Forum ↗

How do I find the ContractId of the currently executing contract?

App Development5 posts299 views1 likesLast activity May 2022
ME
meschOP
May 2022

I return the contractId of the new contract from a consuming choice. This contract ID is returned from create this ....

For uniformity, sometimes I would like to return the contract ID also from a nonconsuming choice.

How do I obtain the contract ID of the contract whose choice is currently executing?

Thanks a lot,
mesch.

CO
cocreature
May 2022

There is self which gives you access to the contract id of the current contract similar to how this gives you access to the contract payload.

ST
StephenOTT
May 2022

@cocreature where is the use of ‘this’ and ‘self’ documented?

GA
Gary_Verhaegen
May 2022

They’re mentioned in the template reference, but I suppose that could be expanded quite a bit.

ST
StephenOTT
May 2022

I was able to find references in the docs that the keywords exist. But there does not seem to be any explanation of what the keywords do / contain

← Back to Discussions