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 <[email protected]>
  • Loading branch information
elmariachi111 committed Jan 10, 2024
1 parent 42ab21f commit 6324d6d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions 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 @@ -67,15 +68,22 @@ contract Tokenizer is UUPSUpgradeable, OwnableUpgradeable {
* @notice sets the new implementation address of the IPToken
* @param _ipTokenImplementation address pointing to the new implementation
*/
function setIPTokenImplementation(IPToken _ipTokenImplementation) public onlyOwner {
function setIPTokenImplementation(IPToken _ipTokenImplementation) external onlyOwner {
/*
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 6324d6d

Please sign in to comment.