Here’s the drawing of an article based on your request:
Use Has_on in Solana: Hidden Request for additional signatory
. One such restriction is the use of HAS_ON, which allows developers to determine that the account must have exactly one children’s account.
However, when it is used HAS_ONE with certain rules likeAdministrator ‘, it is not immediately clear what exactly happens in practice. The closer explosion through Has_one 'can sometimes lead to unexpected behavior, even if only the administrator is declared like that.
In this article,
SyntaxHas_one

When defining an account with a limit likeHas_one, a syntax looks like this:
rust
#[An account (
…
Has_on (
Child_account: Address,
Child_signer: Address,
, ,,
)]
`
Here we see that two new fields have been added to the account structure:
Child_account:
Child_signer:
ADMINISTRATOR SIGNING REQUESTS
Consider now what happens when we use the administrator signatories (HAS_ONE (administrator))
`rust
#[An account (
…
Has_on (
Administrator: Address,
, ,,
)]
`
IN
catch: only one children’s account is required
When using HAS_ONE with a certain rule likeadmin ', it is crucial to note that the child's account should not be signed by the administrator. Instead, the administrator must sign his account, which serves as a child. For this reason, an additional signatorial request is added to the parental account.
Conclusion
Administrator ', adding an additional requirement of the signatorial can sometimes lead to unexpected behavior, even if only the administrator is declared like that.
As developers, it is important to carefully use the power ofhase_ne` to minimize unnecessary signatories.
