Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
/ sealed Public archive

an abstract contract which you can "seal" + example

License

Notifications You must be signed in to change notification settings

yoyyyyo/sealed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sealed

npm - github

a contract which you can "seal"

this is convenient for when you wish to disable particular functions after a certain point, but would still like to keep the ownership of the contract via Ownable.

example

pragma solidity ^0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@yoyyyyo/sealed/Sealable.sol";
// SPDX-License-Identifier: CC0

contract ExampleSealed is Ownable, Sealable {
    uint8 importantParameter;
    address publiclyChangeableParameter;

    constructor(uint8 _p) {
        importantParameter = _p;
        publiclyChangeableParameter = msg.sender;
    }

    function changeParameter(uint8 _p) external onlyOwner unsealed {
        importantParameter = _p;
    }
    
    function changePubliclyChangeableParameter() external unsealed {
        publiclyChangeableParameter = msg.sender;
    }
    
}

About

an abstract contract which you can "seal" + example

Resources

License

Stars

Watchers

Forks

Packages

No packages published