Onyx Protocol
  • πŸ“–Onyx Documentation
  • β˜•Getting Started
    • πŸ”¬Networks
    • πŸ“’Protocol Math
      • oToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • πŸ’ΉGas Costs
  • πŸ§‘β€πŸ’»OTokens
    • 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
    • XCN Distribution Speeds
    • Claim XCN
    • Market Metadata
  • πŸ‘¨β€πŸ‘©β€πŸ‘¦Governance
    • 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
    • Basic API
      • GET: /otoken
      • GET: /market_history/graph
      • GET: /user/history
      • GET: /get_liquidators
      • GET: /get_liquidator:account
      • GET: /get_liquidator_detail:account
      • GET: /liquidator
    • GraphQL API
      • oTokens Subgraph
      • History Subgraph
      • Governance Subgraph
    • Governance API
      • GET: /proposal
      • GET: /proposal/:proposalId
      • GET: /voter/:proposalId
      • GET: /voter/accounts
      • GET: /voter/history/:address
    • Shared Data Types
  • πŸ“–Onyx.js
    • Onyx Constructor
    • API Methods
      • Account
      • oToken
      • Market History
      • Governance
    • oToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • XCN Methods
      • To Checksum Address
      • Get XCN Balance
      • Get XCN Accrued
      • Claim XCN
      • 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
  • πŸ”’Security
    • Bug Bounty Program
  • πŸ“„Terms of Service
Powered by GitBook
On this page
  1. Governance

Get Receipt

Gets a proposal ballot receipt of the indicated voter.

Governor Alpha

function getReceipt(uint proposalId, address voter) returns (Receipt memory)
  • proposalId: ID of the proposal in which to get a voter’s ballot receipt.

  • voter: Address of the account of a proposal voter.

  • RETURN: Reverts on error. If successful, returns a Receipt struct for the ballot of the voter address.

Solidity

GovernorAlpha gov = GovernorAlpha(0x123...); // contract address
Receipt ballot = gov.getReceipt(proposalId, voterAddress);

Web3 1.2.6

const proposalId = 11;
const voterAddress = '0x123...';
const result = await gov.methods.getReceipt(proposalId, voterAddress).call();
const { hasVoted, support, votes } = result;
PreviousGet ActionsNextState

Last updated 2 years ago

πŸ‘¨β€πŸ‘©β€πŸ‘¦