The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/solidity/contracts/Sortition.sol

31 lines
878 B

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.6.11;
interface ISortition {
function current() external view returns (address);
function slash(address payable _reporter) external;
}
// Simple contract for managing update selection
// TODO: make this inherit from common, then have home inherit from it?
// Or keep external for easier upgrading?
contract NoSortition is ISortition {
address updater;
uint256 constant BOND_SIZE = 50 ether;
constructor(address _updater) payable {
require(msg.value >= BOND_SIZE, "insufficient bond");
updater = _updater;
}
function current() external view override returns (address) {
return updater;
}
function slash(address payable _reporter) external override {
// TODO: caller gate this
_reporter.transfer(address(this).balance / 2);
}
}