oasisprotocol / oasisprotocol/oasis-sdk

contract-sdk: Support obtaining `InstanceId` of the caller in cross contract calls

Open
#418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c:contract-sdk
Dominant language
Rust
Stars
90
Forks
35
Avg merge
5d 9h
Merged PRs (30d)
5

Description

Currently in a contract call context you can obtain the caller address via the caller_address() method. This is useful, but in case the caller was another contract, you'd likely also want to know the InstanceId of the contract, as (in theory) you could want to emit a message back to the caller contract - for which the InstanceId is required.

Alternative that could be considered is supporting specifying contract address instead of the contract instance ID for cross-contract calls, however that introduces the potential for mistakes when a non-contract address is used (e.g. regular user address).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the contract call context and the existing caller_address() method in the contract SDK, then follow how cross-contract calls use InstanceId. Determine how a caller contract’s InstanceId can be exposed without weakening address validation. Done means a contract can obtain the caller contract’s InstanceId during a cross-contract call and use it for a response call.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.