-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Staker should not be the Sender #4
Comments
first, we are planning to change this for another reason (it can be an opening for phishing attacks).
|
When interacting with a contract like an LST (Liquid Staking Token), the process works as follows: For another scenario, if the user interacts directly with the delegation pool contract while using a paymaster service, the sender is not the user but the paymaster relayer. Here, the paymaster relayer should not be treated as the staker. Using |
got it. but both of your examples are of smart contracts interacting with the pool contract where we don't have such checks. |
Yes, if the user interacts directly with the staking contract while using a paymaster service, the sender is not the user but the paymaster relayer. Here, the paymaster relayer should not be treated as the staker. And when initiating an LST contract, the LST will have to call the Staking contract to deploy the delegation pool. The sender will be the LST owner, but the staker should be the LST. |
@alon-f ack on SW end. This was also brought up also on internal audits, we are considering exactly what to do. But favoring to enable anyone to enter the address. |
We are changing it back to get_caller_address (we are also removing the Operator completely). |
Description
In the
stake
function of theStaking
contract, the current logic usesget_tx_info().account_contract_address
to retrieve the address of the staker. However, the account contract from which a transaction originates is not necessarily the staker, which may lead to incorrect behavior.Suggested Solution
Instead of relying on
account_contract_address
, it would be more appropriate to useget_caller_address()
orget_execution_info().caller_address
to retrieve the address of the staker.The text was updated successfully, but these errors were encountered: