Skip to content

Commit

Permalink
Add last used voting amount for Relay (#31)
Browse files Browse the repository at this point in the history
* feat: add last used voting amount to Relay

* feat: point readme to latest RelaySugar release

* Point readme to latest RelaySugar release
  • Loading branch information
ethzoomer authored Oct 31, 2023
1 parent 46467b9 commit 52cbc66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions contracts/RelaySugar.vy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`
Expand Down

0 comments on commit 52cbc66

Please sign in to comment.