Strike Docs
  • 📖Strike Documentation
  • ⭐Getting Started
    • 🧑‍🏫Guides
    • 🔬Networks
    • 📒Protocol Math
      • sToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • 💹Gas Costs
  • 🎙️STokens
    • Mint
    • Redeem
    • Redeem Underlying
    • Borrow
    • Repay Borrow
    • Repay Borrow Behalf
    • Transfer
    • Liquidate Borrow
    • Key Events
    • Error Codes
    • Failure Info
    • Exchange Rate
    • Get Cash
    • Total Borrow
    • Borrow Balance
    • Borrow Rate
    • Total Supply
    • Underlying Balance
    • Supply Rate
    • Total Reserves
    • Reserve Factor
  • ⚙️Comptroller
    • Enter Markets
    • Exit Market
    • Get Assets In
    • Collateral Factor
    • Get Account Liquidity
    • Close Factor
    • Liquidation Incentive
    • Key Events
    • Error Codes
    • Failure Info
    • STRK Distribution Speeds
    • Claim STRK
    • Market Metadata
  • 👨‍👩‍👦Governance
    • Delegate
    • Delegate By Signature
    • Get Current Votes
    • Get Prior Votes
    • Key Events
    • Governor Alpha
    • Quorum Votes
    • Proposal Threshold
    • Proposal Max Operations
    • Voting Delay
    • Voting Period
    • Propose
    • Queue
    • Execute
    • Cancel
    • Get Actions
    • Get Receipt
    • State
    • Cast Vote
    • Cast Vote By Signature
    • Timelock
    • Pause Guardian
  • 🔡API
    • STokenService
      • GET: /stoken
    • MarketHistoryService
      • GET: /market_history/graph
    • ProposalService
      • GET: /proposals
      • GET: /proposals/:id
      • GET: /proposals/statistics
    • VoterService
      • GET: /voters/accounts
      • GET: /voters/accounts/:address
      • GET: /voters/history/:address
      • GET: /voters/:proposalId
    • GovernanceService
      • GET: /governance/strike
      • GET: /governance/proposals
      • GET: /governance/proposal_vote_receipts
      • GET: /governance/accounts
    • UserHistoryService
      • GET: /user/history
    • LiquidationService
      • GET: /get_liquidators
      • GET: /get_liquidator:account
      • GET: /get_liquidator_detail:account
      • GET: /liquidator
    • Shared Data Types
  • ⌛Strike.js
    • Strike Constructor
    • API Methods
      • Account
      • sToken
      • Market History
      • Governance
    • sToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • STRK Methods
      • To Checksum Address
      • Get Strk Balance
      • Get Strk Accrued
      • Claim Strk
      • Delegate
      • Delegate By Sig
      • Create Delegate Signature
    • Comptroller Methods
      • Enter Markets
      • Exit Market
    • Ethereum Methods
      • Read
      • Trx
      • Get Balance
    • Governance Methods
      • Cast Vote
      • Cast Vote By Sig
      • Create Vote Signature
    • Price Feed Methods
      • Get Price
    • Utility Methods
      • Get Address
      • Get ABI
      • Get Network Name With Chain ID
  • 🤑DeFi 3.0 Vault
  • 🍍Revenue Share Staking
  • 🔒Security
    • Formal Verification
    • Bug Bounty Program
    • Immunefi
Powered by GitBook
On this page

Was this helpful?

  1. Strike.js
  2. Governance Methods

Cast Vote By Sig

Submit a vote on a Strike Governance proposal using an EIP-712 signature.

  • proposalId (string) The ID of the proposal to vote on. This is an auto-incrementing integer in the Governor Alpha contract.

  • support (boolean) A boolean of true for 'yes' or false for 'no' on the proposal vote.

  • signature (object) An object that contains the v, r, and, s values of an EIP-712 signature.

  • [options] (CallOptions) Options to set for a transaction and Ethers.js method overrides.

  • RETURN (object) Returns an Ethers.js transaction object of the vote transaction.

const strike = new Strike(window.ethereum);

(async function() {
  const castVoteTx = await strike.castVoteBySig(
    12,
    true,
    {
      v: '0x1b',
      r: '0x130dbcd2faca07424c033b4479687cc1deeb65f08509e3ab397988cc4c6f2e78',
      s: '0x1debcb8250262f23906b1177161f0c7c9aa3641e6bff5b6f5c88a6bb78d5d8cd'
    }
  );
  console.log('Ethers.js transaction object', castVoteTx);
})().catch(console.error);
PreviousCast VoteNextCreate Vote Signature

Last updated 4 years ago

Was this helpful?

⌛