Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tricky-deer-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@perfect-abstractions/compose": patch
---

use ERC20InvalidSender instead of ERC20InvalidReceiver for zero address _from in crosschainburn by @Jayy4rl
2 changes: 1 addition & 1 deletion src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ contract ERC20BridgeableFacet {
_requireRole("trusted-bridge");

if (_from == address(0)) {
revert ERC20InvalidReceiver(address(0));
revert ERC20InvalidSender(address(0));
}

uint256 accountBalance = erc20Storage.balanceOf[_from];
Expand Down
2 changes: 1 addition & 1 deletion src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function crosschainBurn(address _from, uint256 _value) {
_requireRole("trusted-bridge");

if (_from == address(0)) {
revert ERC20InvalidReceiver(address(0));
revert ERC20InvalidSender(address(0));
}

uint256 accountBalance = erc20Storage.balanceOf[_from];
Expand Down
2 changes: 1 addition & 1 deletion test/trees/ERC20.tree
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Bridgeable
│ ├── when caller does not have trusted-bridge role
│ │ └── it should revert with AccessControlUnauthorizedAccount
│ ├── when from is zero address
│ │ └── it should revert with ERC20InvalidReceiver
│ │ └── it should revert with ERC20InvalidSender
│ ├── when from balance is less than the amount
│ │ └── it should revert with ERC20InsufficientBalance
│ └── when caller has trusted-bridge role and from has sufficient balance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ contract CrosschainBurn_ERC20BridgeableFacet_Fuzz_Unit_Test is ERC20BridgeableFa
seedTrustedBridge(users.admin);
vm.stopPrank();
vm.prank(users.admin);
vm.expectRevert(abi.encodeWithSelector(ERC20BridgeableFacet.ERC20InvalidReceiver.selector, ADDRESS_ZERO));
vm.expectRevert(abi.encodeWithSelector(ERC20BridgeableFacet.ERC20InvalidSender.selector, ADDRESS_ZERO));
facet.crosschainBurn(ADDRESS_ZERO, value);
}

Expand Down
Loading