Skip to content

Commit

Permalink
Upd contracts (#365)
Browse files Browse the repository at this point in the history
* Upd contracts

* Add missing params

* Add DEPOSIT_DATA_REGISTRY_CONTRACT_ADDRESS for chiado

* Del VALIDATORS_CHECKER_CONTRACT_ADDRESS

* Add -u option to docker commands

* Fix docker-compose.yml
  • Loading branch information
evgeny-stakewise authored Jul 6, 2024
1 parent 22c6e14 commit 9c52e24
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 29 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ You will execute Operator Service commands using the format below (note the use

```bash
docker run --rm -ti \
-u $(id -u):$(id -g) \
-v ~/.stakewise/:/data \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v1.3.2 \
src/main.py COMMAND \
Expand Down Expand Up @@ -385,6 +386,7 @@ below:

```bash
docker run --restart on-failure:10 \
-u $(id -u):$(id -g) \
-v ~/.stakewise/:/data \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v1.3.2 \
src/main.py start \
Expand Down
5 changes: 1 addition & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ version: "3.9"

services:
operator:
build:
context: .
dockerfile: europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v1.3.2
image: v3-operator
image: europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v1.3.2
container_name: v3-operator
command: ["src/main.py", "start"]
volumes:
Expand Down
102 changes: 100 additions & 2 deletions src/common/abi/IEthVault.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@
"name": "ExitedAssetsClaimed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "penalty",
"type": "uint256"
}
],
"name": "ExitingAssetsPenalized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -482,9 +495,9 @@
{
"inputs": [
{
"internalType": "uint256",
"internalType": "uint128",
"name": "osTokenShares",
"type": "uint256"
"type": "uint128"
}
],
"name": "burnOsToken",
Expand Down Expand Up @@ -640,6 +653,35 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"internalType": "uint256",
"name": "osTokenShares",
"type": "uint256"
},
{
"internalType": "address",
"name": "referrer",
"type": "address"
}
],
"name": "depositAndMintOsToken",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -1135,6 +1177,62 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "receiver",
"type": "address"
},
{
"internalType": "uint256",
"name": "osTokenShares",
"type": "uint256"
},
{
"internalType": "address",
"name": "referrer",
"type": "address"
},
{
"components": [
{
"internalType": "bytes32",
"name": "rewardsRoot",
"type": "bytes32"
},
{
"internalType": "int160",
"name": "reward",
"type": "int160"
},
{
"internalType": "uint160",
"name": "unlockedMevReward",
"type": "uint160"
},
{
"internalType": "bytes32[]",
"name": "proof",
"type": "bytes32[]"
}
],
"internalType": "struct IKeeperRewards.HarvestParams",
"name": "harvestParams",
"type": "tuple"
}
],
"name": "updateStateAndDepositAndMintOsToken",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "validatorsManager",
Expand Down
46 changes: 23 additions & 23 deletions src/config/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class NetworkConfig:
SHARED_MEV_ESCROW_CONTRACT_ADDRESS: ChecksumAddress
STAKEWISE_API_URL: str
RATED_API_URL: str
VALIDATORS_CHECKER_CONTRACT_ADDRESS: ChecksumAddress

@property
def SHAPELLA_FORK(self) -> ConsensusFork:
Expand Down Expand Up @@ -107,7 +106,6 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
),
STAKEWISE_API_URL='https://mainnet-api.stakewise.io/graphql',
RATED_API_URL='https://api.rated.network',
VALIDATORS_CHECKER_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
),
HOLESKY: NetworkConfig(
CHAIN_ID=17000,
Expand Down Expand Up @@ -149,9 +147,6 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
),
STAKEWISE_API_URL='https://holesky-api.stakewise.io/graphql',
RATED_API_URL='https://api.rated.network',
VALIDATORS_CHECKER_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x23FCd08f2e85f765d329027AB6D4323a0BC057A7'
),
),
GNOSIS: NetworkConfig(
CHAIN_ID=100,
Expand All @@ -161,16 +156,23 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
'0x0B98057eA310F4d31F2a452B414647007d1645d9'
),
VALIDATORS_REGISTRY_GENESIS_BLOCK=BlockNumber(19469076),
# TODO: replace with real values once contracts deployed
KEEPER_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
KEEPER_GENESIS_BLOCK=BlockNumber(0),
DEPOSIT_DATA_REGISTRY_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
KEEPER_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0xcAC0e3E35d3BA271cd2aaBE688ac9DB1898C26aa'
),
KEEPER_GENESIS_BLOCK=BlockNumber(34778552),
DEPOSIT_DATA_REGISTRY_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x58e16621B5c0786D6667D2d54E28A20940269E16'
),
V2_POOL_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x2f99472b727e15EECf9B9eFF9F7481B85d3b4444'
),
V2_POOL_GENESIS_BLOCK=BlockNumber(21275812),
V2_POOL_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
GENESIS_VAULT_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
V2_POOL_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0xfc9B67b6034F6B306EA9Bd8Ec1baf3eFA2490394'
),
GENESIS_VAULT_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x4b4406Ed8659D03423490D8b62a1639206dA0A7a'
),
GENESIS_VALIDATORS_ROOT=Bytes32(
Web3.to_bytes(
hexstr=HexStr('0xf5dcb5564e829aab27264b9becd5dfaa017085611224cb3036f573368dbb9d47')
Expand All @@ -182,15 +184,16 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
GENESIS_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x00000064')),
IS_POA=False,
HOT_WALLET_MIN_BALANCE=Web3.to_wei('0.03', 'ether'),
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x0')),
SHAPELLA_EPOCH=0, # todo
SHAPELLA_FORK_VERSION=Web3.to_bytes(hexstr=HexStr('0x03000064')),
SHAPELLA_EPOCH=648704,
MULTICALL_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0xcA11bde05977b3631167028862bE2a173976CA11'
),
SHARED_MEV_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
SHARED_MEV_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x30db0d10d3774e78f8cB214b9e8B72D4B402488a'
),
STAKEWISE_API_URL='https://gnosis-api.stakewise.io/graphql',
RATED_API_URL='https://api.rated.network',
VALIDATORS_CHECKER_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
),
CHIADO: NetworkConfig(
CHAIN_ID=10200,
Expand All @@ -201,17 +204,17 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
),
VALIDATORS_REGISTRY_GENESIS_BLOCK=BlockNumber(155434),
KEEPER_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x13Af1266d8664aF3da4c711E7C86725D4779EA72'
'0x5f31eD13eBF81B67a9f9498F3d1D2Da553058988'
),
KEEPER_GENESIS_BLOCK=BlockNumber(10258082),
KEEPER_GENESIS_BLOCK=BlockNumber(10627588),
DEPOSIT_DATA_REGISTRY_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0xf9eB9EAd3d71516bF5206F702B8BD0c183045474'
'0xFAce8504462AEb9BB6ae7Ecb206BD7B1EdF7956D'
),
V2_POOL_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
V2_POOL_GENESIS_BLOCK=BlockNumber(0),
V2_POOL_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(EMPTY_ADDR_HEX),
GENESIS_VAULT_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0xF3d3071905A6495a4D2f8650E8b3baaAE827DD13'
'0xF82f6E46d0d0a9536b9CA4bc480372EeaFcd9E6c'
),
GENESIS_VALIDATORS_ROOT=Bytes32(
Web3.to_bytes(
Expand All @@ -230,12 +233,9 @@ def IS_SUPPORT_V2_MIGRATION(self) -> bool:
'0xcA11bde05977b3631167028862bE2a173976CA11'
),
SHARED_MEV_ESCROW_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x069a8fF3cD84B2F861F9554E4b2c3FFA3F89b6bD'
'0x453056f0bc4631abB15eEC656139f88067668E3E'
),
STAKEWISE_API_URL='https://chiado-api.stakewise.io/graphql',
RATED_API_URL='https://api.rated.network',
VALIDATORS_CHECKER_CONTRACT_ADDRESS=Web3.to_checksum_address(
'0x5Fa9600FF682FA65Fff6085df06CCBB7dC01DF08'
),
),
}

0 comments on commit 9c52e24

Please sign in to comment.