From 5af2b5558aa49ae7993bfd21defd113835af8c90 Mon Sep 17 00:00:00 2001 From: Shane Earley Date: Tue, 31 Oct 2023 13:43:49 -0400 Subject: [PATCH] Move initial acronyms to first page in docs --- apps/docs/src/guide/operating.md | 2 +- apps/docs/src/guide/staking.md | 6 +++--- apps/docs/src/introduction/architecture.md | 12 ++--------- .../src/introduction/staking-strategies.md | 2 +- apps/docs/src/introduction/what-is-casimir.md | 2 +- contracts/ethereum/arguments.js | 2 +- contracts/ethereum/scripts/deploy.ts | 20 +++++++++---------- contracts/ethereum/scripts/report.ts | 18 +++++++++++------ contracts/ethereum/scripts/upgrade-all.ts | 2 +- 9 files changed, 32 insertions(+), 34 deletions(-) diff --git a/apps/docs/src/guide/operating.md b/apps/docs/src/guide/operating.md index 72b28e6e2..347051e02 100644 --- a/apps/docs/src/guide/operating.md +++ b/apps/docs/src/guide/operating.md @@ -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. ::: tip diff --git a/apps/docs/src/guide/staking.md b/apps/docs/src/guide/staking.md index d0b30cf0b..b0213202f 100644 --- a/apps/docs/src/guide/staking.md +++ b/apps/docs/src/guide/staking.md @@ -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 @@ -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:** @@ -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). \ No newline at end of file +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). \ No newline at end of file diff --git a/apps/docs/src/introduction/architecture.md b/apps/docs/src/introduction/architecture.md index 382c20e2d..916226bba 100644 --- a/apps/docs/src/introduction/architecture.md +++ b/apps/docs/src/introduction/architecture.md @@ -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: @@ -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. - diff --git a/apps/docs/src/introduction/staking-strategies.md b/apps/docs/src/introduction/staking-strategies.md index 6f01a8653..3ba8a6b08 100644 --- a/apps/docs/src/introduction/staking-strategies.md +++ b/apps/docs/src/introduction/staking-strategies.md @@ -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 diff --git a/apps/docs/src/introduction/what-is-casimir.md b/apps/docs/src/introduction/what-is-casimir.md index e2b592f7a..5f9eec3e9 100644 --- a/apps/docs/src/introduction/what-is-casimir.md +++ b/apps/docs/src/introduction/what-is-casimir.md @@ -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. diff --git a/contracts/ethereum/arguments.js b/contracts/ethereum/arguments.js index 28f5437e5..a49ef7e70 100644 --- a/contracts/ethereum/arguments.js +++ b/contracts/ethereum/arguments.js @@ -5,4 +5,4 @@ // const { ETHEREUM_CONTRACTS } = require("@casimir/env"); -// module.exports = [] \ No newline at end of file +module.exports = [] \ No newline at end of file diff --git a/contracts/ethereum/scripts/deploy.ts b/contracts/ethereum/scripts/deploy.ts index 6fd5391f5..2b681dd47 100644 --- a/contracts/ethereum/scripts/deploy.ts +++ b/contracts/ethereum/scripts/deploy.ts @@ -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]) }() \ No newline at end of file diff --git a/contracts/ethereum/scripts/report.ts b/contracts/ethereum/scripts/report.ts index 0cf2e92b3..176f1c7db 100644 --- a/contracts/ethereum/scripts/report.ts +++ b/contracts/ethereum/scripts/report.ts @@ -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() { @@ -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() }() \ No newline at end of file diff --git a/contracts/ethereum/scripts/upgrade-all.ts b/contracts/ethereum/scripts/upgrade-all.ts index 5331f6228..f77cadd13 100644 --- a/contracts/ethereum/scripts/upgrade-all.ts +++ b/contracts/ethereum/scripts/upgrade-all.ts @@ -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) }() \ No newline at end of file