Skip to content
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

renamed _roles to unique name spaces #67

Merged
merged 2 commits into from
Dec 12, 2023
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
18 changes: 9 additions & 9 deletions src/child/ChildAxelarBridgeAdaptor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ contract ChildAxelarBridgeAdaptor is

/**
* @notice Initialization function for ChildAxelarBridgeAdaptor.
* @param _roles Struct containing addresses of roles.
* @param _adaptorRoles Struct containing addresses of roles.
* @param _childBridge Address of child bridge contract.
* @param _rootChainId Axelar's string ID for the root chain.
* @param _rootBridgeAdaptor Address of the bridge adaptor on the root chain.
* @param _gasService Address of Axelar Gas Service contract.
*/
function initialize(
InitializationRoles memory _roles,
InitializationRoles memory _adaptorRoles,
address _childBridge,
string memory _rootChainId,
string memory _rootBridgeAdaptor,
address _gasService
) external initializer {
if (
_childBridge == address(0) || _gasService == address(0) || _roles.defaultAdmin == address(0)
|| _roles.bridgeManager == address(0) || _roles.gasServiceManager == address(0)
|| _roles.targetManager == address(0)
_childBridge == address(0) || _gasService == address(0) || _adaptorRoles.defaultAdmin == address(0)
|| _adaptorRoles.bridgeManager == address(0) || _adaptorRoles.gasServiceManager == address(0)
|| _adaptorRoles.targetManager == address(0)
) {
revert ZeroAddress();
}
Expand All @@ -83,10 +83,10 @@ contract ChildAxelarBridgeAdaptor is
}
__AccessControl_init();

_grantRole(DEFAULT_ADMIN_ROLE, _roles.defaultAdmin);
_grantRole(BRIDGE_MANAGER_ROLE, _roles.bridgeManager);
_grantRole(GAS_SERVICE_MANAGER_ROLE, _roles.gasServiceManager);
_grantRole(TARGET_MANAGER_ROLE, _roles.targetManager);
_grantRole(DEFAULT_ADMIN_ROLE, _adaptorRoles.defaultAdmin);
_grantRole(BRIDGE_MANAGER_ROLE, _adaptorRoles.bridgeManager);
_grantRole(GAS_SERVICE_MANAGER_ROLE, _adaptorRoles.gasServiceManager);
_grantRole(TARGET_MANAGER_ROLE, _adaptorRoles.targetManager);

childBridge = IChildERC20Bridge(_childBridge);
rootChainId = _rootChainId;
Expand Down
18 changes: 9 additions & 9 deletions src/root/RootAxelarBridgeAdaptor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@ contract RootAxelarBridgeAdaptor is

/**
* @notice Initialization function for RootAxelarBridgeAdaptor.
* @param _roles Struct containing addresses of roles.
* @param _adaptorRoles Struct containing addresses of roles.
* @param _rootBridge Address of root bridge contract.
* @param _childChainId Axelar's ID for the child chain.
* @param _childBridgeAdaptor Address of the bridge adaptor on the child chain.
* @param _gasService Address of Axelar Gas Service contract.
*/
function initialize(
InitializationRoles memory _roles,
InitializationRoles memory _adaptorRoles,
address _rootBridge,
string memory _childChainId,
string memory _childBridgeAdaptor,
address _gasService
) public initializer {
if (
_rootBridge == address(0) || _gasService == address(0) || _roles.defaultAdmin == address(0)
|| _roles.bridgeManager == address(0) || _roles.gasServiceManager == address(0)
|| _roles.targetManager == address(0)
_rootBridge == address(0) || _gasService == address(0) || _adaptorRoles.defaultAdmin == address(0)
|| _adaptorRoles.bridgeManager == address(0) || _adaptorRoles.gasServiceManager == address(0)
|| _adaptorRoles.targetManager == address(0)
) {
revert ZeroAddresses();
}
Expand All @@ -85,10 +85,10 @@ contract RootAxelarBridgeAdaptor is

__AccessControl_init();

_grantRole(DEFAULT_ADMIN_ROLE, _roles.defaultAdmin);
_grantRole(BRIDGE_MANAGER_ROLE, _roles.bridgeManager);
_grantRole(GAS_SERVICE_MANAGER_ROLE, _roles.gasServiceManager);
_grantRole(TARGET_MANAGER_ROLE, _roles.targetManager);
_grantRole(DEFAULT_ADMIN_ROLE, _adaptorRoles.defaultAdmin);
_grantRole(BRIDGE_MANAGER_ROLE, _adaptorRoles.bridgeManager);
_grantRole(GAS_SERVICE_MANAGER_ROLE, _adaptorRoles.gasServiceManager);
_grantRole(TARGET_MANAGER_ROLE, _adaptorRoles.targetManager);

rootBridge = IRootERC20Bridge(_rootBridge);
childChainId = _childChainId;
Expand Down
Loading