diff --git a/src/errors/Errors.sol b/src/errors/Errors.sol index 155d4d0..6d6e768 100644 --- a/src/errors/Errors.sol +++ b/src/errors/Errors.sol @@ -96,3 +96,7 @@ interface INameRegistryErrors { error CirclesNamesOrganizationHasNoSymbol(address organization, uint8 code); } + +interface IMigrationErrors { + error CirclesMigrationAmountMustBeGreaterThanZero(); +} diff --git a/src/migration/Migration.sol b/src/migration/Migration.sol index 2830d9a..b7d6e13 100644 --- a/src/migration/Migration.sol +++ b/src/migration/Migration.sol @@ -6,7 +6,7 @@ import "../hub/IHub.sol"; import "./IHub.sol"; import "./IToken.sol"; -contract Migration is ICirclesErrors { +contract Migration is ICirclesErrors, IMigrationErrors { // Constant uint256 private constant ACCURACY = uint256(10 ** 8); @@ -75,6 +75,10 @@ contract Migration is ICirclesErrors { // Invalid avatar, not registered in hub V1. revert CirclesAddressCannotBeZero(2); } + if (_amounts[i] == 0) { + // Amount must be greater than zero. + revert CirclesMigrationAmountMustBeGreaterThanZero(); + } convertedAmounts[i] = convertFromV1ToDemurrage(_amounts[i]); // transfer the v1 Circles to this contract to be locked circlesV1.transferFrom(msg.sender, address(this), _amounts[i]);