Skip to content

Commit

Permalink
feat(ethexe/contracts): improve interaction with MirrorProxy via ethe…
Browse files Browse the repository at this point in the history
…rscan
  • Loading branch information
StackOverflowExcept1on committed Dec 19, 2024
1 parent 0fed2b6 commit 0f62019
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ethexe/cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl ExtraCommands {

println!("Completed in transaction {tx:?}");
println!(
"Program address on Ethereum {}",
"Program address on Ethereum {:?}",
actor_id.to_address_lossy()
);

Expand Down
43 changes: 43 additions & 0 deletions ethexe/contracts/src/MirrorProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,55 @@ import {IRouter} from "./IRouter.sol";
*/

contract MirrorProxy is IMirrorProxy, Proxy {
event StateChanged(bytes32 stateHash);
event MessageQueueingRequested(bytes32 id, address indexed source, bytes payload, uint128 value);
event ReplyQueueingRequested(bytes32 repliedTo, address indexed source, bytes payload, uint128 value);
event ValueClaimingRequested(bytes32 claimedId, address indexed source);
event ExecutableBalanceTopUpRequested(uint128 value);
event Message(bytes32 id, address indexed destination, bytes payload, uint128 value);
event Reply(bytes payload, uint128 value, bytes32 replyTo, bytes4 indexed replyCode);
event ValueClaimed(bytes32 claimedId, uint128 value);

address public immutable router;

address public decoder;
address public inheritor;
address public initializer;
bytes32 public stateHash;
uint256 public nonce;

constructor(address _router) {
router = _router;
}

/* Primary Gear logic */

function sendMessage(bytes calldata payload, uint128 value) external returns (bytes32) {
_delegate();
}

function sendReply(bytes32 repliedTo, bytes calldata payload, uint128 value) external {
_delegate();
}

function claimValue(bytes32 claimedId) external {
_delegate();
}

function executableBalanceTopUp(uint128 value) external {
_delegate();
}

function transferLockedValueToInheritor() external {
_delegate();
}

/* MirrorProxy implementation */

function _delegate() internal {
_delegate(_implementation());
}

function _implementation() internal view virtual override returns (address) {
return IRouter(router).mirrorImpl();
}
Expand Down
2 changes: 1 addition & 1 deletion ethexe/ethereum/Mirror.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ethexe/ethereum/MirrorProxy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ethexe/ethereum/Router.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ethexe/ethereum/TransparentUpgradeableProxy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ethexe/ethereum/WrappedVara.json

Large diffs are not rendered by default.

0 comments on commit 0f62019

Please sign in to comment.