Skip to content

Adding owner check before adding registry module #17586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025
Merged
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
9 changes: 9 additions & 0 deletions deployment/ccip/changeset/cs_prerequisites.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@ func deployPrerequisiteContracts(e cldf.Environment, ab cldf.AddressBook, state
return fmt.Errorf("failed to check if registry module is added on token admin registry: %w", err)
}
if !isRegistryAdded {
owner, err := tokenAdminReg.Owner(nil)
if err != nil {
e.Logger.Errorw("Failed to get owner of token admin registry", "chain", chain.String(), "err", err)
return fmt.Errorf("failed to get owner of token admin registry: %w", err)
}
if owner != chain.DeployerKey.From {
e.Logger.Errorw("Owner is not deployer key, cannot add registry module", "chain", chain.String(), "owner", owner)
return fmt.Errorf("owner %s is not deployer key, cannot add registry module", owner)
}
tx, err := tokenAdminReg.AddRegistryModule(chain.DeployerKey, reg)
if err != nil {
e.Logger.Errorw("Failed to assign registry module on token admin registry", "chain", chain.String(), "err", err)
Expand Down
Loading