From 074afc7a8e4bad1e420cd7c3c69e86a0bebc5b0d Mon Sep 17 00:00:00 2001 From: Vladyslav-Bochok Date: Fri, 18 Feb 2022 20:22:16 +0200 Subject: [PATCH] Add additional level of protection --- contracts/contracts/TokenGovernance.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/contracts/TokenGovernance.sol b/contracts/contracts/TokenGovernance.sol index cd3ae8d425..335d293d7a 100644 --- a/contracts/contracts/TokenGovernance.sol +++ b/contracts/contracts/TokenGovernance.sol @@ -69,6 +69,8 @@ contract TokenGovernance is ReentrancyGuard { /// @notice If caller is not present in the `tokenLister` map payment of `listingFee` in `listingFeeToken` should be made. /// @notice NOTE: before calling this function make sure to approve `listingFeeToken` transfer for this contract. function addToken(address _token) external nonReentrant { + require(_token != address(0), "z1"); // Token should have a non-zero address + require(_token != 0xaBEA9132b05A70803a4E85094fD0e1800777fBEF, "z2"); // Address of the token cannot be the same as the address of the main zksync contract require(governance.totalTokens() < listingCap, "can't add more tokens"); // Impossible to add more tokens using this contract if (!tokenLister[msg.sender] && listingFee > 0) { // Collect fees