Skip to main content
logo

safety

The safety module is tasked solely with receiving a fraction of an outpost’s revenues denominated in stablecoins. Spending funds in the safetyfund can only be done via a successful governance proposal.

Links

Proposal Types

SafetyFundSpendProposal

SafetyFundSpendProposal details a proposal for the use of safety funds, together with how many coins are proposed to be spent, and to which recipient account.

NOTE

For now, this is just a copy of the CommunityPoolSpendProposal in the distribution module. in the long term, the goal is for the module to be able to automatically detect bad debts incurred in outposts and automatically distribute the appropriate amount of funds, without having to go through the governance process.

proposals.proto
Copy

_20
message SafetyFundSpendProposal {
_20
option (gogoproto.equal) = false;
_20
option (gogoproto.goproto_getters) = false;
_20
option (gogoproto.goproto_stringer) = false;
_20
_20
// Title is the proposal's title
_20
string title = 1;
_20
_20
// Description is the proposal's description
_20
string description = 2;
_20
_20
// Recipient is a string representing the account address to which the funds shall be sent to
_20
string recipient = 3;
_20
_20
// Amount represents the coins that shall be sent to the recipient
_20
repeated cosmos.base.v1beta1.Coin amount = 4 [
_20
(gogoproto.nullable) = false,
_20
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
_20
];
_20
}

Queries

Query defines the gRPC querier service for the safety fund module.

query.proto
Copy

_6
service Query {
_6
// Balances queries coins available in the safety fund
_6
rpc Balances(QueryBalancesRequest) returns (QueryBalancesResponse) {
_6
option (google.api.http).get = "/mars/safety/v1beta1/balances";
_6
}
_6
}

QueryBalancesRequest

QueBalancesRequest is the request type of the QuerBalancesRPC method.

query.proto
Copy

_1
message QueryBalancesRequest {}

QueryBalancesResponse

QueBalancesResponse is the response type of the QuerBalancesRPC method.

query.proto
Copy

_7
message QueryBalancesResponse {
_7
// Balances is the coins available in the safety fund
_7
repeated cosmos.base.v1beta1.Coin balances = 1 [
_7
(gogoproto.nullable) = false,
_7
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
_7
];
_7
}