Skip to content

Commit

Permalink
added protocol 22
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinsoza committed Dec 4, 2024
1 parent 5f8c51f commit 37fac29
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
5 changes: 5 additions & 0 deletions apps/contracts/src/strategies/deploy_blend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import {
import { config } from "../utils/env_config.js";

export async function deployBlendStrategy(addressBook: AddressBook) {
if (network == "standalone") {
console.log("Blend Strategy can only be tested in testnet or mainnet");
console.log("Since it requires Blend protocol to be deployed");
return;
};
if (network != "mainnet") await airdropAccount(loadedConfig.admin);
let account = await loadedConfig.horizonRpc.loadAccount(
loadedConfig.admin.publicKey()
Expand Down
8 changes: 7 additions & 1 deletion apps/contracts/src/strategies/deploy_fixed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import {
import { config } from "../utils/env_config.js";

export async function deployFixedAPRStrategy(addressBook: AddressBook) {
if (network == "standalone") {
console.log("Fixed Strategy can only be tested in testnet or mainnet");
console.log("Since it requires a custom token, we are currently using soroswap USDC");
console.log("TODO: Create our own token for standalone testing");
return;
};
if (network != "mainnet") await airdropAccount(loadedConfig.admin);
let account = await loadedConfig.horizonRpc.loadAccount(
loadedConfig.admin.publicKey()
Expand Down Expand Up @@ -48,7 +54,7 @@ export async function deployFixedAPRStrategy(addressBook: AddressBook) {

const soroswapUsdc = "CAAFIHB4I7WQMJMKC22CZVQNNX7EONWSOMT6SUXK6I3G3F6J4XFRWNDI"
const soroswapScVal = new Address(soroswapUsdc).toScVal();

const initialAmount = 100_000_000_0_000_000;

// Mint to the admin the initailAmount
Expand Down
10 changes: 8 additions & 2 deletions apps/contracts/src/tests/testOnlyVault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { randomBytes } from "crypto";
import { AddressBook } from "../utils/address_book.js";
import { airdropAccount, invokeContract, invokeCustomContract } from "../utils/contract.js";
import { config } from "../utils/env_config.js";
import { depositToVault} from "./vault.js";
import { checkUserBalance } from "./strategy.js";
import { depositToVault } from "./vault.js";

const soroswapUSDC = new Address("CAAFIHB4I7WQMJMKC22CZVQNNX7EONWSOMT6SUXK6I3G3F6J4XFRWNDI");

Expand Down Expand Up @@ -111,6 +110,13 @@ export async function deployVault(addressBook: AddressBook) {
console.log('🚀 « DeFindex Vault created with address:', scValToNative(result.returnValue));
return scValToNative(result.returnValue);
}
if (network == "standalone") {
console.log("This can only be tested in testnet or mainnet");
console.log("Since it requires a custom token, we are currently using soroswap USDC");
console.log("TODO: Create our own token for standalone testing");
process.exit();
};

const testUser = Keypair.random();
if (network !== "mainnet") await airdropAccount(testUser);
const initialAmount = 10000_0_000_000;
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
defindex-soroban:
image: esteblock/soroban-preview:21.0.0_node_20@sha256:d8546f6a3bf75b9fa4a481af6be872e3e69f59896948c537912f2bb0df3cd0d9
image: esteblock/soroban-preview:22.0.1
container_name: defindex-soroban
volumes:
- .:/workspace
Expand All @@ -14,13 +14,13 @@ services:
- "3050:3050"

stellar:
image: stellar/quickstart:v426-latest-amd64@sha256:274395daab6fa8033b9213f152d56699358917fb01d7c7e95392a37fc00c9d01
image: stellar/quickstart
container_name: stellar
networks:
- defindex-network
ports:
- "8000:8000"
command: --local --enable-soroban-rpc --enable-soroban-diagnostic-events
command: --local --protocol-version 22
stdin_open: true
tty: true

Expand Down

0 comments on commit 37fac29

Please sign in to comment.