Add governance change events
@@ -12,6 +12,14 @@ import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
+ event LogUpdateLotSizes(uint256[] _lotSizes);
+ event LogUpdateAllowNewDeposits(bool _allowNewDeposits);
+ event LogUpdateSignerFeeDivisor(uint256 _signerFeeDivisor);
+ event LogUpdateCollateralizationThresholds(
+ uint256 _undercollateralizedThresholdPercent,
+ uint256 _severelyUndercollateralizedThresholdPercent
+ );
+
bool _initialized = false;
uint256 currentDifficulty = 1;
@@ -25,7 +33,8 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
uint256 private signerFeeDivisor = 200; // 1/200 == 50bps == 0.5% == 0.005
uint128 private undercollateralizedThresholdPercent = 140; // percent
uint128 private severelyUndercollateralizedThresholdPercent = 120; // percent
- uint256[] lotSizes = [10**7, 20**7, 50**7, 10**8]; // satoshi
+ uint256[] lotSizes = [10**7, 20**7, 50**7, 10**8]; // satoshi. [0.1, 0.2, 0.5, 1.0] BTC
+ // This event is fired when we init the deposit
constructor(address _priceFeed) public {
priceFeed = _priceFeed;
@@ -46,6 +55,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
external onlyOwner
{
allowNewDeposits = _allowNewDeposits;
+ emit LogUpdateAllowNewDeposits(_allowNewDeposits);
}
/// @notice Gets whether new deposits are allowed.
@@ -58,6 +68,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
{
require(_signerFeeDivisor > 1, "Signer fee must be lower than 100%");
signerFeeDivisor = _signerFeeDivisor;
+ emit LogUpdateSignerFeeDivisor(_signerFeeDivisor);
}
/// @notice Gets the system signer fee divisor.
@@ -69,6 +80,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
/// @param _lotSizes Array of allowed lot sizes.
function setLotSizes(uint256[] calldata _lotSizes) external onlyOwner {
lotSizes = _lotSizes;
+ emit LogUpdateLotSizes(_lotSizes);
}
/// @notice Gets the allowed lot sizes
@@ -88,6 +100,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
}
return false;
}
+
/// @notice Set the system collateralization levels
/// @param _undercollateralizedThresholdPercent first undercollateralization trigger
/// @param _severelyUndercollateralizedThresholdPercent second undercollateralization trigger
@@ -101,6 +114,10 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
);
undercollateralizedThresholdPercent = _undercollateralizedThresholdPercent;
severelyUndercollateralizedThresholdPercent = _severelyUndercollateralizedThresholdPercent;
+ emit LogUpdateCollateralizationThresholds(
+ _undercollateralizedThresholdPercent,
+ _severelyUndercollateralizedThresholdPercent
+ );
}
/// @notice Get the system undercollateralization level for new deposits
