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

fix(contracts): RateLimit minor changes #4575

Merged
merged 3 commits into from
Oct 22, 2024
Merged

Conversation

aroralanuk
Copy link
Contributor

Description

  • Added a check for invalid capacity and event for token level change

Drive-by changes

None

Related issues

Backward compatibility

Yes

Testing

Unit tests

Copy link

changeset-bot bot commented Sep 26, 2024

⚠️ No Changeset found

Latest commit: a6a23a6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 73.85%. Comparing base (9f5a17b) to head (a6a23a6).
Report is 83 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (9f5a17b) and HEAD (a6a23a6). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (9f5a17b) HEAD (a6a23a6)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4575      +/-   ##
==========================================
- Coverage   82.33%   73.85%   -8.48%     
==========================================
  Files         100      100              
  Lines        1421     1423       +2     
  Branches      180      181       +1     
==========================================
- Hits         1170     1051     -119     
- Misses        251      351     +100     
- Partials        0       21      +21     
Components Coverage Δ
core 84.61% <ø> (-12.31%) ⬇️
hooks 75.71% <ø> (-10.96%) ⬇️
isms 79.20% <ø> (-14.61%) ⬇️
token 88.23% <ø> (-5.23%) ⬇️
middlewares 77.39% <ø> (-9.14%) ⬇️

uint256 public refillRate; /// @notice Tokens per second refill rate
uint256 public lastUpdated; /// @notice Timestamp of the last time an action has been taken TODO prob can be uint40
/// @notice Current filled level
uint256 public filledLevel;

Check warning

Code scanning / Olympix Integrated Security

Some state variables are not being fuzzed in test functions, potentially leaving vulnerabilities unexplored. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-variables Medium

Some state variables are not being fuzzed in test functions, potentially leaving vulnerabilities unexplored. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-variables
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
solidity/contracts/libs/RateLimited.sol Fixed Show fixed Hide fixed
/// @notice Tokens per second refill rate
uint256 public refillRate;
/// @notice Timestamp of the last time an action has been taken TODO prob can be uint40
uint256 public lastUpdated;

Check warning

Code scanning / Olympix Integrated Security

Using uninitialized state variables may lead to unexpected behavior. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/uninitialized-state-variable Medium

Using uninitialized state variables may lead to unexpected behavior. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/uninitialized-state-variable
/// @notice Tokens per second refill rate
uint256 public refillRate;
/// @notice Timestamp of the last time an action has been taken TODO prob can be uint40
uint256 public lastUpdated;

Check warning

Code scanning / Olympix Integrated Security

Some state variables are not being fuzzed in test functions, potentially leaving vulnerabilities unexplored. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-variables Medium

Some state variables are not being fuzzed in test functions, potentially leaving vulnerabilities unexplored. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unfuzzed-variables
Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

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

audit remediation is a funny time to introduce ascii art lol

solidity/contracts/libs/RateLimited.sol Outdated Show resolved Hide resolved
solidity/contracts/libs/RateLimited.sol Show resolved Hide resolved
/// @notice Current filled level
uint256 public filledLevel;
/// @notice Tokens per second refill rate
uint256 public refillRate;

Check warning

Code scanning / Olympix Integrated Security

Using uninitialized state variables may lead to unexpected behavior. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/uninitialized-state-variable Medium

Using uninitialized state variables may lead to unexpected behavior. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/uninitialized-state-variable
solidity/contracts/libs/RateLimited.sol Dismissed Show dismissed Hide dismissed
@aroralanuk aroralanuk added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit c9bd7c3 Oct 22, 2024
31 of 38 checks passed
@aroralanuk aroralanuk deleted the kunal/rate-limit-low branch October 22, 2024 07:34
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
### Description

- Added a check for invalid capacity and event for token level change

### Drive-by changes

None

### Related issues

- fixes https://github.com/chainlight-io/2024-08-hyperlane/issues/14

### Backward compatibility

Yes

### Testing

Unit tests
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
### Description

- Added a check for invalid capacity and event for token level change

### Drive-by changes

None

### Related issues

- fixes https://github.com/chainlight-io/2024-08-hyperlane/issues/14

### Backward compatibility

Yes

### Testing

Unit tests
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
### Description

- Added a check for invalid capacity and event for token level change

### Drive-by changes

None

### Related issues

- fixes https://github.com/chainlight-io/2024-08-hyperlane/issues/14

### Backward compatibility

Yes

### Testing

Unit tests
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
### Description

- Added a check for invalid capacity and event for token level change

### Drive-by changes

None

### Related issues

- fixes https://github.com/chainlight-io/2024-08-hyperlane/issues/14

### Backward compatibility

Yes

### Testing

Unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants