|
| 1 | +/** |
| 2 | +▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄ |
| 3 | +▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ |
| 4 | + ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓ |
| 5 | + ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓ |
| 6 | + ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ |
| 7 | + ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀ |
| 8 | + ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ |
| 9 | +▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ |
| 10 | +▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ |
| 11 | +
|
| 12 | + Trust math, not hardware. |
| 13 | +*/ |
| 14 | + |
| 15 | +pragma solidity 0.5.17; |
| 16 | + |
| 17 | +import "./AbstractBonding.sol"; |
| 18 | + |
| 19 | + |
| 20 | +/// @title ETH Bonding |
| 21 | +/// @notice Contract holding deposits from keeps' operators. |
| 22 | +contract ETHBonding is AbstractBonding { |
| 23 | + /// @notice Initializes Keep Bonding contract. |
| 24 | + /// @param registryAddress Keep registry contract address. |
| 25 | + /// @param ethStakingAddress ETH Staking contract address. |
| 26 | + constructor(address registryAddress, address ethStakingAddress) |
| 27 | + public |
| 28 | + AbstractBonding(registryAddress, ethStakingAddress) |
| 29 | + {} |
| 30 | + |
| 31 | + /// @notice Withdraws amount from operator's value available for bonding. |
| 32 | + /// This function can be called only by: |
| 33 | + /// - operator, |
| 34 | + /// - owner of the stake. |
| 35 | + /// |
| 36 | + /// @param amount Value to withdraw in wei. |
| 37 | + /// @param operator Address of the operator. |
| 38 | + function withdraw(uint256 amount, address operator) public { |
| 39 | + require( |
| 40 | + msg.sender == operator || msg.sender == staking.ownerOf(operator), |
| 41 | + "Only operator or the owner is allowed to withdraw bond" |
| 42 | + ); |
| 43 | + |
| 44 | + withdrawBond(amount, operator); |
| 45 | + } |
| 46 | +} |
0 commit comments