Ownability
Safely control and transfer ownership of your smart contract.
We'll cover the following...
OpenZeppelin
OpenZeppelin is an open-source framework that gives us access to audited implementations of all sorts of standard design patterns and Ethereum Improvement Proposals. This framework can be installed on a server running Node.js using the following command:
npm install @openzeppelin/contracts
This gives us the ability to import OpenZeppelin code in Solidity, with the moniker @openzeppelin
, and allows our contract to inherit from OpenZeppelin, as follows:
Press + to interact
import "@openzeppelin/contracts/access/Ownable.sol";pragma solidity >=0.4.0 <0.7.0;contract X is Ownable{}
It's also possible to store OpenZeppelin files ...