Skip to content

Add ability to pre-populate rewards claimed for users in CometRewards#703

Merged
kevincheng96 merged 1 commit intokevin/scaled-rewardsfrom
kevin/seed-rewards-state
Mar 7, 2023
Merged

Add ability to pre-populate rewards claimed for users in CometRewards#703
kevincheng96 merged 1 commit intokevin/scaled-rewardsfrom
kevin/seed-rewards-state

Conversation

@kevincheng96
Copy link
Copy Markdown
Contributor

This PR introduces a setRewardsClaimed function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet.

We would have to compute off-chain the amount that each user would be able to claim at a specific block number x and write it on-chain via the setRewardsClaimed function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number x.

@kevincheng96 kevincheng96 changed the title Add ability pre-populate rewards claimed for users in CometRewards Add ability to pre-populate rewards claimed for users in CometRewards Mar 1, 2023
Copy link
Copy Markdown
Contributor

@jflatow jflatow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 🧼 I don't know if it matters but we could also require the existing value to be zero, I suppose

@kevincheng96
Copy link
Copy Markdown
Contributor Author

kevincheng96 commented Mar 2, 2023

Very nice 🧼 I don't know if it matters but we could also require the existing value to be zero, I suppose

Yeah we could. Though the tradeoff is we would be able to set less accounts per txn because of the higher gas cost for reading. The check also wouldn't protect against malicious governors since they could just withdraw the rewards. I could add it if we want the extra on-chain sanity check to make sure we aren't accidentally overwriting an existing field.

@jflatow
Copy link
Copy Markdown
Contributor

jflatow commented Mar 2, 2023

Very nice 🧼 I don't know if it matters but we could also require the existing value to be zero, I suppose

Yeah we could. Though the tradeoff is we would be able to set less accounts per txn because of the higher gas cost for reading. The check also wouldn't protect against malicious governors since they could just withdraw the rewards. I could add it if we want the extra on-chain sanity check to make sure we aren't accidentally overwriting an existing field.

Right, I think its only a sanity check for the governor, just thought worth mentioning/discussing

Copy link
Copy Markdown
Contributor

@scott-silver scott-silver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@kevincheng96 kevincheng96 merged commit b90c37b into kevin/scaled-rewards Mar 7, 2023
@kevincheng96 kevincheng96 deleted the kevin/seed-rewards-state branch March 7, 2023 19:40
kevincheng96 added a commit that referenced this pull request Mar 10, 2023
This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.
kevincheng96 added a commit that referenced this pull request Mar 13, 2023
This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.
jflatow pushed a commit that referenced this pull request Mar 20, 2023
This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.
jflatow pushed a commit that referenced this pull request Mar 20, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
Raz0r pushed a commit to Decurity/comet that referenced this pull request Mar 21, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (compound-finance#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
scott-silver pushed a commit that referenced this pull request Mar 21, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
Raz0r pushed a commit to Decurity/comet that referenced this pull request Apr 6, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (compound-finance#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
scott-silver pushed a commit that referenced this pull request Apr 11, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
scott-silver pushed a commit that referenced this pull request May 4, 2023
* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users
kevincheng96 added a commit that referenced this pull request May 15, 2023
* Arbitrum deployment

* Arbitrum mainnet (#717)

* update github actions

* add configuration file

* deploy script

* add inbox to roots

* update hardhat config

* update etherscan.ts

* template string in Spider trace fn

* Arbitrum whale

* MAINNET_TIMELOCK instead of mainnetTimelock.address

* add inbox to mainnet/usdc relations

* missing whale error

* add LINK, LINK whale

add Arbitrum SDK; bump hardhat-etherscan version; ARBISCAN_KEY; add l1GatewayRouter to roots; update getCompWhales

* CometRewards with multiplier (#702)

* Initial implementation of CometRewards with multiplier

* Simply implementation a bit

* Refactor slightly for more readability

* Update unit tests

* Implement setRewardsClaimed (#703)

This PR introduces a `setRewardsClaimed` function that gives the admin the ability to set rewards claimed for any user. This gives us the ability to initialize a new reward distribution that doesn't necessarily have to retroactively reward all past usage of Comet. 

We would have to compute off-chain the amount that each user would be able to claim at a specific block number `x` and write it on-chain via the `setRewardsClaimed` function. This allows us to essentially set the start time of the rewards accrual to be after that specific block number `x`.

* Add scenarios for testing reward multipliers

* Re-implement multiplier logic by storing multiplier in RewardConfig

* Add a unit test to sanity check zeroing out retroactive rewards for users

* restore hardhat-etherscan version; createCrossChainProposal; Goerli l1GatewayRouter

* update ArbitrumBridgeScenario

* refactor, rename in relayArbitrumMessage

* Pin Solidity version (#731)

* replace LINK with ARB

* pull in ARB in deploy.ts

* replace nock with undici in VerifyTest

* specify shanghai hardfork

* Emit event when setting rewards claimed (#736)

* Update aliases to include arbitrum prefix

* updates from #719 to enable proposals

* Fix spidering when using explicit address in relations config; use addresses to indicate ERC20 proxies in relations

* Adjust timelock delay on testnet

* Move arbitrum cross-chain scenario into cross-chain governance scenarios file

* Add pauseGuardian for arbitrum goerli

* Add custom chain for arbitrum goerli to verify on etherscan

* Add api key for arbitrum goerli

* Modified deployment roots from GitHub Actions

* add Arbitrum pauseGuardian address to config

* SweepableBridgeReceiver, tests (#733)

* Add custom chain in hardhat etherscan config for arbitrum

* Modified deployment roots from GitHub Actions

* Arbitrum proposals (#719)

* Arbitrum proposals

* update Arbitrum aliases in proposals

* update asset supply caps

* spider in verify()

* add prices to BulkerScenario

* restore original asset variables; update supply cap expectations; enable diffState test for Arbitrum-Goerli

* Add arb to enact-migration.yaml

* Modified migration from GitHub Actions

* Finalize arb gas estimation

* update proposal description

* update diffState test

* add action to set v2 COMP speeds for USDT to 0; update Arbitrum baseSupplySpeed

* Skip calling verify on migrations that are already enacted

* Update COMP amount to bridge and hardcoded gas price; modify proposal text to be more specific about shifting COMP distributions from USDT v2 to Arbitrum

* Change skip to skipVerify

* Add COMP whale for arbitrum-goerli

* Modified migration from GitHub Actions

---------

Co-authored-by: kevincheng96 <kevincheng96@hotmail.com>
Co-authored-by: GitHub Actions Bot <>

* Small fixes for Arbitrum scenarios

---------

Co-authored-by: Kevin Cheng <kevincheng96@hotmail.com>
Co-authored-by: GitHub Actions Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants