-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add modius configs #567
Conversation
@@ -19,6 +19,7 @@ const safeChainPrefix = { | |||
[EvmChainId.Base]: 'base', | |||
[EvmChainId.Optimism]: 'oeth', | |||
[EvmChainId.Gnosis]: 'gno', | |||
[EvmChainId.Mode]: 'mode', // TODO: Modius - the above link doesn't have Mode, so the prefix is a guess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bit of a worry that safe.global doesn't support mode..
const multicallResponse = await multicallProvider.all(contractCalls); | ||
const [rewardsPerSecond, livenessPeriod, tsCheckpoint] = multicallResponse; | ||
const nowInSeconds = Math.floor(Date.now() / 1000); | ||
|
||
return Math.max( | ||
rewardsPerSecond * livenessPeriod, // expected rewards | ||
rewardsPerSecond * (nowInSeconds - tsCheckpoint), // incase of late checkpoint | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems repetitive now (also few other logics). How about creating a reusable function within the StakedAgentService
class that takes arguments and performs the calculation for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update or not based on our discussion on slack
// Rewards per work period | ||
const rewardsPerWorkPeriod = | ||
Number(formatEther(rewardsPerSecond as bigint)) * | ||
livenessPeriod.toNumber(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
Co-authored-by: Mohan <[email protected]>
Proposed changes
Add configs for modius.
Sources used for finding addresses:
https://govern.olas.network/contracts/0x000000000000000000000000534c0a05b6d4d28d5f3630d6d74857b253cf8332
https://github.com/valory-xyz/autonolas-registries/blob/main/docs/configuration.json#L380
https://github.com/valory-xyz/autonolas-governance/blob/main/docs/olas_bridging.md
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that apply