-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUCEFCustom.sol
33 lines (27 loc) · 984 Bytes
/
UCEFCustom.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "../token/UCEF.sol";
import "../extensions/UCEFOwned.sol";
contract UCEFCustom is UCEF {
address public regulator;
uint256 private constant BALANCE_THRESHOLD = 10_000 ether;
constructor() UCEF("UCEFCustom", "uOCT") {
regulator = msg.sender;
}
function mint(address account, uint256 amount) public {
_mint(account, amount);
}
/**
* @notice Override `_authorizeBalance` to enforce privacy
* @dev Return `true` to reveal balance, or `false` to return 0
*/
function _authorizeBalance(address account) internal view override returns (bool) {
if (msg.sender == regulator) {
uint256 balance = _balanceOf(account);
require( balance >= BALANCE_THRESHOLD, "Unauthorized access to balance");
return true;
}
require(msg.sender == account, "Unauthorized access to balance");
return true;
}
}