Skip to content

Commit ba6dd0a

Browse files
committed
Revert "Feature/MintingAllowance + Role Base System Role (#31)"
This reverts commit 60e07fa.
1 parent 60e07fa commit ba6dd0a

File tree

93 files changed

+16523
-23467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+16523
-23467
lines changed

assets/tokens/eur/info.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

assets/tokens/gbp/info.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

contracts/AcceptingRecipient.sol

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ import "./IERC677Recipient.sol";
2626
* The contract accepts token ownership and stores data in public member variables.
2727
*/
2828
contract AcceptingRecipient is CanReclaimToken, IERC677Recipient {
29+
2930
address public from;
3031
uint256 public amount;
3132
bytes public data;
3233

33-
function onTokenTransfer(
34-
address from_,
35-
uint256 amount_,
36-
bytes calldata data_
37-
) external returns (bool) {
34+
function onTokenTransfer(address from_, uint256 amount_, bytes calldata data_) external returns (bool) {
3835
from = from_;
3936
amount = amount_;
4037
data = data_;
4138
return true;
4239
}
40+
4341
}

contracts/BlacklistValidator.sol

Lines changed: 11 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
pragma solidity ^0.8.11;
1919

20-
import "./ClaimableSystemRole.sol";
20+
import "./ownership/Claimable.sol";
2121
import "./ownership/NoOwner.sol";
2222
import "./ownership/CanReclaimToken.sol";
2323
import "./IValidator.sol";
@@ -26,13 +26,9 @@ import "./IValidator.sol";
2626
* @title BlacklistValidator
2727
* @dev Implements a validator which rejects transfers to blacklisted addresses.
2828
*/
29-
contract BlacklistValidator is
30-
IValidator,
31-
ClaimableSystemRole,
32-
CanReclaimToken,
33-
NoOwner
34-
{
35-
mapping(address => bool) public blacklist;
29+
contract BlacklistValidator is IValidator, Claimable, CanReclaimToken, NoOwner {
30+
31+
mapping (address => bool) public blacklist;
3632

3733
/**
3834
* @dev Emitted when an address is added to the blacklist.
@@ -46,22 +42,11 @@ contract BlacklistValidator is
4642
*/
4743
event Unban(address indexed friend);
4844

49-
constructor() {
50-
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
51-
}
52-
5345
/**
5446
* @dev Adds an address to the blacklist.
5547
* @param adversary Address to add.
5648
*/
57-
function ban(address adversary) external {
58-
require(
59-
owner == msg.sender ||
60-
hasRole(SYSTEM_ROLE, msg.sender) ||
61-
hasRole(ADMIN_ROLE, msg.sender),
62-
"BlacklistValidator: must have admin role to ban"
63-
);
64-
49+
function ban(address adversary) external onlyOwner {
6550
blacklist[adversary] = true;
6651
emit Ban(adversary);
6752
}
@@ -79,11 +64,10 @@ contract BlacklistValidator is
7964
* @dev Validates token transfer.
8065
* Implements IValidator interface.
8166
*/
82-
function validate(
83-
address from,
84-
address to,
85-
uint amount
86-
) external returns (bool valid) {
67+
function validate(address from, address to, uint amount)
68+
external
69+
returns (bool valid)
70+
{
8771
if (blacklist[from]) {
8872
valid = false;
8973
} else {
@@ -96,41 +80,7 @@ contract BlacklistValidator is
9680
* @dev Explicit override of transferOwnership from Claimable and Ownable
9781
* @param newOwner Address to transfer ownership to.
9882
*/
99-
function transferOwnership(
100-
address newOwner
101-
) public override(ClaimableSystemRole, Ownable) {
102-
ClaimableSystemRole.transferOwnership(newOwner);
103-
}
104-
105-
/**
106-
* @dev Explicit override of addSystemAccount from ClaimableSystemRole
107-
* @param account Address to add as system account.
108-
*/
109-
function addSystemAccount(address account) public override onlyOwner {
110-
super.addSystemAccount(account);
111-
}
112-
113-
/**
114-
* @dev Explicit override of removeSystemAccount from ClaimableSystemRole
115-
* @param account Address to remove as system account.
116-
*/
117-
function removeSystemAccount(address account) public override onlyOwner {
118-
super.removeSystemAccount(account);
119-
}
120-
121-
/**
122-
* @dev Explicit override of addAdminAccount from ClaimableSystemRole
123-
* @param account Address to add as admin account.
124-
*/
125-
function addAdminAccount(address account) public override onlyOwner {
126-
super.addAdminAccount(account);
127-
}
128-
129-
/**
130-
* @dev Explicit override of removeAdminAccount from ClaimableSystemRole
131-
* @param account Address to remove as admin account.
132-
*/
133-
function removeAdminAccount(address account) public override onlyOwner {
134-
super.removeAdminAccount(account);
83+
function transferOwnership(address newOwner) public override(Claimable, Ownable) {
84+
Claimable.transferOwnership(newOwner);
13585
}
13686
}

contracts/ClaimableSystemRole.sol

Lines changed: 0 additions & 41 deletions
This file was deleted.

contracts/ConstantSmartController.sol

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,14 @@ import "./SmartController.sol";
2525
* @dev Constantly rejects token transfers by using a rejecting validator.
2626
*/
2727
contract ConstantSmartController is SmartController {
28+
2829
/**
2930
* @dev Contract constructor.
3031
* @param storage_ Address of the new storage.
3132
* @param ticker 3 letter currency ticker.
3233
*/
33-
constructor(
34-
address storage_,
35-
bytes3 ticker
36-
)
37-
SmartController(
38-
storage_,
39-
address(new ConstantValidator(false)),
40-
ticker,
41-
address(0x0)
42-
)
43-
{}
34+
constructor(address storage_, bytes3 ticker)
35+
SmartController(storage_, address(new ConstantValidator(false)), ticker, address(0x0))
36+
{ }
37+
4438
}

contracts/ConstantValidator.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import "./IValidator.sol";
2727
* @dev Constantly validates token transfers based on the constructor value.
2828
*/
2929
contract ConstantValidator is IValidator, Claimable, CanReclaimToken, NoOwner {
30+
3031
bool internal valid;
3132

3233
/**
@@ -49,9 +50,7 @@ contract ConstantValidator is IValidator, Claimable, CanReclaimToken, NoOwner {
4950
* @dev Explicit override of transferOwnership from Claimable and Ownable
5051
* @param newOwner Address to transfer ownership to.
5152
*/
52-
function transferOwnership(
53-
address newOwner
54-
) public override(Claimable, Ownable) {
55-
Claimable.transferOwnership(newOwner);
53+
function transferOwnership(address newOwner) public override(Claimable, Ownable) {
54+
Claimable.transferOwnership(newOwner);
5655
}
5756
}

0 commit comments

Comments
 (0)