Skip to content

Commit 00dc850

Browse files
committed
docs: add AddProxyV1 to chain extension documentation
Document AddProxyV1 function (ID 13) and associated error codes in contracts documentation.
1 parent 0724349 commit 00dc850

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/contracts.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Subtensor provides a custom chain extension that allows smart contracts to inter
3434
| 10 | `swap_stake_limit` | Swap stake between subnets with price limit | `(AccountId, NetUid, NetUid, AlphaCurrency, TaoCurrency, bool)` | Error code |
3535
| 11 | `remove_stake_full_limit` | Fully withdraw stake with optional price limit | `(AccountId, NetUid, Option<TaoCurrency>)` | Error code |
3636
| 12 | `set_coldkey_auto_stake_hotkey` | Configure automatic stake destination | `(NetUid, AccountId)` | Error code |
37+
| 13 | `add_proxy` | Add a staking proxy for the caller | `(AccountId)` | Error code |
3738

3839
Example usage in your ink! contract:
3940
```rust
@@ -72,14 +73,16 @@ Chain extension functions that modify state return error codes as `u32` values.
7273
| 13 | `AmountTooLow` | Transaction amount is below minimum threshold |
7374
| 14 | `InsufficientLiquidity` | Insufficient liquidity for swap operation |
7475
| 15 | `SameNetuid` | Source and destination subnets are the same |
76+
| 16 | `ProxyTooMany` | Too many proxies registered |
77+
| 17 | `ProxyDuplicate` | Proxy already exists |
78+
| 18 | `ProxyNoSelfProxy` | Cannot add self as proxy |
7579

7680
### Call Filter
7781

7882
For security, contracts can only dispatch a limited set of runtime calls:
7983

8084
**Whitelisted Calls:**
8185
- `Proxy::proxy` - Execute proxy calls
82-
- `Proxy::add_proxy` - Add a proxy relationship
8386

8487
All other runtime calls are restricted and cannot be dispatched from contracts.
8588

0 commit comments

Comments
 (0)