Curve Cross-Chain Governance
System Overview¶
GitHub
All source code can be found in the curve x-gov
repository on GitHub.
A comprehensive list of all deployed contracts is available here .
The Curve X-DAO infrastructure facilitates cross-chain governance across multiple blockchain networks. This architecture allows the DAO to conduct and implement governance activities not only on Ethereum but also on other networks such as Arbitrum
, Optimism
, Base
, Mantle
, Avalanche
, Fantom
, BinanceSmartChain
, Kava
, and Polygon
.
Governance voting is exclusively conducted on the Ethereum mainnet. Following a successful vote, the results are transmitted to the L2 network through a L1-Broadcaster
. Subsequently, the intended actions are executed by Agents
on the respective L2 networks by a L2-Relayer
.
flowchart LR
l1-b[(L1-Broadcaster)] --> |"broadcast"| l2-r[(L2-Relayer)]
l2-r --- |relay| o([Ownership Agent])
l2-r --- |relay| p([Parameter Agent])
l2-r --- |relay| e([Emergency Agent])
o --> |"execute"| vault[(L2 Contract)]
p --> |"execute"| vault
e --> |"execute"| vault
Smart Contracts¶
The cross-chain governance system utilizes the following four main contracts:
-
The
Broadcaster.vy
contract is responsible for broadcasting the results of governance votes from the Ethereum mainnet to various sidechains. -
The
Relayer.vy
contract facilitates the relay of voting outcomes to Layer 2 networks, ensuring the execution of governance decisions. -
On each sidechain and Layer 2 network, the
Agent.vy
contract assumes three distinct roles: ownership, parameter, and emergency, mirroring the structure found on the Ethereum mainnet for controlled actions. -
The
Vault.vy
contract serves as a repository for various assets, with its control vested in the ownership agent.
Example: Claiming $OP Airdrop on L2¶
Let's explore an example. Shortly after its launch, Optimism chose to airdrop $OP tokens to projects that were built on their blockchain. Curve Finance was allocated approximately 500,000 $OP tokens. This airdrop took place on the Optimism chain.
Due to Curve's voting mechanism being hosted on the Ethereum Mainnet, a proposal to claim the 500,000+ tokens was made.
The proposal initiated a call to the broadcast
function of the Optimism Broadcaster
as follows:
Call via agent (0x40907540d8a6C65c637785e8f8B742ae6b0b9968):
├─ To: 0x8e1e5001C7B8920196c7E3EdF2BCf47B2B6153ff
├─ Function: broadcast
└─ Inputs: [('(address,bytes)[]', '_messages', (('0x4200000000000000000000000000000000000042', '23b872dd00000000000000000000000019793c7824be70ec58bb673ca42d2779d12581be000000000000000000000000d166eedf272b860e991d331b71041799379185d5000000000000000000000000000000000000000000006ae6c7dd0a9fb2700000'),))]
Decoding the calldata results in the following:
function: transferFrom
from: 0x19793c7824Be70ec58BB673CA42D2779d12581BE
to: 0xD166EEdf272B860E991d331B71041799379185D5
amount: 504828000000000000000000
Conclusion: Once the vote on the Ethereum Mainnet was successfully passed and executed, the Broadcaster
contract relayed the message through a messenger contract to the Relayer
on L2. Subsequently, the OwnershipAgent
executed the specified calldata, resulting in the transfer of 504,828 $OP tokens from 0x19793c7824Be70ec58BB673CA42D2779d12581BE
to 0xD166EEdf272B860E991d331B71041799379185D5
.1
-
Before executing the transferFrom function, the Curve Vault contract had to be approved to transfer the tokens. Without sufficient allowance, the transaction would have failed. ↩