add whitelist quota template

This commit is contained in:
owen05
2021-04-20 21:02:43 +08:00
parent 00a5b8ab76
commit 84fd28a1c1

View File

@@ -0,0 +1,27 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {Ownable} from "../lib/Ownable.sol";
contract UserQuota is Ownable {
mapping(address => uint256) public userQuota;
uint256 constant quota = 375 * 10**6; //For example 375u on eth
function setUserQuota(address[] memory users) external onlyOwner {
for(uint256 i = 0; i< users.length; i++) {
require(users[i] != address(0), "USER_INVALID");
userQuota[users[i]] = quota;
}
}
function getUserQuota(address user) external view returns (uint256) {
return userQuota[user];
}
}