Skip to content

Commit 070ec60

Browse files
authored
Merge pull request #3 from Layr-Labs/modify-allocs
feat: start on modify alloc
2 parents d15d93b + d6c1645 commit 070ec60

File tree

7 files changed

+52
-22
lines changed

7 files changed

+52
-22
lines changed

example/contracts/script/DeployAVS.s.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ contract DeployAVS is Script, Test {
151151
slashingRegistryCoordinator,
152152
IDelegationManager(eigenlayerDeployment.delegationManager),
153153
IAVSDirectory(eigenlayerDeployment.avsDirectory),
154-
IAllocationManager(address(0))
154+
IAllocationManager(eigenlayerDeployment.allocationManager)
155155
);
156156

157157
avsProxyAdmin.upgrade(
@@ -260,10 +260,11 @@ contract DeployAVS is Script, Test {
260260
);
261261

262262
for (uint i = 0; i < strategies.length; i++) {
263-
slashingRegistryCoordinator.createTotalDelegatedStakeQuorum(
263+
slashingRegistryCoordinator.createSlashableStakeQuorum(
264264
operatorSetParams[i],
265265
minimumStakeForQuourm[i],
266-
strategyAndWeightingMultipliers[i]
266+
strategyAndWeightingMultipliers[i],
267+
1
267268
);
268269
}
269270
}
@@ -292,6 +293,11 @@ contract DeployAVS is Script, Test {
292293
vm.serializeAddress(output, "operatorStateRetriever", address(operatorStateRetriever));
293294
vm.serializeAddress(output, "avsProxyAdmin", address(avsProxyAdmin));
294295
vm.serializeAddress(output, "avsPauserReg", address(avsPauserReg));
296+
address[] memory strategyAddresses = new address[](strategies.length);
297+
for (uint i = 0; i < strategies.length; i++) {
298+
strategyAddresses[i] = address(strategies[i]);
299+
}
300+
vm.serializeAddress(output, "strategies", strategyAddresses);
295301
vm.serializeUint(output, "deploymentBlock", deploymentBlock);
296302

297303
string memory finalJson = vm.serializeString(output, "object", output);
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
2-
"apkRegistry": "0x2233b18fb577f4767797571831D4693a67386B76",
3-
"avsPauserReg": "0x0bB05Fd1687B1E56AEcdD37A27b8974564b22a36",
4-
"avsProxyAdmin": "0xD8906Ed56832C5B7e61512Ed0e8c6794d8701f29",
5-
"certificateVerifier": "0x623F9C932A188a6A006342013e947dd18f844397",
6-
"deploymentBlock": 3299059,
7-
"indexRegistry": "0x889Ed72836573259cb87DA19a63D65Ed1F0dCd33",
2+
"apkRegistry": "0x1942036E934fDad159B247EEE0e53810CC53F2ea",
3+
"avsPauserReg": "0xC6E2e14A1E3582316A5Bf1A0a7cCBE73e40f54C4",
4+
"avsProxyAdmin": "0x822240a5c18c1E77552F0f71c7C2E68A21805cC8",
5+
"certificateVerifier": "0xa48B728924E9b14a98Af4b9c4129663728B8F174",
6+
"deploymentBlock": 3326051,
7+
"indexRegistry": "0x4fDa92A3bBb01cBBBDcD13828FbD2E807cf82Ac3",
88
"object": "deployment",
9-
"operatorStateRetriever": "0x2760Ec0E2b723156f7a33cfB54ae3096cfBc2ECF",
10-
"serviceManager": "0x7e148Bb691b41279c7ade56Dd84D652e4df3dc30",
11-
"slashingRegistryCoordinator": "0xCb0dd2ce1876B61ac9A7A99d3c1D18ac68f85a27",
12-
"socketRegistry": "0x9b619837Bd2E2DeCa07A66D488f1CcEB087a573C",
13-
"stakeRegistry": "0x94D759bE3cE57Ee1A097EEf2aDD986331eD01450"
9+
"operatorStateRetriever": "0xbfbdfF7C2974016a1BE4faF037b0aA34Ea492c97",
10+
"serviceManager": "0x2a9c3255A4E982603b0b0a23869FCf21210A4c35",
11+
"slashingRegistryCoordinator": "0x7a90D3B0820565d4B026a0B20ef7ff0Cd70f5fca",
12+
"socketRegistry": "0xB2f1212d68D2f4D42783dDF536D0067615878a31",
13+
"stakeRegistry": "0x52dF6f4Aba3aF50c71321B17fbE2c87355e352b7",
14+
"strategies": [
15+
"0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3"
16+
]
1417
}

example/scripts/operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ operator:
22
address: <OPERATOR_ADDRESS>
33
delegation_approver_address: "0x0000000000000000000000000000000000000000"
44
metadata_url: "https://madhur-test-public.s3.us-east-2.amazonaws.com/metadata.json"
5-
allocation_delay: 1200
5+
allocation_delay: 0
66
el_delegation_manager_address: 0xA44151489861Fe9e3055d95adC98FbD462B948e7
77
eth_rpc_url: <ETH_RPC_URL>
88
chain_id: 17000

example/scripts/register.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts"
1010
"github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet"
1111
"github.com/Layr-Labs/eigensdk-go/chainio/txmgr"
12+
contractAllocationManager "github.com/Layr-Labs/eigensdk-go/contracts/bindings/AllocationManager"
1213
"github.com/Layr-Labs/eigensdk-go/logging"
1314
"github.com/Layr-Labs/eigensdk-go/metrics"
1415
rpccalls "github.com/Layr-Labs/eigensdk-go/metrics/collectors/rpc_calls"
@@ -153,6 +154,23 @@ func start(c *cli.Context) error {
153154
}
154155
}
155156

157+
reciept, err := elWriter.ModifyAllocations(context.Background(), common.HexToAddress(operator.Address), []contractAllocationManager.IAllocationManagerTypesAllocateParams{
158+
{
159+
OperatorSet: contractAllocationManager.OperatorSet{
160+
Avs: avsDeployment.ServiceManager,
161+
Id: 0,
162+
},
163+
Strategies: avsDeployment.Strategies,
164+
NewMagnitudes: []uint64{100000},
165+
},
166+
}, true)
167+
if err != nil {
168+
logger.Error("Failed to modify allocations", "error", err)
169+
return err
170+
} else {
171+
logger.Info("Modified allocations", "tx", reciept.TxHash.Hex())
172+
}
173+
156174
registrationRequest := elcontracts.RegistrationRequest{
157175
OperatorAddress: common.HexToAddress(operator.Address),
158176
AVSAddress: avsDeployment.ServiceManager,
@@ -163,7 +181,7 @@ func start(c *cli.Context) error {
163181
}
164182

165183
// register for operator set through allocationManager
166-
reciept, err := elWriter.RegisterForOperatorSets(
184+
reciept, err = elWriter.RegisterForOperatorSets(
167185
context.Background(),
168186
avsDeployment.SlashingRegistryCoordinator,
169187
registrationRequest,

example/utils/deployment.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ type EigenLayerDeployment struct {
1818
}
1919

2020
type AVSDeployment struct {
21-
DeploymentBlock uint64 `json:"deploymentBlock"`
22-
CertificateVerifier common.Address `json:"certificateVerifier"`
23-
SlashingRegistryCoordinator common.Address `json:"slashingRegistryCoordinator"`
24-
OperatorStateRetriever common.Address `json:"operatorStateRetriever"`
25-
ServiceManager common.Address `json:"serviceManager"`
21+
DeploymentBlock uint64 `json:"deploymentBlock"`
22+
CertificateVerifier common.Address `json:"certificateVerifier"`
23+
SlashingRegistryCoordinator common.Address `json:"slashingRegistryCoordinator"`
24+
OperatorStateRetriever common.Address `json:"operatorStateRetriever"`
25+
ServiceManager common.Address `json:"serviceManager"`
26+
Strategies []common.Address `json:"strategies"`
2627
}
2728

2829
func ReadEigenlayerDeployment(path string) (elcontracts.Config, error) {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/Layr-Labs/teal
33
go 1.22.3
44

55
require (
6-
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82
6+
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504
77
github.com/ethereum/go-ethereum v1.14.0
88
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1
99
github.com/prometheus/client_golang v1.19.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
88
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
99
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82 h1:mR6ifQm7OfOMlIf23yQxSp7GirVVVYEVGiqBljjpzG4=
1010
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82/go.mod h1:egvhubWT+zCx37f2645i8NBrav0Hqek3LnmQdXHP/M8=
11+
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504 h1:rpIOK+hUYgVjBdmOOfiWvAb28Bt/nrZsWS+/Ga7g2Kg=
12+
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504/go.mod h1:egvhubWT+zCx37f2645i8NBrav0Hqek3LnmQdXHP/M8=
1113
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
1214
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
1315
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=

0 commit comments

Comments
 (0)