From 3ec2e141cc46b929bf3322f8fd94fc7960b15e43 Mon Sep 17 00:00:00 2001 From: owen05 Date: Fri, 11 Jun 2021 14:23:43 +0800 Subject: [PATCH] update userQuota template --- contracts/DODOFee/UserQuota.sol | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contracts/DODOFee/UserQuota.sol b/contracts/DODOFee/UserQuota.sol index d75027a..3403a50 100644 --- a/contracts/DODOFee/UserQuota.sol +++ b/contracts/DODOFee/UserQuota.sol @@ -9,7 +9,11 @@ pragma solidity 0.6.9; import {Ownable} from "../lib/Ownable.sol"; -contract UserQuota is Ownable { +interface IQuota { + function getUserQuota(address user) external view returns (int); +} + +contract UserQuota is Ownable, IQuota { mapping(address => uint256) public userQuota; uint256 constant quota = 375 * 10**6; //For example 375u on eth @@ -21,7 +25,7 @@ contract UserQuota is Ownable { } } - function getUserQuota(address user) external view returns (uint256) { - return userQuota[user]; + function getUserQuota(address user) override external view returns (int) { + return int(userQuota[user]); } }