pub fn caller_contract_id() -> ContractId 
Expand description

If the caller is internal, returns the contract ID of the caller.

Additional Information

External calls result in undefined behaviour.

Returns

  • [ContractId] - The contract ID of the caller.

Examples

use std::auth::{caller_is_external, caller_contract_id};

fn foo() {
    if !caller_is_external() {
        let caller_contract_id = caller_contract_id();
        log(caller_contract_id);
    }
}