You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- init() now calls admin.require_auth() before persisting any config,
so only the address that will become the stored admin can perform
initialization. Previously init stored the admin address with no
signature verification at all.
- Update AUTH_MATRIX.md and the subscription README to document that
init requires admin authorization.
- Add test_init_requires_admin_auth_without_persisting_state, mirroring
the equivalent earnings contract test: an unauthorized init attempt
is rejected and leaves the contract uninitialized, then a properly
authorized init succeeds.
- Add sub_init_invalid_non_admin_rejected to the AUTH_MATRIX.md
compliance suite (auth_matrix.rs) and rename sub_init_valid_any_caller
to sub_init_valid_admin_signs to reflect the new requirement.
Closes#1376
Copy file name to clipboardExpand all lines: contract/AUTH_MATRIX.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ Contracts covered here (deployed by `contract/scripts/deploy.sh`):
51
51
52
52
| Method | Required signer(s) | Valid invocation example | Invalid invocation example |
53
53
| --- | --- | --- | --- |
54
-
|`init(env, admin, fee_bps, fee_recipient, token, price)`|`none`|Any caller initializes once with config values. |Re-initialization attempt after already initialized. |
54
+
|`init(env, admin, fee_bps, fee_recipient, token, price)`|`admin`|`admin` signs and initializes once with config values. |Non-admin caller initializes without `admin` signature. |
55
55
|`create_plan(env, creator, asset, amount, interval_days)`|`creator`|`creator` signs and creates a plan. | Non-creator caller submits plan for `creator`. |
56
56
|`subscribe(env, fan, plan_id, _token)`|`fan`|`fan` signs and subscribes to `plan_id`. | Another address tries to subscribe using `fan` as parameter without `fan` auth. |
57
57
|`is_subscriber(env, fan, creator)`|`none`| Any caller checks subscription status. | Expecting signer/auth to be required for read. |
0 commit comments