# Smart Contracts

All deployed smart contracts can be found on [GitHub](https://github.com/stakewithus/eth-staking-contracts). Stakewithus will only deploy user funds into smart contracts that have been [audited](/eth-staking/audits.md).

## Staking

The core [Staking](https://github.com/stakewithus/eth-staking-contracts/blob/main/src/Staking.sol) contract of the ETH staking platform which manages all users, fees and deposits.&#x20;

### Privileged Roles

#### Operator

The operator is a bot-controlled EOA managed by the Stakewithus team. It listen to user deposits, generates validator signing keys and automatically submits them to the [official Ethereum staking deposit contract](https://ethereum.org/staking/deposit-contract) to create validators.

#### Owner

The owner of the Staking contract is a 2/3 [Safe](https://safe.global/) multisig controlled by Stakewithus team members. It can access all operator functions and also has the authority to set fees for using the platform.

### Functions

<table><thead><tr><th width="194">Name</th><th width="98">Role</th><th>Description</th></tr></thead><tbody><tr><td>deposit</td><td>users</td><td>deposit multiples of 32 ETH to create validators</td></tr><tr><td>refund</td><td>users</td><td>refund unstaked ETH</td></tr><tr><td>stake</td><td>operator</td><td>stake user ETH into the official Ethereum staking deposit contract</td></tr><tr><td>refundUser</td><td>operator</td><td>refund unstaked ETH to users</td></tr><tr><td>pause</td><td>operator</td><td>pause the contract, stopping new deposits</td></tr><tr><td>unpause</td><td>operator</td><td>unpause the contract</td></tr><tr><td>setOneTimeFee</td><td>owner</td><td>set one-time fee for depositing (currently disabled)</td></tr><tr><td>setPerformanceFee</td><td>owner</td><td>set Stakewithus's percentage share of block proposal rewards</td></tr><tr><td>setTreasury</td><td>owner</td><td>set the address which receives Stakewithus's share of block proposal rewards</td></tr><tr><td>setRefundDelay</td><td>owner</td><td>set the delay before users can initiate a refund of unstaked ETH</td></tr></tbody></table>

## Fee Recipient

The Staking contract deploys individual [Fee Recipient](https://github.com/stakewithus/eth-staking-contracts/blob/main/src/FeeRecipient.sol) contracts for each user upon their first deposit, which serve to collect and distribute their block proposal rewards. Only the user's address can access their rewards - this is set upon creation and cannot be changed.

### Functions

<table><thead><tr><th width="194">Name</th><th width="98">Role</th><th>Description</th></tr></thead><tbody><tr><td>claimRewards</td><td>user</td><td>claim user's share of block proposal rewards</td></tr><tr><td>treasuryClaim</td><td>treasury</td><td>claim Stakewithus's share of block proposal rewards</td></tr></tbody></table>

## Addresses

<table><thead><tr><th width="193">Name</th><th>Address</th></tr></thead><tbody><tr><td>Staking</td><td><a href="https://etherscan.io/address/0xfb4022e94460ae7bd4d65ecd8214fbf574740494"><code>0xFB4022E94460ae7bd4d65EcD8214fbf574740494</code></a></td></tr><tr><td>Operator</td><td><a href="https://etherscan.io/address/0x3B373F51cea611f92d1dEb2ADB354bF2c11E3C98"><code>0x3B373F51cea611f92d1dEb2ADB354bF2c11E3C98</code></a></td></tr><tr><td>Owner Multisig</td><td><a href="https://etherscan.io/address/0x65f13A1A21271c106a60CBE954A53B5e553e4A9F"><code>0x65f13A1A21271c106a60CBE954A53B5e553e4A9F</code></a></td></tr></tbody></table>

{% hint style="warning" %}
Users should ensure that they are interacting with the official Stakewithus smart contracts deployed at the above addresses.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eth-docs.stakewith.us/eth-staking/smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
