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): add rebasing compatibility for HypERC4626 #4524

Merged
merged 9 commits into from
Oct 25, 2024

Conversation

aroralanuk
Copy link
Contributor

Description

  • Added overrides for transferFrom, totalSupply to reflect the internal share based accounting for the 4626 mirror asset

Drive-by changes

  • Overridden _transfer to update the Transfer event to display the asset being transfers as amount not the internal shares.

Related issues

Backward compatibility

Yes

Testing

Fuzz testing

Copy link

changeset-bot bot commented Sep 19, 2024

🦋 Changeset detected

Latest commit: c6134d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/core Patch
@hyperlane-xyz/helloworld Patch
@hyperlane-xyz/sdk Patch
@hyperlane-xyz/infra Patch
@hyperlane-xyz/cli Patch
@hyperlane-xyz/widgets Patch
@hyperlane-xyz/ccip-server Patch
@hyperlane-xyz/github-proxy Patch
@hyperlane-xyz/utils Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.97%. Comparing base (29bf1d8) to head (c6134d7).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4524      +/-   ##
==========================================
+ Coverage   73.81%   73.97%   +0.15%     
==========================================
  Files         101      101              
  Lines        1455     1460       +5     
  Branches      191      191              
==========================================
+ Hits         1074     1080       +6     
+ Misses        360      359       -1     
  Partials       21       21              
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 75.71% <ø> (ø)
isms 77.58% <ø> (ø)
token 89.01% <100.00%> (+0.87%) ⬆️
middlewares 77.39% <ø> (ø)

@aroralanuk aroralanuk requested a review from ltyu as a code owner September 26, 2024 07:37
@@ -172,6 +177,108 @@
);
}

function testTransferFrom() public {

Check notice

Code scanning / Olympix Integrated Security

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events Low test

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events

event Transfer(address indexed from, address indexed to, uint256 value);

function testTransferEvent() public {

Check notice

Code scanning / Olympix Integrated Security

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events Low test

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events
);
}

function testTotalShares() public {

Check notice

Code scanning / Olympix Integrated Security

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events Low test

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events
);
}

function testShareBalanceOf() public {

Check notice

Code scanning / Olympix Integrated Security

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events Low test

Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events
solidity/test/token/HypERC4626Test.t.sol Show resolved Hide resolved
solidity/contracts/token/extensions/HypERC4626.sol Outdated Show resolved Hide resolved
solidity/contracts/token/extensions/HypERC4626.sol Outdated Show resolved Hide resolved
solidity/contracts/token/extensions/HypERC4626.sol Outdated Show resolved Hide resolved
solidity/contracts/token/extensions/HypERC4626.sol Outdated Show resolved Hide resolved
solidity/test/token/HypERC4626Test.t.sol Show resolved Hide resolved
@aroralanuk aroralanuk enabled auto-merge October 24, 2024 08:24
@@ -242,6 +247,108 @@
);
}

function testTransferFrom() public {

Check failure

Code scanning / Olympix Integrated Security

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy Critical test

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy
);
}

function testTotalShares() public {

Check failure

Code scanning / Olympix Integrated Security

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy Critical test

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy
);
}

function testShareBalanceOf() public {

Check failure

Code scanning / Olympix Integrated Security

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy Critical test

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy
@@ -480,6 +587,32 @@
);
}

function testTotalSupply() public {

Check failure

Code scanning / Olympix Integrated Security

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy Critical test

Modifying state after making an external call may allow for reentrancy attacks. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy
@aroralanuk aroralanuk added this pull request to the merge queue Oct 25, 2024
Merged via the queue into main with commit a42616f Oct 25, 2024
35 of 36 checks passed
@aroralanuk aroralanuk deleted the kunal/4626-full-compt branch October 25, 2024 01:22
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
…e-xyz#4524)

### Description

- Added overrides for transferFrom, totalSupply to reflect the internal
share based accounting for the 4626 mirror asset

### Drive-by changes

- Overridden `_transfer` to update the Transfer event to display the
asset being transfers as amount not the internal shares.

### Related issues

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

### Backward compatibility

Yes

### Testing

Fuzz testing
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
…e-xyz#4524)

### Description

- Added overrides for transferFrom, totalSupply to reflect the internal
share based accounting for the 4626 mirror asset

### Drive-by changes

- Overridden `_transfer` to update the Transfer event to display the
asset being transfers as amount not the internal shares.

### Related issues

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

### Backward compatibility

Yes

### Testing

Fuzz testing
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
…e-xyz#4524)

### Description

- Added overrides for transferFrom, totalSupply to reflect the internal
share based accounting for the 4626 mirror asset

### Drive-by changes

- Overridden `_transfer` to update the Transfer event to display the
asset being transfers as amount not the internal shares.

### Related issues

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

### Backward compatibility

Yes

### Testing

Fuzz testing
tiendn pushed a commit to tiendn/hyperlane-monorepo that referenced this pull request Oct 25, 2024
…e-xyz#4524)

### Description

- Added overrides for transferFrom, totalSupply to reflect the internal
share based accounting for the 4626 mirror asset

### Drive-by changes

- Overridden `_transfer` to update the Transfer event to display the
asset being transfers as amount not the internal shares.

### Related issues

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

### Backward compatibility

Yes

### Testing

Fuzz testing
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