Alluo Explained
  • Welcome
    • 🧭 The Basics
  • Getting Started
    • πŸ’» The DeFi Web App
      • ❓ Connecting to the app
      • 🚜 Depositing into the farms
      • πŸ™Œ Other basics
      • 🏦 Importing your Mobile app wallet to Metamask
      • 🧬 Add the polygon network manually in Metamask.
      • ⛓️ Bridging Stablecoins from another chain
    • πŸ“±The Mobile app
      • πŸ—οΈ Setting up your account
      • 🏦 Depositing money into the app
      • πŸ™Œ Other basics
      • πŸ” Exporting your private key
    • πŸ“–Tech deep dive: Contract Address Library
  • Understanding Alluo
    • πŸ’΅ How does Alluo get the yield?
      • 🐰 Going deeper into the Alluo protocol rabbit hole
    • 🧐 FAQ
  • Tokens & Tokenomics
    • πŸͺ™ The tokens
    • πŸ‘¨β€πŸ”¬Tech deep dive: Interest Bearing {asset} token
      • Depositing
      • Withdrawals
      • IbAlluo on different chains
      • StIbAlluo and Superfluid
        • A closer look at the integration between IbAlluo and StIbAlluo
      • Using the IbAlluo contract directly to create streams
      • Liquidity Handler and adapters
        • Deposit process with the Liquidity Handler
        • Withdraw process with the Liquidity Handler
    • πŸ“ˆ Tokenomics
    • πŸ‘¨β€πŸ”¬Tech deep dive: Boosting yield by compounding rewards
      • Deposit into the Vault
      • Withdraw from the Vault
      • Redeem rewards
      • Automatic boosting with Alluo
      • FraxConvex Vaults
      • Managing withdrawal requests in IERC4626
  • Decentralisation and Trust
    • πŸ—³οΈ Trustless governance and execution
    • πŸ‘¨β€πŸ”¬Tech deep dive: Vote Executor Architecture
      • Off chain votes to on chain data
      • Onchain data verifcation
      • Automated execution of votes
        • Tokenomics
        • Liquidity Direction
        • Setting APYs on farms
      • Cross chain execution of votes
      • Manually submitting vote results onchain
    • ↔️Alluo Exchange
      • Interacting with the Exchange
    • vlAlluo Architecture
    • Contracts upgrades
    • Investment strategies
      • πŸ“ˆFrax Convex Finance
        • Adding new pools into the strategy
        • Investing into a pool
  • More Advanced Features
    • πŸ” Repeat payments, streaming IbAlluo
  • Product Updates
    • πŸ‘Œ Product Roadmap: Building the right products
    • πŸ’» Web App releases
    • πŸ“± Mobile App releases
    • 🏎️ Alluo Boost
  • tutorial projects
    • Example: USDC to streaming 1 IbAlluo per second
    • Example: Using IbAlluoUSD and Ricochet to do capital efficient DCA into ETH
Powered by GitBook
On this page
  1. Decentralisation and Trust
  2. Tech deep dive: Vote Executor Architecture

Off chain votes to on chain data

Off chain vote results to on chain submission

PreviousTech deep dive: Vote Executor ArchitectureNextOnchain data verifcation

Last updated 2 years ago

Alluo carries out a votes on snapshot on a fortnightly basis. These include (as of writing) three different governance proposals. 1. Tokenomics rewards 2. Liquidity Direction (distributing treasury funds between yield opportunities) 3. Setting APY on IbAlluo farms.

This is triggered automatically by Github Actions.

Here is an example below:

There are a few key things to note:

  1. Parameters for contract: This json object is decoded and then parsed (see below how this works)

  2. Vote results : Since 5% APY has the most votes, that is what should be set on chain.

Using Github Actions to automate parsing results and submitting on chain:

Once the votes are complete, the results are parsed as the script below.

Most importantly, The commands from the paramters set inside each vote is encoded appropriately so that we can "encodeAllMessages()" and then "submitData()" correctly on chain. This is executed with a private key stored inside the automation.

executeApyProposal.ts
if (winningParams.length > 0) {
 const commandIndexes = winningParams.map((x) => Number.parseInt(x.data.cmdIndex));
 const commands = winningParams.map((x) => x.data.cmd);

 const mainnetProvider = new ethers.providers.JsonRpcProvider(process.env.NODE_URL as string);
 let signer = Wallet.fromMnemonic(process.env.MNEMONIC as string);
 signer = new Wallet(signer.privateKey, mainnetProvider);

 const veMasterInterface = await ethers.getContractAt("IVoteExecutorMaster", voteExecutorMasterAddressMainnet);
 const veMaster = new Contract(voteExecutorMasterAddressMainnet, veMasterInterface.interface, signer);

 console.log("Tx sender address:", signer.address)
 const cmdEncoded = await veMaster.callStatic.encodeAllMessages(commandIndexes, commands);

 console.log("Message hash:", cmdEncoded.messagesHash);
 console.log("Trying to broadcast tx...");
 const tx = await veMaster.submitData(cmdEncoded.inputData);

 console.log("Tx is broadcasted on chainId", (await ethers.provider.getNetwork()).chainId, "txHash:", tx.hash);
 console.log("Waiting for tx confirmation...");

 await tx.wait();
 console.log("Tx is confirmed");
}
πŸ‘¨β€πŸ”¬
DAO-automation/createProposals.ts at main Β· GetAlluo/DAO-automationGitHub
Explore the creation script here
DAO-automation/executeApyProposal.ts at main Β· GetAlluo/DAO-automationGitHub
The results are parsed
Logo
Logo
Example of a snapshot vote