From 52cbc665a4654f977bd9066a3edc9df3419aefdb Mon Sep 17 00:00:00 2001 From: Zoomer <87513793+ethzoomer@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:47:39 -0500 Subject: [PATCH] Add last used voting amount for Relay (#31) * feat: add last used voting amount to Relay * feat: point readme to latest RelaySugar release * Point readme to latest RelaySugar release --- contracts/RelaySugar.vy | 2 ++ readme.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/RelaySugar.vy b/contracts/RelaySugar.vy index 294679f..2286c01 100644 --- a/contracts/RelaySugar.vy +++ b/contracts/RelaySugar.vy @@ -19,6 +19,7 @@ struct Relay: decimals: uint8 amount: uint128 voting_amount: uint256 + used_voting_amount: uint256 voted_at: uint256 votes: DynArray[LpVotes, MAX_PAIRS] token: address @@ -195,6 +196,7 @@ def _byAddress(_relay: address, _account: address) -> Relay: decimals: self.ve.decimals(), amount: amount, voting_amount: self.ve.balanceOfNFT(managed_id), + used_voting_amount: vote_weight, voted_at: last_voted, votes: votes, token: relay.token(), diff --git a/readme.md b/readme.md index 4aaedce..3e56736 100644 --- a/readme.md +++ b/readme.md @@ -169,7 +169,7 @@ The available methods are: ### Relay Data -`RelaySugar.vy` is deployed at `0xeBf8F5818D429785A584693599b695AFc3BeE3c6` +`RelaySugar.vy` is deployed at `0xeEc6dD356508d3f30503bd15317b6D7671410e8e` It allows fetching Relay autocompounder/autoconverter data. The returned data/struct of type `Relay` values represent: @@ -178,6 +178,7 @@ The returned data/struct of type `Relay` values represent: * `decimals` - Relay veNFT token decimals * `amount` - Relay veNFT locked amount * `voting_amount` - Relay veNFT voting power + * `used_voting_amount` - Relay veNFT voting power used for last vote * `voted_at` - Relay veNFT last vote timestamp * `votes` - Relay veNFT list of pools with vote weights casted in the form of `LpVotes`