make governance more flexible for most frequent functions
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
0f23d7bd3d
commit
2063923f8d
@ -130,7 +130,12 @@ contract GhostBondDepository is IBondDepository, NoteKeeper {
|
||||
address _quoteToken,
|
||||
uint32[2] calldata _intervals,
|
||||
bool[2] calldata _booleans
|
||||
) external override onlyPolicy returns (uint256 id) {
|
||||
) external override returns (uint256 id) {
|
||||
if (
|
||||
msg.sender != authority.governor() &&
|
||||
msg.sender != authority.policy()
|
||||
) revert NotGuardianOrPolicy();
|
||||
|
||||
uint256 secondsToConclusion = _terms[1] - block.timestamp;
|
||||
uint256 decimals = IERC20Metadata(_quoteToken).decimals();
|
||||
uint64 targetDebt = uint64(_booleans[0]
|
||||
@ -179,7 +184,12 @@ contract GhostBondDepository is IBondDepository, NoteKeeper {
|
||||
emit MarketCreated(id, address(_ftso), _quoteToken, _market[1]);
|
||||
}
|
||||
|
||||
function close(uint256 id) external override onlyPolicy {
|
||||
function close(uint256 id) external override {
|
||||
if (
|
||||
msg.sender != authority.governor() &&
|
||||
msg.sender != authority.policy()
|
||||
) revert NotGuardianOrPolicy();
|
||||
|
||||
terms[id].conclusion = uint48(block.timestamp);
|
||||
markets[id].capacity = 0;
|
||||
emit MarketClosed(id);
|
||||
|
||||
@ -149,7 +149,12 @@ contract GhostTreasury is GhostAccessControlled, ITreasury {
|
||||
emit RepayDebt(msg.sender, ftso, amount, amount);
|
||||
}
|
||||
|
||||
function auditReserves() external onlyGovernor {
|
||||
function auditReserves() external {
|
||||
if (
|
||||
msg.sender != authority.governor() &&
|
||||
msg.sender != authority.guardian()
|
||||
) revert NotApproved();
|
||||
|
||||
uint256 reserves;
|
||||
address[] memory reserveTokens = registry[STATUS.RESERVETOKEN];
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ interface IBondDepository {
|
||||
error DepositoryConcluded(uint48 concludedTime);
|
||||
error DepositoryMaxPrice(uint256 price, uint256 maxPrice);
|
||||
error DepositoryMaxSize(uint256 payout, uint256 maxPayout);
|
||||
error NotGuardianOrPolicy();
|
||||
|
||||
event MarketClosed(uint256 indexed id);
|
||||
event Bond(uint256 indexed id, uint256 amount, uint256 price);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user