// Copyright 2021 Cartesi Pte. Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. pragma solidity >=0.7.0; /// @title Interaction between a pool and the PoS block production. /// @author Danilo Tuler /// @notice This interface provides an opportunity to handle the necessary logic /// after a block is produced. /// A commission is taken from the block reward, and the remaining stays in the pool, /// raising the pool share value, and being further staked. interface StakingPoolProducer { /// @notice routes produceBlock to POS contract and /// updates internal states of the pool /// @return true when everything went fine function produceBlock(uint256 _index) external returns (bool); /// @notice this event is emitted at every produceBlock call /// reward is the block reward /// commission is how much CTSI is directed to the pool owner event BlockProduced(uint256 reward, uint256 commission); }