Skip to content

Conversation

@gfournierPro
Copy link
Contributor

Test on anvil sepolia fork after a re-deployment
ex : old admin 0xf91Cc8E418A71b1598082EB3D20F4d5DaDeEaa74 new admin 0x70997970C51812dc3A010C7d01b50e0d17dc79C8

  Starting admin role transfer on chain: sepolia
  New admin address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
  Transferring admin role for RLCLiquidityUnifier at: 0xf91Cc8E418A71b1598082EB3D20F4d5DaDeEaa74
  Current admin: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
  Caller (tx.origin): 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38
  Admin transfer initiated for RLCLiquidityUnifier
  New admin must call acceptDefaultAdminTransfer() to complete the transfer
  Transferring admin role for IexecLayerZeroBridge at: 0xEBA597c517581882be0f7a3B21CCde3Fed6CE1bD
  Current admin: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
  Caller (tx.origin): 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38
  Admin transfer initiated for IexecLayerZeroBridge
  New admin must call acceptDefaultAdminTransfer() to complete the transfer
  Admin role transfer completed successfully on chain: sepolia

than :

  == Logs ==
  Accepting admin role transfer on chain: sepolia
  Accepting admin role for RLCLiquidityUnifier at: 0xf91Cc8E418A71b1598082EB3D20F4d5DaDeEaa74
  Admin role accepted for RLCLiquidityUnifier
  New admin: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
  Accepting admin role for IexecLayerZeroBridge at: 0xEBA597c517581882be0f7a3B21CCde3Fed6CE1bD
  Admin role accepted for IexecLayerZeroBridge
  New admin: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
  Admin role transfer acceptance completed successfully on chain: sepolia

@gfournierPro gfournierPro requested review from Le-Caignec, Copilot and zguesmi and removed request for Copilot August 4, 2025 13:20
@gfournierPro gfournierPro self-assigned this Aug 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive admin role transfer functionality for multi-chain smart contract management. It implements a two-phase admin transfer process with initiation and acceptance steps for secure role transitions.

  • Adds TransferAdminRole.s.sol script with contracts for initiating and accepting admin role transfers
  • Updates Makefile with commands for single-chain admin role operations
  • Introduces GitHub Actions workflow for automated admin role transfers via UI

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
script/TransferAdminRole.s.sol Core script implementing two-phase admin transfer for RLCLiquidityUnifier, RLCCrosschainToken, and IexecLayerZeroBridge contracts
Makefile Adds make targets for transferring and accepting admin roles on single chains
.github/workflows/transfer-admin.yml GitHub Actions workflow for triggering admin transfers through web interface

@gfournierPro gfournierPro marked this pull request as draft August 4, 2025 13:22
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@459e2ed). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #90   +/-   ##
=======================================
  Coverage        ?   83.78%           
=======================================
  Files           ?        4           
  Lines           ?      111           
  Branches        ?        7           
=======================================
  Hits            ?       93           
  Misses          ?       17           
  Partials        ?        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gfournierPro gfournierPro marked this pull request as ready for review August 7, 2025 12:48
Comment on lines +11 to +14
- ethereum
- arbitrum
- sepolia
- arbitrum_sepolia
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use mainnets & testnets here

required: true
type: string

jobs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use matrix here to made that on multiple network as it was made for configuration script

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we can transmit the ownership to the same wallet (multi-sig) address other all networks ? @zguesmi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's better to do each chain separately to avoid issues. For example if we use a multisig that is not available on a specific network.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be nice to move run() function as the first function of each contracts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zguesmi
Copy link
Member

zguesmi commented Aug 7, 2025

We need to test these scripts, for example, to make sure that we always transfer ownership of all relevant contracts at once.

@zguesmi
Copy link
Member

zguesmi commented Aug 11, 2025

What do you think of this?
feat: Remove intermediate external call function & clean

function run() external pure override(BeginTransferAdminRole, AcceptAdminRole) {
// This function should not be called directly in tests
// Use super.run_beginTransfer() or super.run_acceptAdmin() instead
// Use super.beginTransferForAllContracts() or super.run_acceptAdmin() instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Use super.beginTransferForAllContracts() or super.run_acceptAdmin() instead
// Use super.beginTransferForAllContracts() or super.acceptAdminRoleTransfer() instead

fee = layerZeroContract.quoteSend(sendParam, false);
}

function emptyConfigParams() internal pure returns (ConfigLib.CommonConfigParams memory) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed, declaring ConfigLib.CommonConfigParams memory params; is enough to create a default empty object.

Comment on lines 240 to 247
* @notice External wrapper for beginTransfer to enable proper revert testing
* @dev This function is necessary for testing revert scenarios because:
* When testing internal functions that call `super`,
* Foundry's vm.expectRevert doesn't properly catch reverts from internal function calls.
* This is because internal calls don't create new call frames that Foundry can intercept.
*
* This pattern allows vm.expectRevert to work correctly by ensuring the revert happens
* in a separate call frame that Foundry can detect and validate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning the function beginTransfer public allows to make external calls.

@gfournierPro gfournierPro merged commit 597ef5b into main Aug 12, 2025
4 checks passed
@gfournierPro gfournierPro deleted the feature/transfer-admin-script branch August 12, 2025 07:01
This was referenced Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants