Skip to content

Commit

Permalink
adds a address(0) check to setters
Browse files Browse the repository at this point in the history
Signed-off-by: stadolf <stefan@molecule.to>
  • Loading branch information
elmariachi111 committed Jan 10, 2024
1 parent 42ab21f commit 00fa16d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Tokenizer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { IPNFT } from "./IPNFT.sol";

error MustOwnIpnft();
error AlreadyTokenized();

error ZeroAddress();
/// @title Tokenizer 1.2
/// @author molecule.to
/// @notice tokenizes an IPNFT to an ERC20 token (called IPT) and controls its supply.

contract Tokenizer is UUPSUpgradeable, OwnableUpgradeable {
event TokensCreated(
uint256 indexed moleculesId,
Expand Down Expand Up @@ -71,11 +72,18 @@ contract Tokenizer is UUPSUpgradeable, OwnableUpgradeable {
/*
could call some functions on old contract to make sure its tokenizer not another contract behind a proxy for safety
*/
if (address(_ipTokenImplementation) == address(0)) {
revert ZeroAddress();
}

emit IPTokenImplementationUpdated(ipTokenImplementation, _ipTokenImplementation);
ipTokenImplementation = _ipTokenImplementation;
}

function setPermissioner(IPermissioner _permissioner) external onlyOwner {
if (address(_permissioner) == address(0)) {
revert ZeroAddress();
}
emit PermissionerUpdated(permissioner, _permissioner);
permissioner = _permissioner;
}
Expand Down

0 comments on commit 00fa16d

Please sign in to comment.