This repository was archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathFullyBackedECDSAKeep.sol
More file actions
70 lines (61 loc) · 3.87 KB
/
FullyBackedECDSAKeep.sol
File metadata and controls
70 lines (61 loc) · 3.87 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀
▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌
▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓
Trust math, not hardware.
*/
pragma solidity 0.5.17;
import "../AbstractBondedECDSAKeep.sol";
import "./FullyBackedBonding.sol";
import "./FullyBackedECDSAKeepFactory.sol";
/// @title Fully Backed Bonded ECDSA Keep
/// @notice ECDSA keep with additional signer bond requirement that is fully backed
/// by ETH only.
/// @dev This contract is used as a master contract for clone factory in
/// BondedECDSAKeepFactory as per EIP-1167.
contract FullyBackedECDSAKeep is AbstractBondedECDSAKeep {
FullyBackedBonding bonding;
FullyBackedECDSAKeepFactory keepFactory;
/// @notice Initialization function.
/// @dev We use clone factory to create new keep. That is why this contract
/// doesn't have a constructor. We provide keep parameters for each instance
/// function after cloning instances from the master contract.
/// @param _owner Address of the keep owner.
/// @param _members Addresses of the keep members.
/// @param _honestThreshold Minimum number of honest keep members.
/// @param _bonding Address of the Bonding contract.
/// @param _keepFactory Address of the BondedECDSAKeepFactory that created
/// this keep.
function initialize(
address _owner,
address[] memory _members,
uint256 _honestThreshold,
address _bonding,
address payable _keepFactory
) public {
super.initialize(_owner, _members, _honestThreshold, _bonding);
bonding = FullyBackedBonding(_bonding);
keepFactory = FullyBackedECDSAKeepFactory(_keepFactory);
bonding.claimDelegatedAuthority(_keepFactory);
}
function slashForSignatureFraud() internal {
// TODO: We don't need to do anything as keep owner is able to seize the bonds
// TODO: Ban members (remove from sortition pool and don't let to rejoin)
}
/// @notice Gets the beneficiary for the specified member address.
/// @param _member Member address.
/// @return Beneficiary address.
function beneficiaryOf(address _member)
internal
view
returns (address payable)
{
return bonding.beneficiaryOf(_member);
}
}