oasisprotocol / oasisprotocol/oasis-sdk
contract-sdk: Support obtaining `InstanceId` of the caller in cross contract calls
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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