Skip to content

Commit

Permalink
[Ignition]: Split protocol reserves to volatile and non-volatile.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOmarA committed Jan 21, 2024
1 parent c15c98f commit 6e501b5
Show file tree
Hide file tree
Showing 10 changed files with 523 additions and 36 deletions.
17 changes: 17 additions & 0 deletions .vscode/rust.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Scrypto TestEnvironment Test": {
"prefix": ["ig-test"],
"body": [
"#[test]",
"fn ${0:test_name}() -> Result<(), RuntimeError> {",
"\t//Arrange",
"\tlet Environment { environment: ref mut env, protocol, resources, ociswap, caviarnine } = Environment::new()?;",
"\t//Act",
"\t//Assert",
"",
"\tOk(())",
"}"
],
"description": "The boilderplate code of a simple ignition test."
}
}
2 changes: 2 additions & 0 deletions libraries/package-loader/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ fn build_blueprints() -> Result<(), Error> {
create_dir(&builds_target_path)?;
}

println!("cargo:rerun-if-changed={}", packages_path.display());

// Getting the name of all of the blueprints found in the packages directory
let package_names = read_dir(packages_path)?
.filter_map(Result::ok)
Expand Down
18 changes: 13 additions & 5 deletions packages/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use caviarnine_adapter_v1::*;
use ignition::ignition::*;
use ignition::Volatility;
use ignition::{LiquidityReceipt, LockupPeriod, PoolBlueprintInformation};
use scrypto::prelude::*;

Expand Down Expand Up @@ -203,11 +204,18 @@ mod bootstrap {

// Fund ignition with the protocol resources that it needs to
// start lending out to users.
let protocol_resources_bucket =
protocol_resource.mint(dec!(100_000_000_000_000));
ignition.deposit_resources(FungibleBucket(
protocol_resources_bucket,
));
ignition.deposit_protocol_resources(
FungibleBucket(
protocol_resource.mint(dec!(100_000_000_000_000)),
),
Volatility::Volatile,
);
ignition.deposit_protocol_resources(
FungibleBucket(
protocol_resource.mint(dec!(100_000_000_000_000)),
),
Volatility::NonVolatile,
);

// Add the reward rates that Ignition will use.
for (lockup_period, reward) in reward_rates.iter() {
Expand Down
Loading

0 comments on commit 6e501b5

Please sign in to comment.