Skip to content

Commit

Permalink
fix: deploy script ic
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Dec 4, 2024
1 parent 7966ffe commit 4fe8a56
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 80 deletions.
21 changes: 1 addition & 20 deletions canister_ids.json
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
{
"deferred": {
"ic": "v5vof-zqaaa-aaaal-ai5cq-cai"
},
"ekoke-erc20-swap": {
"ic": "un25n-wyaaa-aaaal-ams5a-cai"
},
"ekoke-erc20-swap-frontend": {
"ic": "uk33z-3aaaa-aaaal-ams5q-cai"
},
"ekoke-liquidity-pool": {
"ic": "v2uir-uiaaa-aaaal-ai5ca-cai"
},
"ekoke-reward-pool": {
"ic": "vtxdn-caaaa-aaaal-ai5dq-cai"
},
"marketplace": {
"ic": "vuwfz-pyaaa-aaaal-ai5da-cai"
}
}
{}
86 changes: 26 additions & 60 deletions scripts/deploy_ic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ source ./deploy_functions.sh
source ./did.sh

ADMIN_PRINCIPAL="$(dfx identity get-principal)"
ERC20_BRIDGE_ADDRESS="0xc08e14F47382BCc1dA6c3Ff366018cAb1c77091F"
ERC20_SWAP_FEE="231634000000000"
ERC20_NETWORK="Ethereum"
CHAIN_ID=1
DEFERRED_ERC721="0x"
REWARD_POOL="0x"
EVM_RPC_PRINCIPAL="7hfb6-caaaa-aaaar-qadga-cai"
ECDSA_KEY="Production"

FALLBACK_CANISTER="$ADMIN_PRINCIPAL"

CANISTER="$1"

if [ -z "$CANISTER" ]; then
echo "Please provide the canister name as an argument"
echo "Available canisters:"
echo "- deferred"
echo "- ekoke-erc20-swap"
echo "- ekoke-erc20-swap-frontend"
echo "- ekoke-icrc"
echo "- ekoke-liquidity-pool"
echo "- ekoke-reward-pool"
echo "- marketplace"
echo "- deferred_data"
echo "- deferred_minter"
exit 1
fi

Expand All @@ -33,64 +31,32 @@ cd ../

case "$CANISTER" in

"deferred")
EKOKE_REWARD_POOL_PRINCIPAL=$(get_arg "ekoke-reward-pool" "$FALLBACK_CANISTER")
MARKETPLACE_PRINCIPAL=$(get_arg "marketplace" "$FALLBACK_CANISTER")
EKOKE_LIQUIDITY_POOL_PRINCIPAL=$(get_arg "ekoke-liquidity-pool" "$FALLBACK_CANISTER")
deploy_deferred "reinstall" "ic" "$EKOKE_REWARD_POOL_PRINCIPAL" "$MARKETPLACE_PRINCIPAL" "$EKOKE_LIQUIDITY_POOL_PRINCIPAL" "$ADMIN_PRINCIPAL"
;;

"ekoke-erc20-swap")
EKOKE_LEDGER_PRINCIPAL=$(get_arg "ekoke-ledger" "$FALLBACK_CANISTER")
deploy_ekoke_erc20_swap "reinstall" "ic" "$EKOKE_ERC20_SWAP_PRINCIPAL" "$ADMIN_PRINCIPAL" "$EKOKE_LEDGER_PRINCIPAL" "$ERC20_BRIDGE_ADDRESS" "$ERC20_SWAP_FEE" "$ERC20_NETWORK"
;;

"ekoke-erc20-swap-frontend")
deploy_ekoke_erc20_swap_frontend "reinstall" "ic"
;;

"ekoke-icrc")
echo "Creating ekoke-icrc canister"
"deferred_data")
DEFERRED_MINTER=$(get_arg "deferred-minter" "$FALLBACK_CANISTER")

dfx canister create --ic ekoke-icrc-ledger
EKOKE_LEDGER_PRINCIPAL="$(dfx canister id --ic ekoke-icrc-ledger)"
echo "Created ekoke-icrc-ledger canister with principal $EKOKE_LEDGER_PRINCIPAL"\

deploy_ekoke_icrc_index "reinstall" "ic" "$EKOKE_LEDGER_PRINCIPAL"
EKOKE_INDEX_PRINCIPAL="$(dfx canister id --ic ekoke-icrc-index)"
echo "Deployed ekoke-icrc-index canister with principal $EKOKE_INDEX_PRINCIPAL"

deploy_ekoke_icrc_ledger "reinstall" "ic" "$EKOKE_INDEX_PRINCIPAL" "$ADMIN_PRINCIPAL"
echo "Deployed ekoke-icrc-ledger canister with principal $EKOKE_LEDGER_PRINCIPAL"
deploy_deferred_data "reinstall" "ic" "$DEFERRED_MINTER"
;;

"ekoke-liquidity-pool")
DEFERRED_PRINCIPAL=$(get_arg "deferred" "$FALLBACK_CANISTER")
deploy_ekoke_liquidity_pool "reinstall" "ic" "$EKOKE_LIQUIDITY_POOL_PRINCIPAL" "$DEFERRED_PRINCIPAL" "$ADMIN_PRINCIPAL"
;;

"ekoke-reward-pool")
EKOKE_LEDGER_PRINCIPAL=$(get_arg "ekoke-ledger" "$FALLBACK_CANISTER")
DEFERRED_PRINCIPAL=$(get_arg "deferred" "$FALLBACK_CANISTER")
MARKETPLACE_PRINCIPAL=$(get_arg "marketplace" "$FALLBACK_CANISTER")
deploy_ekoke_reward_pool "reinstall" "ic" "$EKOKE_REWARD_POOL_PRINCIPAL" "$ADMIN_PRINCIPAL" "$EKOKE_LEDGER_PRINCIPAL" "$DEFERRED_PRINCIPAL" "$MARKETPLACE_PRINCIPAL"
;;

"marketplace")
DEFERRED_PRINCIPAL=$(get_arg "deferred" "$FALLBACK_CANISTER")
EKOKE_REWARD_POOL_PRINCIPAL=$(get_arg "ekoke-reward-pool" "$FALLBACK_CANISTER")
EKOKE_LIQUIDITY_POOL_PRINCIPAL=$(get_arg "ekoke-liquidity-pool" "$FALLBACK_CANISTER")
deploy_marketplace "reinstall" "ic" "$MARKETPLACE_PRINCIPAL" "$DEFERRED_PRINCIPAL" "$EKOKE_REWARD_POOL_PRINCIPAL" "$ADMIN_PRINCIPAL" "$EKOKE_LIQUIDITY_POOL_PRINCIPAL"
"deferred_minter")
DEFERRED_DATA=$(get_arg "deferred-data" "$FALLBACK_CANISTER")

deploy_deferred_minter \
"reinstall" \
"ic" \
"$CHAIN_ID" \
"$DEFERRED_ERC721" \
"$ECDSA_KEY" \
"$DEFERRED_DATA" \
"$ADMIN_PRINCIPAL" \
"$EVM_RPC_PRINCIPAL" \
"$REWARD_POOL"
;;

*)
echo "Invalid canister name"
echo "Available canisters:"
echo "- deferred"
echo "- ekoke-erc20-swap"
echo "- ekoke-liquidity-pool"
echo "- ekoke-reward-pool"
echo "- marketplace"
echo "- deferred_data"
echo "- deferred_minter"
exit 1
;;

Expand Down

0 comments on commit 4fe8a56

Please sign in to comment.