Skip to content

Commit 0bc24d8

Browse files
authored
Update context.md
1 parent e5fad7d commit 0bc24d8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/concepts/context.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ There are five types of `ctx` variables.
1111
| `ctx.signer` | The top-level signer of the transaction. This is constant throughout the transaction's execution | |
1212
| `ctx.owner` | The owner of the contract, which is an optional field that can be set on time of submission. | If this field is set, only the `ctx.owner` can call any of the functions on the smart contract. This allows for a parent-child model. |
1313
| `ctx.entry` | The entry function and contract as a tuple. | |
14-
| `ctx.submission_name` | |
1514

1615
### ctx.caller
1716

@@ -137,16 +136,21 @@ The above contract is not callable unless the `ctx.caller` is the `ctx.owner`. T
137136

138137
When someone calls a contract through another contract, you might want to know what contract and function it was that called it in the first place.
139138

139+
`ctx.entry` returns a tuple containing the name of the contract and the function that was called.
140+
141+
### Example:
142+
140143
contract.py (Smart Contract)
141144
```python
142145
@export
143146
def function():
144-
return ctx.entry // Output when someone used other_contract ("other_contract","call_contract")
147+
return ctx.entry # Output when someone used other_contract: ("contract","function")
145148
```
146149

147150
other_contract.py (Smart Contract)
148151
```python
149152
import contract
153+
150154
@export
151155
def call_contract():
152156
contract.function()

0 commit comments

Comments
 (0)