Sepolia Staking test

Hey everyone,

I am trying to interact with the sepolia staking contract.
The transaction signature is failing with an “Execution failure: ONLY_OPERATOR” error.

As operational address, I have used the Operator L2 Address for the staking contract as mentioned in documentaion.

Has anyone tried this yet or is willing to guide me through before the mainnet launch?

Hello,

If you’re encountering an “Execution failure: ONLY_OPERATOR” error while interacting with the Sepolia staking contract, this usually means that the contract only allows a specific operator to execute this transaction. From the image, it looks like you’ve used the Operator L2 Address as per the documentation; however, ensure that the contract recognizes this address as an authorized operator.

Check if this address is properly set up as an operator in the contract. If everything appears correct, consider contacting the contract owner or authorized operator to verify the address permissions. Reviewing the staking contract documentation once more may also help clarify the issue.

Thanks for the swift reply!

I think I am struggeling with the following bid of the documentation:

  1. Pre-approve the STRK ERC20 contract for the transfer of tokens from your address to the staking contract (and not the operator contract):
  • Using a Starknet block explorer, navigate to the STRK ERC20 contract (Starkscan, Voyager).
  • Approve the staking contract to transfer the specified amount of STRK tokens on your behalf.
  • How do I pre-approve the STRK ERC20 contract? Do I need to call the stake function of the `Staking Contract`?
  • Would my address from which I am sending the funds become the operational address of the Validator when interacting with the `Operator Contract `?

Thanks for your appreciated help!

Let me explain the entire process in detail:

  1. STRK Token Approval Process (Pre-approval):
  • First, you need to call the approve function on the STRK ERC20 contract
  • For this operation:
    • Set the staking contract address as the “spender”
    • Specify the amount of STRK you want to stake
    • This approval allows the staking contract to transfer tokens on your behalf
  1. Staking Process:
  • After approval, you can call the stake function on the Staking contract
  • This function will transfer the STRK amount you approved
  1. Operator Contract and Operational Address:
  • The address sending the funds (your wallet address) does not automatically become the operational address
  • The operational address is set separately during validator registration
  • This address will:
    • Be the address running your node
    • Serve as the address performing validator duties
  1. Order of Operations: a) First STRK token approval b) Then staking operation c) Finally validator registration and operational address setting

Important points to consider:

  • Ensure you’re using the correct contract addresses
  • Execute operations in the correct order
  • Verify that the approved and staked amounts are correct

Some additional technical notes:

  • The approval transaction must be completed and confirmed before attempting to stake
  • The staking contract and operator contract are separate entities with different functions
  • Your operational address should be carefully chosen as it will be responsible for validator operations

Thanks so much for the good explanation!

I followed your instruction and approved the staking contract via the approve function of the ERC20 contract. I spent 120 STRK.

After the approval, I tried to execute the stake function of the staking contract, but getting the “ONLY_OPERATOR” Error again.

Did you mean to interact with the Operator contract instead?
Because I was able to sign the transaction.

Is the Validator registration already live, I was not able to find anything on that?

Furthermore, I tried to increase my stake, but I assume I have to wait until the transaction is confirmed on L1 as well, as I am getting the error, that the staker does not exist?

Thanks again for your much appreciated help!

Hey!

Yes, it sounds like interacting with the Operator contract might be the right step here, as it’s often responsible for processing these types of transactions. If you’ve been able to sign the transaction, it could indicate that you’re set up on that front.

Regarding Validator registration, it might still be in the process of going live if you haven’t found any related info. It could also be worth checking if there’s a registration announcement or documentation update for any recent steps.

For increasing your stake, you’re correct; you’ll typically need to wait for the transaction to confirm on L1. The “staker does not exist” error can show up if the transaction hasn’t fully propagated yet. Try monitoring it to see when it’s finalized on L1, then give the increase another shot.

Let me know if you need further assistance!

Let me help clarify the staking process:

  1. The “ONLY_OPERATOR” error occurs because you’re trying to interact directly with the staking contract. You need to interact through the Operator contract instead.
  2. For increasing your stake:
  • The initial stake must be confirmed on L1 first
  • “Staker does not exist” error appears because your stake isn’t confirmed yet
  • You can increase your stake after L1 confirmation
  1. Validator registration isn’t live yet - continue monitoring official announcements.

Your 120 STRK approval was successful. Next step would be to execute the stake function through the Operator contract rather than directly calling the staking contract.

Would you like the specific Operator contract function details to proceed with staking?

Thank you both for helping, I managed to set up two validators and increases stakes, delegate stakes and claim rewards through the operator and pooling contracts as per the documentation.

I will keep monitoring the developments

I’m happy to help

everything for starknet

you are very much welcome

starknet is currently staking on the test network, you should try this too

Isn’t that what I have tried so far when it comes to interacting with the contracts (smart, operator and delegator contract)?

As far as I know, full nodes and validator registration procedures are not yet ready on testnet. Pleas correct me if I am wrong.

About your interactions with contracts:

Yes, you tried to interact with the three contract types you mentioned (smart contract, operator contract and delegator contract).

You are partly right and partly wrong about full node and validator procedures:

For full nodes: You are wrong in this part. Full nodes DO run on testnet. You can run a full node using Pathfinder or Juno.
For validator registration procedures: You are CORRECT about this. Validator registration procedures are not yet fully ready and active.

To summarize:
:white_check_mark: Full nodes: Available and working
:x: Validator registration: Not ready yet

Thank you so much for clarifying!

I did indeed run a sepolia testnet node, utilizing the juno client and it was fully synced up until recently.
The mainnet node is still operational and fully synced.
I might spin up another testnet instance for the validator registration process.

I’m happy to help, I hope it runs smoothly

I faced the same situation with you on Starknet Sepolia.
And thank you guys for your help.

Anyway now Stakingrewards has friendly UI for testing Stake STRK :partying_face:

I’m happy to hear that, everything for a better starknet

Hey,

trying to run through the whole process again and realized, that the Operator_contract has vanished from the documentation.

Is it no longer part of the staking processes and do we interact directly with the contract?

In the documentation Becoming a Validator :: Starknet documentation it says:

Enter the following parameters:

  • In spender, enter your address.
  • In amount, enter the number of STRK tokens you want to stake. Note: STRK has 18 decimals.

The part where it says “enter your address” had me stumped. In order to get the Stake call to work, I had to go back to approve and in spender instead of using my address I had to use 0x03745ab04a431fc02871a139be6b93d9260b0ff3e779ad9c8b377183b23109f1 as the spender in order for it to work?

Is this correct? Seemed to work after that. Wondering if that is a mistake in the docs. Thanks

Thanks for this explaination,
I’m running a Juno full-node currently, and expect to become a validator on November 26th :slight_smile:

But there is still some part of the docs that I don’t completely understand:

  • As the operational_address will need to perform validations, … Could it be an address created through Braavos, then with private key exported and store on the node machine, like it would be done for using Starkli with an account? To use it on a headless machine from CLI?
  • Where is the relation between the full node hosting and the staking process? (How can it be detected that a staker do not host a full-node? Or if the host is offline? Should we expose some of the node ports (RPC port/P2P port/…) to the internet or to some IP addresses?)