-
Notifications
You must be signed in to change notification settings - Fork 0
/
EbWithResaleFund.sol
50 lines (40 loc) · 1.1 KB
/
EbWithResaleFund.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: MIT
pragma solidity =0.7.5;
import "LibSafeMath.sol";
import "LibBaseAuth.sol";
contract WithResaleFund is BaseAuth {
using SafeMath for uint256;
address payable private _resaleFund;
uint16 private _resalePermille;
function setResaleFund(
address payable account,
uint16 permille
)
external
onlyAgent
{
require(permille <= 500, "Set resale fund permille: exceeds 50.0%");
_resaleFund = account;
_resalePermille = permille;
}
function getResaleFund()
public
view
returns (
address payable account,
uint16 permille,
uint256 balance
)
{
account = _resaleFund;
permille = _resalePermille;
balance = account.balance;
}
function sendResaleFund(uint256 weiPayment)
internal
{
if (_resalePermille > 0 && _resaleFund != address(0)) {
_resaleFund.transfer(weiPayment.mul(_resalePermille).div(1_000));
}
}
}