Compare commits

..

2 Commits

Author SHA1 Message Date
bc905d9f15
add governor part of the main deployment routine
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-02-08 21:07:28 +03:00
2063923f8d
make governance more flexible for most frequent functions
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-02-08 21:06:26 +03:00
5 changed files with 41 additions and 8 deletions

View File

@ -88,6 +88,20 @@ STINKY_TOKEN_SYMBOL=
GHOST_TOKEN_NAME=
GHOST_TOKEN_SYMBOL=
################################# Governor values ###################################
## Default values for governor smart contract. ##
## extension - number of blocks to be extended if late quorum occured. ##
## delay - number of blocks before proposal becomes active. ##
## period - number of blocks for proposal to be voted on. ##
## threshold - number of votes required in order for a voter to become a proposer. ##
## fraction - percentage of supply, where denominator is 100 ##
#####################################################################################
GOVERNOR_VOTE_EXTENSION=
GOVERNOR_VOTING_DELAY=
GOVERNOR_VOTING_PERIOD=
GOVERNOR_PROPOSAL_THRESHOLD=
GOVERNOR_QUORUM_FRACTION=
## Initial ghosted supply on gatekeeper
INITIAL_GHOSTED_SUPPLY=

View File

@ -25,9 +25,10 @@ usage() {
echo "8) StakingDistributor"
echo "9) BondingCalculator"
echo "10) Gatekeeper"
echo "11) AfterPartyFirst"
echo "12) AfterPartySecond"
echo "13) AfterPartyThird"
echo "11) Governor"
echo "12) AfterPartyFirst"
echo "13) AfterPartySecond"
echo "14) AfterPartyThird"
exit 1
}
@ -108,10 +109,12 @@ for i in $(seq $START $END); do
elif [ "10" == "$i" ]; then
CONTRACT="Gatekeeper"
elif [ "11" == "$i" ]; then
CONTRACT="AfterPartyFirst"
CONTRACT="Governor"
elif [ "12" == "$i" ]; then
CONTRACT="AfterPartySecond"
CONTRACT="AfterPartyFirst"
elif [ "13" == "$i" ]; then
CONTRACT="AfterPartySecond"
elif [ "14" == "$i" ]; then
CONTRACT="AfterPartyThird"
else
echo "No contract found for index $i"

View File

@ -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);

View File

@ -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];

View File

@ -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);