第82篇 笔记-设置白名单智能合约

Posted wonderBlock

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第82篇 笔记-设置白名单智能合约相关的知识,希望对你有一定的参考价值。

本合约,实现单个及批量设置白名单,主要用于控制用户权限;

源码:

pragma solidity ^0.4.24;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address public owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     */
    constructor() public {
        owner = msg.sender;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */

以上是关于第82篇 笔记-设置白名单智能合约的主要内容,如果未能解决你的问题,请参考以下文章

第113篇 笔记-DateTime智能合约

第91篇 笔记-物流溯源智能合约

第83篇 笔记-猜拳游戏智能合约

第84篇 笔记-智能合约(solidity)编程

第124篇 NFT市场智能合约

第124篇 NFT市场智能合约