Skip to content

Commit

Permalink
feat(ethexe): pass mirror address to decoder's initialise args (#4378)
Browse files Browse the repository at this point in the history
  • Loading branch information
osipov-mit authored Dec 6, 2024
1 parent 3bdeb8f commit 932ca74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ethexe/contracts/src/IMirrorDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions ethexe/contracts/src/Router.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 932ca74

Please sign in to comment.