Crosschain governance project utilizing Safe, Axelar and LxLy bridge to make safes talk to each other for governance
This project is a crosschain governance system that leverages the power of Axelar and LxLy bridge. It includes several smart contracts that interact with each other to facilitate crosschain transactions. The system allows for the execution of transactions not only from an Externally Owned Account (EOA), but also from any multisig. This means an Ethereum multisig can message any other chain to execute a change, as demonstrated in the provided polygonscan links. The project also integrates with the Axelar gateway contracts and the Proposer Execution Module for enhanced functionality.
zkEVM Proposer Module: https://zkevm.polygonscan.com/address/0x1EaF18086C07D4d6a59B94277F80204274Ccc54d
this is the createExecution test from an EOA: https://polygonscan.com/tx/0xae9e6b334cfe1d6ac4bb6d648f604527bd728a9e431ab61cd937879fc8dcd44e#eventlog
This is it being executed (verifying that safe module works): https://polygonscan.com/tx/0xd3eaa7e48a31ef7aba2d67c557d2ecceb5ce94040a8189c7b3d3fb8bd84ec0f
Axelar execution:
https://axelarscan.io/gmp/0xdfd625647f4985429e69cb860cb15068396dcc7cf7d3058c1fe3931187c74da3
Proposer Execution Module: https://polygonscan.com/address/0x02668453F6138bE9BBA9946de8472228c4400109#writeContract
Axelar Execution Proposer: https://polygonscan.com/address/0xD2BeD6f2b32832ddA397C9FcA6d1E503d627C49d#writeContract
The main component of the project is the LxLyProposer contract, which is responsible for proposing transactions. It implements the IBridgeMessageReceiver interface, which means it can receive messages from other networks. This contract is also Ownable, meaning it has an owner who has special privileges.
The LxLyProposer contract interacts with the ExecutionModule contract, which allows an external contract to request the execution of a transaction. This interaction is facilitated by the createExecution function, which is called within the onMessageReceived function of the LxLyProposer contract.
The LxLyProposer contract also interacts with the IPolygonZkEVMBridge contract, which is used to verify merkle proofs and withdraw tokens/ether. The polygonZkEVMBridge is an immutable public variable, meaning it can't be changed after it's set in the constructor.
The project also integrates with the Axelar gateway contracts and the Proposer Execution Module for enhanced functionality. Axelar provides a decentralized network that connects all blockchains, allowing them to communicate and interoperate. This greatly benefits the project by enabling crosschain transactions.
The project allows for the execution of transactions not only from an Externally Owned Account (EOA), but also from any multisig. This means an Ethereum multisig can message any other chain to execute a change, as demonstrated in the provided polygonscan links.
One notable hacky thing we did was to use the abi.decode function to extract the necessary data from the received message. This is a low-level function that can be used to decode data of any type, and it's very powerful but also potentially dangerous if not used correctly. We used it here because it provides the flexibility we need to handle different types of data.