Skip to content

Commit

Permalink
add token supply init param
Browse files Browse the repository at this point in the history
  • Loading branch information
psorinionut committed Dec 14, 2022
1 parent 5ad0d52 commit 09ac7eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ where
max_apr,
UNBOND_EPOCHS,
0,
managed_biguint!(0),
ManagedAddress::<DebugApi>::zero(),
MultiValueEncoded::new(),
);
Expand Down
5 changes: 5 additions & 0 deletions farm-staking/farm-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub trait FarmStaking:
max_apr: BigUint,
min_unbond_epochs: u64,
upgrade_block: Nonce,
new_farm_supply: BigUint,
owner: ManagedAddress,
admins: MultiValueEncoded<ManagedAddress>,
) {
Expand Down Expand Up @@ -89,6 +90,10 @@ pub trait FarmStaking:
});
self.reward_reserve()
.update(|r| *r += accumulated_rewards_before);

if new_farm_supply > 0 {
self.farm_token_supply().set(new_farm_supply);
}
}

#[payable("*")]
Expand Down
1 change: 1 addition & 0 deletions farm-staking/farm-staking/tests/farm_staking_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ where
managed_biguint!(MAX_APR),
MIN_UNBOND_EPOCHS,
0,
managed_biguint!(0),
ManagedAddress::<DebugApi>::zero(),
MultiValueEncoded::new(),
);
Expand Down

0 comments on commit 09ac7eb

Please sign in to comment.