I’m trying to use delegate actions with my contract.
From the contract’s point of view it’s irrelevant whether the action is in a standard transaction, or a delegate one. How can I get the relevant account id whether the transaction is delegated or not?
I’m using Rust and near-sdk==4.1.1
.
It seems that env::signer_account_id()
in the contract’s code returns the outer signer’s id, rather than the underlying user’s account id. The contract contains a check: require!(env::signer_account_id() == owner, "ERR: not the owner");
which fails for the wrong reason with the following:
{'ActionError': {'index': 0, 'kind': {'FunctionCallError': {'ExecutionError': 'Smart contract panicked: ERR: not the owner'}}}}
janek-cosmose is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.