Skip to content

Commit 5b40744

Browse files
committed
Merge branch 'feat/next-vote' into feat/next-vote-with-core
2 parents f1aa5ac + 2761af5 commit 5b40744

12 files changed

+1077
-13
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cd scripts
3535
#### Step 3. Run the container
3636
Run the container in the `scripts` directory and specify the ENV VARs:
3737
```shell
38-
docker run --name scripts -v "$(pwd)":/root/scripts -e WEB3_INFURA_PROJECT_ID -d -p 2222:22 --rm ghcr.io/lidofinance/scripts:v10
38+
docker run --name scripts -v "$(pwd)":/root/scripts -e WEB3_INFURA_PROJECT_ID -d --rm ghcr.io/lidofinance/scripts:v10
3939

4040
```
4141
Note: *It may take up to 1 minute for the container to initialize properly the first time.*
+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
"""
2+
Voting 03/04/2025 [HOLESKY].
3+
4+
I. Change the limits & period for ET for LOL
5+
1: - Increase the limit from 210 to 500 USDC/USDT/DAI - set 500 limit on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`
6+
- Increase the period from 3 months to 6 months - set 6 months period on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`
7+
8+
"""
9+
10+
import time
11+
12+
from typing import Dict
13+
14+
from brownie import interface
15+
from brownie.network.transaction import TransactionReceipt
16+
from utils.voting import bake_vote_items, confirm_vote_script, create_vote
17+
from utils.ipfs import upload_vote_ipfs_description, calculate_vote_ipfs_description
18+
19+
from utils.config import (
20+
get_deployer_account,
21+
get_is_live,
22+
get_priority_fee,
23+
)
24+
25+
from utils.allowed_recipients_registry import (
26+
set_limit_parameters,
27+
)
28+
29+
from utils.agent import agent_forward
30+
31+
description = """
32+
I. Change the limits & period for ET for LOL
33+
1: - Increase the limit from 210 to 500 USDC/USDT/DAI - set 500 limit on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`
34+
- Increase the period from 3 months to 6 months - set 6 months period on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`
35+
"""
36+
37+
def start_vote(tx_params: Dict[str, str], silent: bool) -> bool | list[int | TransactionReceipt | None]:
38+
"""Prepare and run voting."""
39+
40+
lol_registry = interface.AllowedRecipientRegistry("0x55B304a585D540421F1fD3579Ef12Abab7304492")
41+
42+
vote_desc_items, call_script_items = zip(
43+
#
44+
# I. Change the limits & period for ET for LOL
45+
#
46+
(
47+
"""1: - Increase the limit from 210 to 500 USDC/USDT/DAI - set 500 limit on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`
48+
- Increase the period from 3 months to 6 months - set 6 months period on LOL registry `0x55B304a585D540421F1fD3579Ef12Abab7304492`""",
49+
agent_forward(
50+
[
51+
set_limit_parameters(
52+
registry_address=lol_registry,
53+
limit=500 * 10 ** 18,
54+
period_duration_months=6
55+
),
56+
]
57+
),
58+
),
59+
)
60+
61+
vote_items = bake_vote_items(list(vote_desc_items), list(call_script_items))
62+
63+
if silent:
64+
desc_ipfs = calculate_vote_ipfs_description(description)
65+
else:
66+
desc_ipfs = upload_vote_ipfs_description(description)
67+
68+
return confirm_vote_script(vote_items, silent, desc_ipfs) and list(
69+
create_vote(vote_items, tx_params, desc_ipfs=desc_ipfs)
70+
)
71+
72+
73+
def main():
74+
tx_params = {"from": get_deployer_account()}
75+
76+
if get_is_live():
77+
tx_params["priority_fee"] = get_priority_fee()
78+
79+
vote_id, _ = start_vote(tx_params=tx_params, silent=False)
80+
81+
vote_id >= 0 and print(f"Vote created: {vote_id}.")
82+
83+
time.sleep(5) # hack for waiting thread #2.

0 commit comments

Comments
 (0)