From 624857c0557e401ef90d1ae8a2ac52aa3e431cd1 Mon Sep 17 00:00:00 2001 From: Leonard Paturel Date: Fri, 28 Jun 2024 15:44:35 +0100 Subject: [PATCH 1/3] deployment --- Scarb.toml | 3 ++- deployments.txt | 5 +++++ scripts/deploy.ts | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 deployments.txt create mode 100644 scripts/deploy.ts diff --git a/Scarb.toml b/Scarb.toml index d10d58d..f957cbd 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -24,4 +24,5 @@ start-devnet = "docker build -t devnet . && docker run -d -p 127.0.0.1:5050:5050 kill-devnet = "docker ps -q --filter 'ancestor=devnet' | xargs docker stop" test-ts = "scarb --profile release build && yarn tsc && yarn mocha tests-integration/*.test.ts" profile = "scarb --profile release build && node --loader ts-node/esm scripts/profile.ts" -format = "scarb fmt && yarn prettier --write ." \ No newline at end of file +format = "scarb fmt && yarn prettier --write ." +deploy = "scarb --profile release build && node --loader ts-node/esm scripts/deploy.ts" diff --git a/deployments.txt b/deployments.txt new file mode 100644 index 0000000..7072db0 --- /dev/null +++ b/deployments.txt @@ -0,0 +1,5 @@ + +# Sepolia Deployment +GiftFactory address: 0x33ef0f42296853cd65c0e972576604e3c7c43f0a66952e7eaa6d3932bfa2d35 +EscrowAccount class hash: 0x4e2ac27f56cf97077cf43788c831acdc8734e447a5ec676e93101b9dd22eace +EscrowLibrary class hash: 0x4ee1fc3650c515e0c30705c326dbda34a07ebe32bddf39be43b5110dd4ead16 diff --git a/scripts/deploy.ts b/scripts/deploy.ts new file mode 100644 index 0000000..85838a7 --- /dev/null +++ b/scripts/deploy.ts @@ -0,0 +1,12 @@ +import { protocolCache, setupGiftProtocol } from "../lib"; + +const { factory, escrowAccountClassHash, escrowLibraryClassHash } = await setupGiftProtocol(); + +console.log("GiftFactory address:", factory.address); +console.log("EscrowAccount class hash:", escrowAccountClassHash); +console.log("EscrowLibrary class hash:", escrowLibraryClassHash); + +// clear from cache just in case +delete protocolCache["GiftFactory"]; +delete protocolCache["EscrowLibrary"]; +delete protocolCache["EscrowAccount"]; From dd519e89ec4019cb46a5ee27a52fd5c14c78a748 Mon Sep 17 00:00:00 2001 From: Leonard Paturel Date: Fri, 28 Jun 2024 15:53:15 +0100 Subject: [PATCH 2/3] deployed with shared account --- deployments.txt | 5 ++++- scripts/deploy.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deployments.txt b/deployments.txt index 7072db0..6876c60 100644 --- a/deployments.txt +++ b/deployments.txt @@ -1,5 +1,8 @@ # Sepolia Deployment -GiftFactory address: 0x33ef0f42296853cd65c0e972576604e3c7c43f0a66952e7eaa6d3932bfa2d35 + +GiftFactory classhash: 0x6240992fd28e14bf2757a2b7320831220ffa7816cf962403b13f94aec95d7da +GiftFactory address: 0x7e0f5a5364e197200461a18d695082848b3d4d1e90d3349492263f4c913ae3c +GiftFactory owner: 0x6b054e8dbc5756e3f43b70cf1bfa4639c560898a3c70b2f753ba53bef549a1c EscrowAccount class hash: 0x4e2ac27f56cf97077cf43788c831acdc8734e447a5ec676e93101b9dd22eace EscrowLibrary class hash: 0x4ee1fc3650c515e0c30705c326dbda34a07ebe32bddf39be43b5110dd4ead16 diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 85838a7..546e776 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -1,8 +1,11 @@ -import { protocolCache, setupGiftProtocol } from "../lib"; +import { num } from "starknet"; +import { manager, protocolCache, setupGiftProtocol } from "../lib"; const { factory, escrowAccountClassHash, escrowLibraryClassHash } = await setupGiftProtocol(); +console.log("GiftFactory classhash:", await manager.getClassHashAt(factory.address)); console.log("GiftFactory address:", factory.address); +console.log("GiftFactory owner:", num.toHex(await factory.owner())); console.log("EscrowAccount class hash:", escrowAccountClassHash); console.log("EscrowLibrary class hash:", escrowLibraryClassHash); From 1594ca4df5988fb37355fd9e561afd4c7196242c Mon Sep 17 00:00:00 2001 From: Leonard Paturel Date: Mon, 1 Jul 2024 10:28:35 +0100 Subject: [PATCH 3/3] remove owner --- deployments.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/deployments.txt b/deployments.txt index 6876c60..efb1ca0 100644 --- a/deployments.txt +++ b/deployments.txt @@ -3,6 +3,5 @@ GiftFactory classhash: 0x6240992fd28e14bf2757a2b7320831220ffa7816cf962403b13f94aec95d7da GiftFactory address: 0x7e0f5a5364e197200461a18d695082848b3d4d1e90d3349492263f4c913ae3c -GiftFactory owner: 0x6b054e8dbc5756e3f43b70cf1bfa4639c560898a3c70b2f753ba53bef549a1c EscrowAccount class hash: 0x4e2ac27f56cf97077cf43788c831acdc8734e447a5ec676e93101b9dd22eace EscrowLibrary class hash: 0x4ee1fc3650c515e0c30705c326dbda34a07ebe32bddf39be43b5110dd4ead16