Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions example/contracts/script/DeployAVS.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contract DeployAVS is Script, Test {
slashingRegistryCoordinator,
IDelegationManager(eigenlayerDeployment.delegationManager),
IAVSDirectory(eigenlayerDeployment.avsDirectory),
IAllocationManager(address(0))
IAllocationManager(eigenlayerDeployment.allocationManager)
);

avsProxyAdmin.upgrade(
Expand Down Expand Up @@ -260,10 +260,11 @@ contract DeployAVS is Script, Test {
);

for (uint i = 0; i < strategies.length; i++) {
slashingRegistryCoordinator.createTotalDelegatedStakeQuorum(
slashingRegistryCoordinator.createSlashableStakeQuorum(
operatorSetParams[i],
minimumStakeForQuourm[i],
strategyAndWeightingMultipliers[i]
strategyAndWeightingMultipliers[i],
1
);
}
}
Expand Down Expand Up @@ -292,6 +293,11 @@ contract DeployAVS is Script, Test {
vm.serializeAddress(output, "operatorStateRetriever", address(operatorStateRetriever));
vm.serializeAddress(output, "avsProxyAdmin", address(avsProxyAdmin));
vm.serializeAddress(output, "avsPauserReg", address(avsPauserReg));
address[] memory strategyAddresses = new address[](strategies.length);
for (uint i = 0; i < strategies.length; i++) {
strategyAddresses[i] = address(strategies[i]);
}
vm.serializeAddress(output, "strategies", strategyAddresses);
vm.serializeUint(output, "deploymentBlock", deploymentBlock);

string memory finalJson = vm.serializeString(output, "object", output);
Expand Down
25 changes: 14 additions & 11 deletions example/contracts/script/output/avs_deploy_output.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"apkRegistry": "0x2233b18fb577f4767797571831D4693a67386B76",
"avsPauserReg": "0x0bB05Fd1687B1E56AEcdD37A27b8974564b22a36",
"avsProxyAdmin": "0xD8906Ed56832C5B7e61512Ed0e8c6794d8701f29",
"certificateVerifier": "0x623F9C932A188a6A006342013e947dd18f844397",
"deploymentBlock": 3299059,
"indexRegistry": "0x889Ed72836573259cb87DA19a63D65Ed1F0dCd33",
"apkRegistry": "0x1942036E934fDad159B247EEE0e53810CC53F2ea",
"avsPauserReg": "0xC6E2e14A1E3582316A5Bf1A0a7cCBE73e40f54C4",
"avsProxyAdmin": "0x822240a5c18c1E77552F0f71c7C2E68A21805cC8",
"certificateVerifier": "0xa48B728924E9b14a98Af4b9c4129663728B8F174",
"deploymentBlock": 3326051,
"indexRegistry": "0x4fDa92A3bBb01cBBBDcD13828FbD2E807cf82Ac3",
"object": "deployment",
"operatorStateRetriever": "0x2760Ec0E2b723156f7a33cfB54ae3096cfBc2ECF",
"serviceManager": "0x7e148Bb691b41279c7ade56Dd84D652e4df3dc30",
"slashingRegistryCoordinator": "0xCb0dd2ce1876B61ac9A7A99d3c1D18ac68f85a27",
"socketRegistry": "0x9b619837Bd2E2DeCa07A66D488f1CcEB087a573C",
"stakeRegistry": "0x94D759bE3cE57Ee1A097EEf2aDD986331eD01450"
"operatorStateRetriever": "0xbfbdfF7C2974016a1BE4faF037b0aA34Ea492c97",
"serviceManager": "0x2a9c3255A4E982603b0b0a23869FCf21210A4c35",
"slashingRegistryCoordinator": "0x7a90D3B0820565d4B026a0B20ef7ff0Cd70f5fca",
"socketRegistry": "0xB2f1212d68D2f4D42783dDF536D0067615878a31",
"stakeRegistry": "0x52dF6f4Aba3aF50c71321B17fbE2c87355e352b7",
"strategies": [
"0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3"
]
}
2 changes: 1 addition & 1 deletion example/scripts/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ operator:
address: <OPERATOR_ADDRESS>
delegation_approver_address: "0x0000000000000000000000000000000000000000"
metadata_url: "https://madhur-test-public.s3.us-east-2.amazonaws.com/metadata.json"
allocation_delay: 1200
allocation_delay: 0
el_delegation_manager_address: 0xA44151489861Fe9e3055d95adC98FbD462B948e7
eth_rpc_url: <ETH_RPC_URL>
chain_id: 17000
Expand Down
20 changes: 19 additions & 1 deletion example/scripts/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts"
"github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet"
"github.com/Layr-Labs/eigensdk-go/chainio/txmgr"
contractAllocationManager "github.com/Layr-Labs/eigensdk-go/contracts/bindings/AllocationManager"
"github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Layr-Labs/eigensdk-go/metrics"
rpccalls "github.com/Layr-Labs/eigensdk-go/metrics/collectors/rpc_calls"
Expand Down Expand Up @@ -153,6 +154,23 @@ func start(c *cli.Context) error {
}
}

reciept, err := elWriter.ModifyAllocations(context.Background(), common.HexToAddress(operator.Address), []contractAllocationManager.IAllocationManagerTypesAllocateParams{
{
OperatorSet: contractAllocationManager.OperatorSet{
Avs: avsDeployment.ServiceManager,
Id: 0,
},
Strategies: avsDeployment.Strategies,
NewMagnitudes: []uint64{100000},
},
}, true)
if err != nil {
logger.Error("Failed to modify allocations", "error", err)
return err
} else {
logger.Info("Modified allocations", "tx", reciept.TxHash.Hex())
}

registrationRequest := elcontracts.RegistrationRequest{
OperatorAddress: common.HexToAddress(operator.Address),
AVSAddress: avsDeployment.ServiceManager,
Expand All @@ -163,7 +181,7 @@ func start(c *cli.Context) error {
}

// register for operator set through allocationManager
reciept, err := elWriter.RegisterForOperatorSets(
reciept, err = elWriter.RegisterForOperatorSets(
context.Background(),
avsDeployment.SlashingRegistryCoordinator,
registrationRequest,
Expand Down
11 changes: 6 additions & 5 deletions example/utils/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ type EigenLayerDeployment struct {
}

type AVSDeployment struct {
DeploymentBlock uint64 `json:"deploymentBlock"`
CertificateVerifier common.Address `json:"certificateVerifier"`
SlashingRegistryCoordinator common.Address `json:"slashingRegistryCoordinator"`
OperatorStateRetriever common.Address `json:"operatorStateRetriever"`
ServiceManager common.Address `json:"serviceManager"`
DeploymentBlock uint64 `json:"deploymentBlock"`
CertificateVerifier common.Address `json:"certificateVerifier"`
SlashingRegistryCoordinator common.Address `json:"slashingRegistryCoordinator"`
OperatorStateRetriever common.Address `json:"operatorStateRetriever"`
ServiceManager common.Address `json:"serviceManager"`
Strategies []common.Address `json:"strategies"`
}

func ReadEigenlayerDeployment(path string) (elcontracts.Config, error) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Layr-Labs/teal
go 1.22.3

require (
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504
github.com/ethereum/go-ethereum v1.14.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1
github.com/prometheus/client_golang v1.19.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82 h1:mR6ifQm7OfOMlIf23yQxSp7GirVVVYEVGiqBljjpzG4=
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250205192711-536054ac6e82/go.mod h1:egvhubWT+zCx37f2645i8NBrav0Hqek3LnmQdXHP/M8=
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504 h1:rpIOK+hUYgVjBdmOOfiWvAb28Bt/nrZsWS+/Ga7g2Kg=
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1.0.20250207210609-6dda27b46504/go.mod h1:egvhubWT+zCx37f2645i8NBrav0Hqek3LnmQdXHP/M8=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
Expand Down