Skip to content

Commit

Permalink
Merge pull request #160 from lidofinance/develop
Browse files Browse the repository at this point in the history
Merge from develop into main
  • Loading branch information
AnnaSila authored Feb 21, 2024
2 parents 3a84d29 + 6f210e0 commit f180efd
Show file tree
Hide file tree
Showing 19 changed files with 558 additions and 304 deletions.
5 changes: 4 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# EL_RPC_URLS_{CHAIN_ID} list or URLs delimeted by commas, first entry is primary, else are fallbacks
EL_RPC_URLS_1=
EL_RPC_URLS_5=
EL_RPC_URLS_17000=

# etherscan api key
ETHERSCAN_API_KEY=

# supported networks for connecting wallet
SUPPORTED_CHAINS=1,5
SUPPORTED_CHAINS=1,17000

# this chain uses when a wallet is not connected
DEFAULT_CHAIN=1
Expand All @@ -19,3 +20,5 @@ CSP_REPORT_ONLY=

# api endpoint for reporting csp violations
CSP_REPORT_URI=

WALLETCONNECT_PROJECT_ID=
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* @lidofinance/lido-eth-ui @lidofinance/lido-qa
* @lidofinance/lido-dao-ops-team @lidofinance/lido-qa
.github @lidofinance/review-gh-workflows
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on: push
jobs:
security:
uses: lidofinance/linters/.github/workflows/security.yml@master
permissions:
security-events: write
contents: read

docker:
uses: lidofinance/linters/.github/workflows/docker.yml@master
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/ci-dev-goerli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI Dev Goerli

on:
workflow_dispatch:
push:
branches:
- goerli
paths-ignore:
- ".github/**"

permissions: {}

jobs:
# test:
# ...

deploy:
runs-on: ubuntu-latest
# needs: test
name: Build and deploy
steps:
- name: Testnet deploy
uses: lidofinance/dispatch-workflow@v1
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: "lidofinance/infra-mainnet"
TARGET_WORKFLOW: "deploy_testnet_dao_voting_ui.yaml"
TARGET: "goerli"
4 changes: 2 additions & 2 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Dev
name: CI Dev Holesky

on:
workflow_dispatch:
Expand All @@ -25,5 +25,5 @@ jobs:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
TARGET_REPO: "lidofinance/infra-mainnet"
TARGET_WORKFLOW: "deploy_testnet_dao_voting_ui.yaml"
TARGET_WORKFLOW: "deploy_holesky_testnet_dao_voting_ui.yaml"
TARGET: "develop"
1 change: 1 addition & 0 deletions modules/blockChain/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const ChainNames = {
[CHAINS.Moonbeam]: 'Moonbeam',
[CHAINS.Moonriver]: 'Moonriver',
[CHAINS.Moonbase]: 'Moonbase',
[CHAINS.Holesky]: 'Holesky',
} as const

export const parseChainId = (chainId: number | string) => {
Expand Down
43 changes: 42 additions & 1 deletion modules/blockChain/contractAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,169 +4,210 @@ import { ChainAddressMap } from './types'
export const AragonVoting: ChainAddressMap = {
[CHAINS.Mainnet]: '0x2e59A20f205bB85a89C53f1936454680651E618e',
[CHAINS.Goerli]: '0xbc0B67b4553f4CF52a913DE9A6eD0057E2E758Db',
[CHAINS.Holesky]: '0xdA7d2573Df555002503F29aA4003e398d28cc00f',
}

export const GovernanceToken: ChainAddressMap = {
[CHAINS.Mainnet]: '0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32',
[CHAINS.Goerli]: '0x56340274fB5a72af1A3C6609061c451De7961Bd4',
[CHAINS.Holesky]: '0x14ae7daeecdf57034f3E9db8564e46Dba8D97344',
}

export const TokenManager: ChainAddressMap = {
[CHAINS.Mainnet]: '0xf73a1260d222f447210581ddf212d915c09a3249',
[CHAINS.Goerli]: '0xDfe76d11b365f5e0023343A367f0b311701B3bc1',
[CHAINS.Holesky]: '0xFaa1692c6eea8eeF534e7819749aD93a1420379A ',
}

export const AragonFinance: ChainAddressMap = {
[CHAINS.Mainnet]: '0xb9e5cbb9ca5b0d659238807e84d0176930753d86',
[CHAINS.Goerli]: '0x75c7b1D23f1cad7Fb4D60281d7069E46440BC179',
[CHAINS.Holesky]: '0xf0F281E5d7FBc54EAFcE0dA225CDbde04173AB16 ',
}

export const NodeOperatorsRegistry: ChainAddressMap = {
[CHAINS.Mainnet]: '0x55032650b14df07b85bF18A3a3eC8E0Af2e028d5',
[CHAINS.Goerli]: '0x9D4AF1Ee19Dad8857db3a45B0374c81c8A1C6320',
[CHAINS.Holesky]: '0x595F64Ddc3856a3b5Ff4f4CC1d1fb4B46cFd2bAC',
}

export const AragonAgent: ChainAddressMap = {
[CHAINS.Mainnet]: '0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c',
[CHAINS.Goerli]: '0x4333218072D5d7008546737786663c38B4D561A4',
[CHAINS.Holesky]: '0xE92329EC7ddB11D25e25b3c21eeBf11f15eB325d ',
}

export const AragonACL: ChainAddressMap = {
[CHAINS.Mainnet]: '0x9895F0F17cc1d1891b6f18ee0b483B6f221b37Bb',
[CHAINS.Goerli]: '0xb3cf58412a00282934d3c3e73f49347567516e98',
[CHAINS.Holesky]: '0xfd1E42595CeC3E83239bf8dFc535250e7F48E0bC ',
}

export const VotingRepo: ChainAddressMap = {
[CHAINS.Mainnet]: '0x4Ee3118E3858E8D7164A634825BfE0F73d99C792',
[CHAINS.Goerli]: '0x14de4f901ce0b81f4efca594ad7b70935c276806',
[CHAINS.Holesky]: '0x2997EA0D07D79038D83Cb04b3BB9A2Bc512E3fDA ',
}

export const LidoDAO: ChainAddressMap = {
[CHAINS.Mainnet]: '0xb8FFC3Cd6e7Cf5a098A1c92F48009765B24088Dc',
[CHAINS.Goerli]: '0x1dD91b354Ebd706aB3Ac7c727455C7BAA164945A',
[CHAINS.Holesky]: '0x3b03f75Ec541Ca11a223bB58621A3146246E1644',
}

export const EasyTrack: ChainAddressMap = {
[CHAINS.Mainnet]: '0xF0211b7660680B49De1A7E9f25C65660F0a13Fea',
[CHAINS.Goerli]: '0xAf072C8D368E4DD4A9d4fF6A76693887d6ae92Af',
[CHAINS.Holesky]: '0x1763b9ED3586B08AE796c7787811a2E1bc16163a',
}

export const TokenRecovererForManagerContracts: ChainAddressMap = {
[CHAINS.Mainnet]: '0x1bdfFe0EBef3FEAdF2723D3330727D73f538959C',
[CHAINS.Goerli]: '0x0000000000000000000000000000000000000000',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const LidoAppRepo: ChainAddressMap = {
[CHAINS.Mainnet]: '0xF5Dc67E54FC96F993CD06073f71ca732C1E654B1',
[CHAINS.Goerli]: '0xE9eDe497d2417fd980D8B5338232666641B9B9aC',
[CHAINS.Holesky]: '0xA37fb4C41e7D30af5172618a863BBB0f9042c604 ',
}

export const NodeOperatorsRegistryRepo: ChainAddressMap = {
[CHAINS.Mainnet]: '0x0D97E876ad14DB2b183CFeEB8aa1A5C788eB1831',
[CHAINS.Goerli]: '0x5F867429616b380f1Ca7a7283Ff18C53a0033073',
[CHAINS.Holesky]: '0x4E8970d148CB38460bE9b6ddaab20aE2A74879AF ',
}

export const Steth: ChainAddressMap = {
[CHAINS.Mainnet]: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
[CHAINS.Goerli]: '0x1643e812ae58766192cf7d2cf9567df2c37e9b7f',
[CHAINS.Holesky]: '0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034 ',
}

export const OracleRepo: ChainAddressMap = {
[CHAINS.Mainnet]: '0xF9339DE629973c60c4d2b76749c81E6F40960E3A',
[CHAINS.Goerli]: '0x9234e37Adeb44022A078557D9943b72AB89bF36a',
[CHAINS.Holesky]: '0xB3d74c319C0C792522705fFD3097f873eEc71764',
}

export const LegacyOracle: ChainAddressMap = {
[CHAINS.Mainnet]: '0x442af784A788A5bd6F42A01Ebe9F287a871243fb',
[CHAINS.Goerli]: '0x24d8451BC07e7aF4Ba94F69aCDD9ad3c6579D9FB',
[CHAINS.Holesky]: ' 0x072f72BE3AcFE2c52715829F2CD9061A6C8fF019',
}

export const CompositePostRebaseBeaconReceiver: ChainAddressMap = {
[CHAINS.Mainnet]: '0x55a7E1cbD678d9EbD50c7d69Dc75203B0dBdD431',
[CHAINS.Goerli]: '0x5d2113f7691ac6Df5E3f41Fb938429ACEAD2C94f',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const DepositSecurityModule: ChainAddressMap = {
[CHAINS.Mainnet]: '0x710b3303fb508a84f10793c1106e32be873c24cd',
[CHAINS.Goerli]: '0x7dc1c1ff64078f73c98338e2f17d1996ffbb2ede',
[CHAINS.Holesky]: '0x045dd46212A178428c088573A7d102B9d89a022A',
}

export const WithdrawalVault: ChainAddressMap = {
[CHAINS.Mainnet]: '0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f',
[CHAINS.Goerli]: '0xdc62f9e8C34be08501Cdef4EBDE0a280f576D762',
[CHAINS.Holesky]: '0xF0179dEC45a37423EAD4FaD5fCb136197872EAd9',
}

export const ShapellaUpgradeTemplate: ChainAddressMap = {
[CHAINS.Mainnet]: '0xa818ff9ec93122bf9401ab4340c42de638cd600a',
[CHAINS.Goerli]: '0xD2fEf3d3544ddf64028784aC3f166413A2A61393',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const StakingRouter: ChainAddressMap = {
[CHAINS.Mainnet]: '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',
[CHAINS.Goerli]: '0xa3dbd317e53d363176359e10948ba0b1c0a4c820',
[CHAINS.Holesky]: '0xd6EbF043D30A7fe46D1Db32BA90a0A51207FE229',
}

export const LidoLocator: ChainAddressMap = {
[CHAINS.Mainnet]: '0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb',
[CHAINS.Goerli]: '0x1eDf09b5023DC86737b59dE68a8130De878984f5',
[CHAINS.Holesky]: '0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8',
}

export const WithdrawalQueueERC721: ChainAddressMap = {
[CHAINS.Mainnet]: '0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1',
[CHAINS.Goerli]: '0xcf117961421ca9e546cd7f50bc73abcdb3039533',
[CHAINS.Holesky]: '0xc7cc160b58F8Bb0baC94b80847E2CF2800565C50',
}

export const OracleReportSanityChecker: ChainAddressMap = {
[CHAINS.Mainnet]: '0x9305c1Dbfe22c12c66339184C0025d7006f0f1cC',
[CHAINS.Goerli]: '0xbf74600040F91D3560d5757280727FB00c64Fd2E',
[CHAINS.Holesky]: '0xF0d576c7d934bBeCc68FE15F1c5DAF98ea2B78bb',
}

export const OracleDaemonConfig: ChainAddressMap = {
[CHAINS.Mainnet]: '0xbf05A929c3D7885a6aeAd833a992dA6E5ac23b09',
[CHAINS.Goerli]: '0xE9CC5bD91543cdc9788454EE5063E2CD76B5206d',
[CHAINS.Holesky]: '0xC01fC1F2787687Bc656EAc0356ba9Db6e6b7afb7',
}

export const HashConsensusAccountingOracle: ChainAddressMap = {
[CHAINS.Mainnet]: '0xD624B08C83bAECF0807Dd2c6880C3154a5F0B288',
[CHAINS.Goerli]: '0x8d87A8BCF8d4e542fd396D1c50223301c164417b',
[CHAINS.Holesky]: '0xa067FC95c22D51c3bC35fd4BE37414Ee8cc890d2',
}

export const HashConsensusValidatorsExitBus: ChainAddressMap = {
[CHAINS.Mainnet]: '0x7FaDB6358950c5fAA66Cb5EB8eE5147De3df355a',
[CHAINS.Goerli]: '0x8374B4aC337D7e367Ea1eF54bB29880C3f036A51',
[CHAINS.Holesky]: '0xe77Cf1A027d7C10Ee6bb7Ede5E922a181FF40E8f',
}

// TODO: add once deployed on holesky
export const TRPVestingEscrowFactory: ChainAddressMap = {
[CHAINS.Mainnet]: '0xDA1DF6442aFD2EC36aBEa91029794B9b2156ADD0',
[CHAINS.Goerli]: '0x8D20FD1Ac547e035BF01089cFb92459054F82Ff7',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const AccountingOracle: ChainAddressMap = {
[CHAINS.Mainnet]: '0x852deD011285fe67063a08005c71a85690503Cee',
[CHAINS.Goerli]: '0x76f358A842defa0E179a8970767CFf668Fc134d6',
[CHAINS.Holesky]: '0x4E97A3972ce8511D87F334dA17a2C332542a5246',
}

export const ValidatorsExitBusOracle: ChainAddressMap = {
[CHAINS.Mainnet]: '0x0De4Ea0184c2ad0BacA7183356Aea5B8d5Bf5c6e',
[CHAINS.Goerli]: '0xb75A55EFab5A8f5224Ae93B34B25741EDd3da98b',
[CHAINS.Holesky]: '0xffDDF7025410412deaa05E3E1cE68FE53208afcb',
}

// TODO: add once deployed on holesky
export const MEVBoostRelayAllowedList: ChainAddressMap = {
[CHAINS.Mainnet]: '0xF95f069F9AD107938F6ba802a3da87892298610E',
[CHAINS.Goerli]: '0xeabE95AC5f3D64aE16AcBB668Ed0efcd81B721Bc',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const WithdrawalQueueEarlyCommitment: ChainAddressMap = {
[CHAINS.Mainnet]: '',
[CHAINS.Mainnet]: '0x0000000000000000000000000000000000000000',
[CHAINS.Goerli]: '0xB0F260CC0906197ED75A5d722890bB9efe2c506A',
[CHAINS.Holesky]: '0x0000000000000000000000000000000000000000',
}

export const ExecutionLayerRewardsVault: ChainAddressMap = {
[CHAINS.Mainnet]: '0x388C818CA8B9251b393131C08a736A67ccB19297',
[CHAINS.Goerli]: '0x94750381bE1AbA0504C666ee1DB118F68f0780D4',
[CHAINS.Holesky]: '0xE73a3602b99f1f913e72F8bdcBC235e206794Ac8',
}

export const Burner: ChainAddressMap = {
[CHAINS.Mainnet]: '0xD15a672319Cf0352560eE76d9e89eAB0889046D3',
[CHAINS.Goerli]: '0x20c61C07C2E2FAb04BF5b4E12ce45a459a18f3B1',
[CHAINS.Holesky]: '0x4E46BD7147ccf666E1d73A3A456fC7a68de82eCA',
}

export const SimpleDVT: ChainAddressMap = {
[CHAINS.Mainnet]: '0xaE7B191A31f627b4eB1d4DaC64eaB9976995b433',
[CHAINS.Holesky]: '0x11a93807078f8BB880c1BD0ee4C387537de4b4b6',
}
1 change: 1 addition & 0 deletions modules/blockChain/utils/getGnosisSafeLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CHAINS } from '@lido-sdk/constants'
const PREFIXES = {
[CHAINS.Mainnet]: 'eth',
[CHAINS.Goerli]: 'gor',
[CHAINS.Holesky]: 'hol',
} as const

export const getGnosisSafeLink = (chainId: CHAINS, address: string) =>
Expand Down
7 changes: 2 additions & 5 deletions modules/dashboard/ui/DashboardVote/DashboardVote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import * as urls from 'modules/network/utils/urls'
type Props = {
voteId: number
vote: Vote
eventStart: StartVoteEventObject
eventStart: StartVoteEventObject | null
status: VoteStatus
voteTime: number
objectionPhaseTime: number
Expand Down Expand Up @@ -79,9 +79,6 @@ export function DashboardVote({

const isEnded =
status === VoteStatus.Rejected || status === VoteStatus.Executed

const { metadata } = eventStart

return (
<Link passHref href={urls.vote(voteId)}>
<Wrap>
Expand All @@ -98,7 +95,7 @@ export function DashboardVote({
<VoteBody>
<VoteTitle>Vote #{voteId}</VoteTitle>
<VoteDescriptionWrap>
<VoteDescription metadata={metadata} />
<VoteDescription metadata={eventStart?.metadata} />
</VoteDescriptionWrap>
</VoteBody>

Expand Down
1 change: 1 addition & 0 deletions modules/shared/utils/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const contentSecurityPolicy = {
'https://*.infura.io',
'https://*.alchemyapi.io',
'https://*.alchemy.com',
'https://*.drpc.org',
'https://*.etherscan.io/api',
'https://*.ipfs.w3s.link',
'https://*.ipfs.dweb.link',
Expand Down
1 change: 1 addition & 0 deletions modules/votes/hooks/useEvmScriptDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function useEVMScriptDecoder(): EVMScriptDecoder {
[KEYS.ExecutionLayerRewardsVault]:
abis.ExecutionLayerRewardsVaultAbi__factory.abi,
[KEYS.Burner]: abis.BurnerAbi__factory.abi,
[KEYS.SimpleDVT]: abis.NodeOperatorsRegistryAbi__factory.abi,
})

const etherscanDecoder = new abiProviders.Base({
Expand Down
10 changes: 7 additions & 3 deletions modules/votes/ui/VoteDescription/VoteDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ import { fetcherIPFS } from 'modules/network/utils/fetcherIPFS'
import { useSWR } from 'modules/network/hooks/useSwr'

type Props = {
metadata: string
metadata: string | undefined
allowMD?: boolean
}

const trimStart = (string = '') => `${string}`.replace(/^\s+/, '')

export function VoteDescription({ metadata, allowMD }: Props) {
const cid = metadata.match(REGEX_LIDO_VOTE_CID)?.[1] || null
const cid = metadata?.match(REGEX_LIDO_VOTE_CID)?.[1] || null

const {
data = '',
error,
initialLoading,
} = useSWR(cid, fetcherIPFS, { onError: noop })

if (!cid) {
if (!metadata) {
return <DescriptionText>Failed to fetch vote description.</DescriptionText>
}

if (!cid && metadata) {
return <DescriptionText>{replaceJsxElements(metadata)}</DescriptionText>
}

Expand Down
2 changes: 1 addition & 1 deletion modules/votes/utils/getEventVoteStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function getEventStartVote(
)
const event = events[0]
if (!events[0] || !event.decode) {
throw new Error('Start vote event parsing error')
return null
}
const decoded = event.decode(event.data, event.topics)
return decoded as StartVoteEventObject
Expand Down
Loading

0 comments on commit f180efd

Please sign in to comment.