Skip to content

Commit

Permalink
subsidy
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Nov 25, 2021
1 parent 9211932 commit a8f8339
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/lib/config/src/configs/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ pub struct MiscConfig {
pub fee_account_private_key: H256,
/// Log format
pub log_format: LogFormat,

pub whitelisted_ips: Vec<String>,
pub max_subsidy_usd_cents: u64,
pub subsidy_tx_cost_usd_cents: u64,
pub subsidy_type: String,
}

impl MiscConfig {
Expand All @@ -60,6 +65,10 @@ mod tests {
"27593fea79697e947890ecbecce7901b0008345e5d7259710d0dd5e500d040be",
),
log_format: LogFormat::Json,
whitelisted_ips: vec![],
max_subsidy_usd_cents: 1000000,
subsidy_tx_cost_usd_cents: 100,
subsidy_type: "PartnerName".to_owned(),
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS subsidies;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE subsidies (
serial_id BIGINT NOT NULL,
tx_hash bytea NOT NULL,
usd_amount NUMERIC NOT NULL,
full_cost_usd NUMERIC NOT NULL,
token_id INT NOT NULL,
token_amount NUMERIC NULL,
full_cost_token NUMERIC NULL,
subsidy_type VARCHAR NOT NULL
);
11 changes: 11 additions & 0 deletions etc/env/base/misc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ security_council_members_number=3
security_council_members=["0x22C3F9177F485bF9a058cE4C7253Da81a59495Db","0x56dF84566a67e87808A73dA0Be61a40bda3e2AFA","0xCE004d039cD86b08274FC453bd5536E6e9F6Fac7"]

security_council_threshold=2

# Whitelisted IPs for subsisdies
whitelisted_ips=myip

# Please note, that both values are in cents, i.e. the 100 denotes $1
subsidy_tx_cost_usd_cents=100
max_subsidy_usd_cents=2500000

# The type of the currently applied subsidy
# At this moment, the server can support only one type of subsidy at a time
subsidy_type=PartnerName

0 comments on commit a8f8339

Please sign in to comment.