-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleVoucher.sol
47 lines (37 loc) · 1.44 KB
/
ExampleVoucher.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
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "../UnionVoucher.sol";
contract ExampleVoucher is Ownable, UnionVoucher{
constructor(address marketRegistry, address unionToken, address token) BaseUnionMember(marketRegistry,unionToken,token) {
}
//become a member
function registerMember() public onlyOwner {
uint256 newMemberFee = userManager.newMemberFee();
unionToken.transferFrom(msg.sender, address(this), newMemberFee);
_registerMember();
}
// update trust for account
function updateTrust(address account, uint256 amount) public onlyOwner {
_updateTrust(account, amount);
}
// stop vouch for other member
function cancelVouch(address staker, address borrower) public onlyOwner {
_cancelVouch(staker, borrower);
}
function stake(uint256 amount) public onlyOwner {
underlyingToken.transferFrom(msg.sender, address(this), amount);
_stake(amount);
}
function unstake(uint256 amount) public onlyOwner {
_unstake(amount);
underlyingToken.transfer(msg.sender, amount);
}
function withdrawRewards() public onlyOwner {
_withdrawRewards();
unionToken.transfer(msg.sender, unionToken.balanceOf(address(this)));
}
function debtWriteOff(address borrower, uint256 amount) public onlyOwner {
_debtWriteOff(borrower, amount);
}
}