From 932ca741faf61498f63c1b212aa3bded994e5e94 Mon Sep 17 00:00:00 2001 From: Dmitryii Osipov Date: Fri, 6 Dec 2024 11:58:53 +0100 Subject: [PATCH] feat(ethexe): pass mirror address to decoder's initialise args (#4378) --- ethexe/contracts/src/IMirrorDecoder.sol | 2 +- ethexe/contracts/src/Router.sol | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethexe/contracts/src/IMirrorDecoder.sol b/ethexe/contracts/src/IMirrorDecoder.sol index 193261942ce..3675fa5c08e 100644 --- a/ethexe/contracts/src/IMirrorDecoder.sol +++ b/ethexe/contracts/src/IMirrorDecoder.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.26; interface IMirrorDecoder { - function initialize() external; + function initialize(address mirror) external; function mirror() external view returns (address); diff --git a/ethexe/contracts/src/Router.sol b/ethexe/contracts/src/Router.sol index 07f21d243df..9c3830f8248 100644 --- a/ethexe/contracts/src/Router.sol +++ b/ethexe/contracts/src/Router.sol @@ -199,7 +199,7 @@ contract Router is IRouter, OwnableUpgradeable, ReentrancyGuardTransient { returns (address) { address mirror = _createProgram(_codeId, _salt); - address decoder = _createDecoder(_decoderImpl, keccak256(abi.encodePacked(_codeId, _salt))); + address decoder = _createDecoder(_decoderImpl, keccak256(abi.encodePacked(_codeId, _salt)), mirror); IMirror(mirror).initialize(msg.sender, decoder); @@ -283,10 +283,10 @@ contract Router is IRouter, OwnableUpgradeable, ReentrancyGuardTransient { return actorId; } - function _createDecoder(address _implementation, bytes32 _salt) private returns (address) { + function _createDecoder(address _implementation, bytes32 _salt, address _mirror) private returns (address) { address decoder = Clones.cloneDeterministic(_implementation, _salt); - IMirrorDecoder(decoder).initialize(); + IMirrorDecoder(decoder).initialize(_mirror); return decoder; }