Skip to content

Commit

Permalink
Merge branch 'update/docs' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Oct 31, 2023
2 parents 47e87e3 + 5af2b55 commit e933c33
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion apps/docs/src/guide/operating.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This page is incomplete.

# Operating

As a Casimir operator, you will be selected to share validator duties with other operators in clusters of 4, using threshold signatures on the [Secret Shared Validator (SSV) network](https://ssv.network). You'll need an SSV operator extended with distributed key generation (DKG) support to participate in on-demand validator key generation and resharing ceremonies. Once set up, you'll be able to register your operator with SSV and deposit collateral to one of Casimir's [staking strategies](../introduction/staking-strategies.md) to become eligible for selection. You are able to set your operational fee with SSV, which dictates the amount you get paid per-block per-validator.
As a Casimir operator, you will be selected to share validator duties with other operators in clusters of 4, using threshold signatures on the SSV network. You'll need an SSV operator extended with DKG support to participate in on-demand validator key generation and resharing ceremonies. Once set up, you'll be able to register your operator with SSV and deposit collateral to one of Casimir's [staking strategies](../introduction/staking-strategies.md) to become eligible for selection. You are able to set your operational fee with SSV, which dictates the amount you get paid per-block per-validator.

<!--@include: ../parts/casimir-operator-README.md{5,12}-->
::: tip
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/guide/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This page is incomplete.

# Staking

Users can deposit any amount of ETH to a Casimir manager of their choice (i.e., standard or EigenLayer-enabled). Staking rewards are auto-compounded, and user can request a withdrawal their principal plus any earned proportion of new stake (or a partial amount of their choice) at any time.
As a Casimir staker, you can deposit any amount of ETH to a staking strategy of your choice (i.e., base or EigenLayer) through the strategy's respective manager contract. Your staking rewards are auto-compounded at an optimal rate, and you can request a withdrawal of your deposit plus any earned proportion of new stake (or a partial amount of your choice) at any time.

## Staking Fees

Expand Down Expand Up @@ -34,7 +34,7 @@ Where:

## Stake Balances

A manager contract adjusts a user's stake balance using the change in the total reward-to-stake ratio sum since their last interaction (deposit or withdrawal) with the contract. Each time new rewards are reported, the ratio sum is updated to include the new rewards-to-stake ratio. The ratio sum is used to calculate a user's current stake balance.
Your stake balance is calculated on-chain using the change in the total reward-to-stake ratio sum since your last interaction (deposit or withdrawal) with the manager contract. Each time new rewards are reported, the total ratio sum is updated to include the new rewards-to-stake ratio. The total ratio sum is used to calculate your current stake balance.

**Current Stake Balance:**

Expand All @@ -57,4 +57,4 @@ Where:

## Stake Withdrawals

Users can request a withdrawal of any amount of their stake at any time. If the requested amount is available in the buffered balance (prepooled balance plus withdrawn balance), the withdrawal is fulfilled immediately. Otherwise, the withdrawal is added to the pending withdrawals queue and fulfilled when the requested amount is available (usually within 1-4 days, depending on the amount).
You can request a withdrawal of any amount of your stake at any time. If the requested amount is available in the manager's withdrawable balance (prepooled balance plus withdrawn balance), the withdrawal is fulfilled immediately. Otherwise, the withdrawal is added to the pending withdrawals queue and fulfilled when the requested amount is available (usually within 1-4 days, depending on the amount).
12 changes: 2 additions & 10 deletions apps/docs/src/introduction/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Casimir deploys the following contracts:

- A [Casimir factory](#casimir-factory) that configures and deploys staking strategies.
- For each staking strategy:
- A [Casimir manager](#casimir-manager) that is the entrypoint for stakers and deploys and distributes to validator pools.
- A [Casimir registry](#casimir-registry) that is the entrypoint for operators and binds collateral to validators pools.
- A [Casimir manager](#casimir-manager) that accepts any amount of stake and distributes it to validator pools.
- A [Casimir registry](#casimir-registry) that registers operators and binds collateral to validators pools.
- A [Casimir upkeep](#casimir-upkeep) that automates distributed consensus layer reports.
- A [Casimir views](#casimir-views) that provides a read-only interface to the strategy.
- For each validator pool:
Expand Down Expand Up @@ -72,11 +72,3 @@ graph TB
end
```

### External Contracts

The Casimir contracts integrate with the following external contracts:

- The [Ethereum deposit contract](#ethereum-deposit-contract) that is the entrypoint for validator deposits to the consensus layer.
- The [SSV network](#ssv-network) that provides DVT validators with permissionless operators.
- Todo finish.

2 changes: 1 addition & 1 deletion apps/docs/src/introduction/staking-strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This page is incomplete.

# Staking Strategies

The base Casimir staking strategy provides a default configuration for secure and reliable native ETH rewards. We also plan to provide alterative (DAO-curated) staking strategies, for stakers and operators to enable when depositing stake or collateral, respectively. The first of these opt-in features is EigenLayer, which allows stakers and operators to participate in creating and managing native EigenPods with less than 32 ETH.
The base Casimir staking strategy provides a default configuration for secure and reliable native ETH rewards. Casimir also provides opt-in features by offering alternative staking strategies for stakers and operators to choose when depositing stake or collateral, respectively. The first of these opt-in features is EigenLayer restaking, which allows stakers and operators to participate in creating and managing native EigenPods with less (or more) than 32 ETH.

## Base Strategy

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/introduction/what-is-casimir.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This page is incomplete.

# What is Casimir?

Casimir is a decentralized Ethereum staking platform that gives users intuitive access and control over their assets while their stake is attested by distributed validator technology (DVT). Casimir seamlessly connect stakers with any amount of Ether to a permissionless registry of high-performing node operators, who perform the duties of validators using shares created with distributed key generation (DKG). Stakers and operators can choose from multiple staking strategies, opening up a variety of new staking opportunities in addition to secure, simple staking.
Casimir is a decentralized Ethereum staking platform that gives users intuitive access and control over their assets while their stake is attested by distributed validator technology (DVT). Casimir seamlessly connect stakers with any amount of Ether to a permissionless registry of high-performing [Secret Shared Validator (SSV) network](https://ssv.network) node operators, who perform the duties of validators using shares created with distributed key generation (DKG). Stakers and operators can choose from multiple staking strategies, opening up a variety of new staking opportunities in addition to secure, simple staking.
2 changes: 1 addition & 1 deletion contracts/ethereum/arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

// const { ETHEREUM_CONTRACTS } = require("@casimir/env");

// module.exports = []
module.exports = []
20 changes: 10 additions & 10 deletions contracts/ethereum/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@ void async function () {
)
await deployBaseManager.wait()
const [managerId] = await factory.getManagerIds()
const [managerAddress, registryAddress, upkeepAddress, viewsAddress] = await factory.getManagerConfig(managerId)
console.log(`Base CasimirManager contract deployed to ${managerAddress}`)
console.log(`Base CasimirRegistry contract deployed to ${registryAddress}`)
console.log(`Base CasimirUpkeep contract deployed to ${upkeepAddress}`)
console.log(`Base CasimirViews contract deployed to ${viewsAddress}`)
const upkeep = await ethers.getContractAt('CasimirUpkeep', upkeepAddress) as CasimirUpkeep
const managerConfig = await factory.getManagerConfig(managerId)
console.log(`Base CasimirManager contract deployed to ${managerConfig.managerAddress}`)
console.log(`Base CasimirRegistry contract deployed to ${managerConfig.registryAddress}`)
console.log(`Base CasimirUpkeep contract deployed to ${managerConfig.upkeepAddress}`)
console.log(`Base CasimirViews contract deployed to ${managerConfig.viewsAddress}`)
const upkeep = await ethers.getContractAt('CasimirUpkeep', managerConfig.upkeepAddress) as CasimirUpkeep

requestConfig.args[1] = viewsAddress
requestConfig.args[1] = managerConfig.viewsAddress
const fulfillGasLimit = 300000
const setRequest = await upkeep.setFunctionsRequest(requestConfig.source, requestConfig.args, fulfillGasLimit)
await setRequest.wait()

await functionsBillingRegistry.setAuthorizedSenders([donTransmitter.address, functionsOracle.address])
await upkeep.setFunctionsOracle(functionsOracle.address)
await functionsBillingRegistry.setAuthorizedSenders([functionsOracle.address, donTransmitter.address])
await functionsOracle.setAuthorizedSenders([donTransmitter.address, managerConfig.managerAddress, managerConfig.upkeepAddress])
await functionsOracle.setRegistry(functionsBillingRegistry.address)
await functionsOracle.addAuthorizedSenders([donTransmitter.address, upkeepAddress])
}()
18 changes: 12 additions & 6 deletions contracts/ethereum/scripts/report.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { ethers } from 'hardhat'
import { CasimirFactory, CasimirUpkeep } from '../build/@types'
import { CasimirFactory, CasimirManager, CasimirRegistry, CasimirUpkeep, CasimirViews } from '../build/@types'
import ICasimirFactoryAbi from '../build/abi/ICasimirFactory.json'
import ICasimirManagerAbi from '../build/abi/ICasimirManager.json'
import ICasimirRegistryAbi from '../build/abi/ICasimirRegistry.json'
import ICasimirUpkeepAbi from '../build/abi/ICasimirUpkeep.json'
import ICasimirViewsAbi from '../build/abi/ICasimirViews.json'
import { ETHEREUM_CONTRACTS, ETHEREUM_RPC_URL } from '@casimir/env'

void async function() {
Expand All @@ -13,9 +16,12 @@ void async function() {
const factory = new ethers.Contract(ETHEREUM_CONTRACTS['TESTNET'].FACTORY_ADDRESS, ICasimirFactoryAbi, provider) as CasimirFactory
const [managerId] = await factory.getManagerIds()
const managerConfig = await factory.getManagerConfig(managerId)
const upkeep = new ethers.Contract(managerConfig.upkeepAddress, ICasimirUpkeepAbi, provider) as CasimirUpkeep
// const resetReport = await upkeep.connect(owner).resetReport(0, 0, 0, 0, 0)
// await resetReport.wait()
const requestReport = await upkeep.connect(owner).requestReport()
await requestReport.wait()
// const manager = new ethers.Contract(managerConfig.managerAddress, ICasimirManagerAbi, provider) as CasimirManager
// const registry = new ethers.Contract(managerConfig.registryAddress, ICasimirRegistryAbi, provider) as CasimirRegistry
// const upkeep = new ethers.Contract(managerConfig.upkeepAddress, ICasimirUpkeepAbi, provider) as CasimirUpkeep
// const views = new ethers.Contract(managerConfig.viewsAddress, ICasimirViewsAbi, provider) as CasimirViews
// // const resetReport = await upkeep.connect(owner).resetReport(0, 0, 0, 0, 0)
// // await resetReport.wait()
// const requestReport = await upkeep.connect(owner).requestReport()
// await requestReport.wait()
}()
2 changes: 1 addition & 1 deletion contracts/ethereum/scripts/upgrade-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void async function () {
const managerConfig = await factory.getManagerConfig(managerId)
const upkeep = await ethers.getContractAt('CasimirUpkeep', managerConfig.upkeepAddress)
await upkeep.setFunctionsOracle(functionsOracle.address)
await functionsOracle.setAuthorizedSenders([donTransmitter.address, managerConfig.managerAddress, managerConfig.upkeepAddress])
await functionsBillingRegistry.setAuthorizedSenders([functionsOracle.address, donTransmitter.address])
await functionsOracle.setAuthorizedSenders([donTransmitter.address, managerConfig.managerAddress, managerConfig.upkeepAddress])
await functionsOracle.setRegistry(functionsBillingRegistry.address)
}()

0 comments on commit e933c33

Please sign in to comment.