本合约,实现单个及批量设置白名单,主要用于控制用户权限;
源码:
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 curren
智能合约实践:白名单设置与权限控制
本文档详细介绍了如何使用智能合约实现单个和批量设置白名单功能,以此来有效地控制区块链网络中用户的访问权限。合约源码可供参考。
订阅专栏 解锁全文
1624





