Skip to content
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: remove asset holder allowlist (with latest main) #855

Closed
wants to merge 13 commits into from

Conversation

pcarranzav
Copy link
Member

No description provided.

pcarranzav and others added 9 commits November 23, 2022 21:37
BREAKING CHANGE: Staking.setAssetHolder is removed and the assetHolders mapping is deprecated.
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
- Add a comment about the risk of tx being confirmed late causing tokens to be burnt (TRST-L-1)
- Return early to avoid emitting an event if query fees are zero
- Remove comment about only valid senders being able to call collect().

BREAKING CHANGE: collect() does not emit AllocationCollected if query fees are zero
fix: improvements from Trust audit (TRST-L-1 and recommendations)
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02% ⚠️

Comparison is base (1e593cf) 92.60% compared to head (abe55a1) 92.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #855      +/-   ##
==========================================
- Coverage   92.60%   92.59%   -0.02%     
==========================================
  Files          47       47              
  Lines        2368     2362       -6     
  Branches      432      430       -2     
==========================================
- Hits         2193     2187       -6     
  Misses        175      175              
Flag Coverage Δ
unittests 92.59% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
contracts/staking/StakingExtension.sol 98.69% <ø> (-0.02%) ⬇️
contracts/staking/Staking.sol 98.11% <100.00%> (-0.03%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pcarranzav pcarranzav changed the title feat: remove asset holder allowlist (with latest dev) feat: remove asset holder allowlist (with latest main) Oct 10, 2023
* @dev Emitted when `caller` set `assetHolder` address as `allowed` to send funds
* to staking contract.
*/
event AssetHolderUpdate(address indexed caller, address indexed assetHolder, bool allowed);
Copy link
Contributor

Choose a reason for hiding this comment

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

(GitHub won't let me comment on the correct LOC as you did not modify it but...)

The event RebateCollected uses assetHolder name for the query fees provider. We probably want to change that name for clarity, something like rebateProvider or provider, sender, wdyt?

// Allocation must exist
AllocationState allocState = _getAllocationState(_allocationID);
require(allocState != AllocationState.Null, "!collect");

// If the query fees are zero, we don't want to revert
// but we also don't need to do anything, so just return
Copy link
Contributor

@tmigone tmigone Oct 20, 2023

Choose a reason for hiding this comment

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

This slightly changes the behavior of the function as we now are not emitting the RebatesCollected event when _tokens == 0. I can't think why this could be a problem, but wanted to make sure we consider it.

Copy link
Contributor

@tmigone tmigone left a comment

Choose a reason for hiding this comment

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

LGTM, left some comments

@pcarranzav
Copy link
Member Author

Replaced by #864

@pcarranzav pcarranzav closed this Nov 24, 2023
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.

2 participants