diff --git a/.changeset/tricky-deer-greet.md b/.changeset/tricky-deer-greet.md new file mode 100644 index 00000000..4b6a7355 --- /dev/null +++ b/.changeset/tricky-deer-greet.md @@ -0,0 +1,5 @@ +--- +"@perfect-abstractions/compose": patch +--- + +use ERC20InvalidSender instead of ERC20InvalidReceiver for zero address _from in crosschainburn by @Jayy4rl diff --git a/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol b/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol index 6e7d3b6c..4be3dda6 100644 --- a/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol +++ b/src/token/ERC20/Bridgeable/ERC20BridgeableFacet.sol @@ -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]; diff --git a/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol b/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol index 32b56c21..aeb3eafd 100644 --- a/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol +++ b/src/token/ERC20/Bridgeable/ERC20BridgeableMod.sol @@ -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]; diff --git a/test/trees/ERC20.tree b/test/trees/ERC20.tree index a58cfdb5..1e563f2f 100644 --- a/test/trees/ERC20.tree +++ b/test/trees/ERC20.tree @@ -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 diff --git a/test/unit/token/ERC20/Bridgeable/facet/fuzz/crosschainBurn.t.sol b/test/unit/token/ERC20/Bridgeable/facet/fuzz/crosschainBurn.t.sol index aefefd01..698df8b6 100644 --- a/test/unit/token/ERC20/Bridgeable/facet/fuzz/crosschainBurn.t.sol +++ b/test/unit/token/ERC20/Bridgeable/facet/fuzz/crosschainBurn.t.sol @@ -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); }