diff --git a/contracts/fee-distributor/README.md b/contracts/fee-distributor/README.md index 3d8e50d..ff28fcb 100644 --- a/contracts/fee-distributor/README.md +++ b/contracts/fee-distributor/README.md @@ -13,7 +13,7 @@ The fee distributor contract supports `Claim`, `DistributeGlow`, and `Sweep` fun ### DistributeGlow -Distribute glow can be called to distribute all available glow in the gov contract to veGlow holders. Available glow means the Glow balance of the gov contract minus the amount reserved for polls and reserved for past glow distributions. +Distribute glow can be called to distribute all available glow in the fee distributor contract to veGlow holders. Available glow means the Glow balance of the fee distributor contract minus the amount reserved for past glow distributions. Glow distribution works by making use of the `WEEKLY_TOKEN_DISTRIBUTION` map. diff --git a/contracts/fee-distributor/src/contract.rs b/contracts/fee-distributor/src/contract.rs index 9d67688..062abe4 100644 --- a/contracts/fee-distributor/src/contract.rs +++ b/contracts/fee-distributor/src/contract.rs @@ -32,7 +32,7 @@ pub const DEFAULT_CLAIM_LIMIT: u32 = 20; #[cfg_attr(not(feature = "library"), entry_point)] pub fn instantiate( deps: DepsMut, - env: Env, + _env: Env, info: MessageInfo, _msg: InstantiateMsg, ) -> Result { @@ -44,7 +44,6 @@ pub fn instantiate( }; let state = State { - contract_addr: env.contract.address, total_distributed_unclaimed_fees: Uint128::zero(), }; @@ -102,12 +101,9 @@ pub fn distribute_glow(deps: DepsMut, env: Env) -> Result Result { match msg { QueryMsg::Config {} => Ok(to_binary(&query_config(deps)?)?), - QueryMsg::State {} => Ok(to_binary(&query_state(deps)?)?), + QueryMsg::State {} => Ok(to_binary(&query_state(deps, env)?)?), QueryMsg::Staker { address, fee_limit, @@ -332,10 +328,10 @@ fn query_config(deps: Deps) -> Result { }) } -fn query_state(deps: Deps) -> Result { +fn query_state(deps: Deps, env: Env) -> Result { let state = STATE.load(deps.storage)?; Ok(StateResponse { - contract_addr: state.contract_addr.to_string(), + contract_addr: env.contract.address.to_string(), total_distributed_unclaimed_fees: state.total_distributed_unclaimed_fees, }) } diff --git a/contracts/fee-distributor/src/state.rs b/contracts/fee-distributor/src/state.rs index 44c9418..87b4d2f 100644 --- a/contracts/fee-distributor/src/state.rs +++ b/contracts/fee-distributor/src/state.rs @@ -20,6 +20,5 @@ pub struct Config { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct State { - pub contract_addr: Addr, pub total_distributed_unclaimed_fees: Uint128, } diff --git a/contracts/fee-distributor/src/tests.rs b/contracts/fee-distributor/src/tests.rs index 78d2462..e7cb1e8 100644 --- a/contracts/fee-distributor/src/tests.rs +++ b/contracts/fee-distributor/src/tests.rs @@ -90,7 +90,6 @@ fn proper_initialization() { assert_eq!( state, State { - contract_addr: deps.api.addr_validate(MOCK_CONTRACT_ADDR).unwrap(), total_distributed_unclaimed_fees: Uint128::zero(), } );