diff --git a/.github/workflows/arkproject-deploy-contracts-sepolia.yml b/.github/workflows/arkproject-deploy-contracts-sepolia.yml new file mode 100644 index 000000000..8db6c63e4 --- /dev/null +++ b/.github/workflows/arkproject-deploy-contracts-sepolia.yml @@ -0,0 +1,100 @@ +name: ArkProject Deploy Contracts & Solis Mainnet + +on: workflow_dispatch + +jobs: + deploy-starknet: + runs-on: ubuntu-latest + name: Build & Deploy starknet contracts + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "18" + + - name: Setup Scarb + uses: software-mansion/setup-scarb@v1 + with: + scarb-version: 2.5.4 + + - name: Build contracts + run: | + cd contracts + scarb build --workspace + - name: Install pnpm & dependencies + run: | + npm install -g pnpm + pnpm install + - name: Deploy orderbook contracts + env: + STARKNET_NODE_URL_SEPOLIA: ${{ secrets.STARKNET_NODE_URL_SEPOLIA }} + SOLIS_NODE_URL_SEPOLIA: ${{ secrets.SOLIS_NODE_URL_SEPOLIA }} + STARKNET_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_ADMIN_ADDRESS_SEPOLIA }} + STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA }} + STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA }} + STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA }} + STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA }} + STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA }} + run: | + pnpm run deploy:starknet -- --starknet sepolia + # deploy-orderbook: + # needs: deploy-starknet + # runs-on: ubuntu-latest + # name: Build & Deploy orderbook contract + # steps: + # - name: Checkout repository + # uses: actions/checkout@v2 + + # - name: Set up Node.js + # uses: actions/setup-node@v2 + # with: + # node-version: "20" + + # - name: Setup Scarb + # uses: software-mansion/setup-scarb@v1 + # with: + # scarb-version: 2.5.4 + + # - name: Build contracts + # run: | + # cd contracts + # scarb build --workspace + + # - name: Install pnpm & dependencies + # run: | + # npm install -g pnpm + # pnpm install + + # - name: Deploy orderbook contracts + # env: + # STARKNET_NODE_URL_SEPOLIA: ${{ secrets.STARKNET_NODE_URL_SEPOLIA }} + # SOLIS_NODE_URL_SEPOLIA: ${{ secrets.SOLIS_NODE_URL_SEPOLIA }} + # STARKNET_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_ADMIN_ADDRESS_SEPOLIA }} + # STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA }} + # STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA }} + # STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA }} + # STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA }} + # STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA: ${{ secrets.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA }} + # SOLIS_ADMIN_ADDRESS_SEPOLIA: ${{ secrets.SOLIS_ADMIN_ADDRESS_SEPOLIA }} + # SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA: ${{ secrets.SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA }} + # SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA: ${{ secrets.SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA }} + # RPC_USER: ${{ secrets.RPC_USER }} + # RPC_PASSWORD: ${{ secrets.RPC_PASSWORD }} + # run: | + # pnpm run deploy:solis -- --solis sepolia --starknet sepolia + # - name: Commit and Push Generated contract file + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # git config --global user.email "account@screenshot.co" + # git config --global user.name "Solis Bot" + # git add contracts.json + # if ! git diff --cached --quiet; then + # git commit -m "feat: update contracts.json for sepolia deployment" + # git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }} + # else + # echo "No changes to commit" + # fi diff --git a/packages/deployer/src/accounts/new.ts b/packages/deployer/src/accounts/new.ts index f68152e05..12ced6b3b 100644 --- a/packages/deployer/src/accounts/new.ts +++ b/packages/deployer/src/accounts/new.ts @@ -62,7 +62,7 @@ export async function createNewAccounts( const program = new Command(); program - .option("-n, --network ", "Network to use", "goerli") + .option("-n, --network ", "Network to use", "sepolia") .option("-a, --accounts ", "Number of accounts to create", "1"); program.parse(process.argv); diff --git a/packages/deployer/src/providers.ts b/packages/deployer/src/providers.ts index fc1186a53..4015ad1a4 100644 --- a/packages/deployer/src/providers.ts +++ b/packages/deployer/src/providers.ts @@ -10,7 +10,7 @@ export function getStarknetProvider(starknetNetwork: string) { starknetNodeUrl = process.env.STARKNET_NODE_URL_MAINNET || ""; break; case "sepolia": - starknetNodeUrl = process.env.STARKNET_NODE_URL_GOERLI || ""; + starknetNodeUrl = process.env.STARKNET_NODE_URL_SEPOLIA || ""; break; default: throw new Error(`Unsupported starknetNetwork: ${starknetNetwork}`); @@ -32,7 +32,7 @@ export function getSolisProvider(solisNetwork?: string) { solisNodeUrl = process.env.SOLIS_NODE_URL_MAINNET || ""; break; case "sepolia": - solisNodeUrl = process.env.SOLIS_NODE_URL_GOERLI || ""; + solisNodeUrl = process.env.SOLIS_NODE_URL_SEPOLIA || ""; break; default: throw new Error(`Unsupported solisNetwork: ${solisNetwork}`); diff --git a/packages/deployer/src/utils/solisAccounts.ts b/packages/deployer/src/utils/solisAccounts.ts index cf893dadc..cb040a2c1 100644 --- a/packages/deployer/src/utils/solisAccounts.ts +++ b/packages/deployer/src/utils/solisAccounts.ts @@ -14,9 +14,9 @@ export function getSolisAccounts(solisNetwork: ProviderNetwork) { publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_DEV || "" }, { - address: process.env.SOLIS_ADMIN_ADDRESS_GOERLI || "", - privateKey: process.env.SOLIS_ADMIN_PRIVATE_KEY_GOERLI || "", - publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_GOERLI || "" + address: process.env.SOLIS_ADMIN_ADDRESS_SEPOLIA || "", + privateKey: process.env.SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA || "", + publicKey: process.env.SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA || "" }, { address: process.env.SOLIS_ADMIN_ADDRESS_MAINNET || "", diff --git a/packages/deployer/src/utils/starknetAccounts.ts b/packages/deployer/src/utils/starknetAccounts.ts index 311328f50..54269a4d0 100644 --- a/packages/deployer/src/utils/starknetAccounts.ts +++ b/packages/deployer/src/utils/starknetAccounts.ts @@ -14,9 +14,9 @@ export function getStarknetAccounts(starknetNetwork: ProviderNetwork) { publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_DEV || "" }, { - address: process.env.STARKNET_ADMIN_ADDRESS_GOERLI || "", - privateKey: process.env.STARKNET_ADMIN_PRIVATE_KEY_GOERLI || "", - publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_GOERLI || "" + address: process.env.STARKNET_ADMIN_ADDRESS_SEPOLIA || "", + privateKey: process.env.STARKNET_ADMIN_PRIVATE_KEY_SEPOLIA || "", + publicKey: process.env.STARKNET_ADMIN_PUBLIC_KEY_SEPOLIA || "" }, { address: process.env.STARKNET_ADMIN_ADDRESS_MAINNET || "", @@ -32,9 +32,9 @@ export function getStarknetAccounts(starknetNetwork: ProviderNetwork) { publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_DEV || "" }, { - address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_GOERLI || "", - privateKey: process.env.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_GOERLI || "", - publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_GOERLI || "" + address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_SEPOLIA || "", + privateKey: process.env.STARKNET_SOLIS_ACCOUNT_PRIVATE_KEY_SEPOLIA || "", + publicKey: process.env.STARKNET_SOLIS_ACCOUNT_PUBLIC_KEY_SEPOLIA || "" }, { address: process.env.STARKNET_SOLIS_ACCOUNT_ADDRESS_MAINNET || "", diff --git a/turbo.json b/turbo.json index b7dba7aa3..b471cab1f 100644 --- a/turbo.json +++ b/turbo.json @@ -100,6 +100,12 @@ "STARKNET_NETWORK", "STARKNET_NETWORK_ID", "STARKNET_NFT_ADDRESS_DEV", - "STARKNET_RPC_URL" + "STARKNET_RPC_URL", + "SOLIS_ADMIN_PUBLIC_KEY_DEV", + "SOLIS_ADMIN_ADDRESS_SEPOLIA", + "SOLIS_ADMIN_PRIVATE_KEY_SEPOLIA", + "SOLIS_ADMIN_PUBLIC_KEY_SEPOLIA", + "SOLIS_ADMIN_PUBLIC_KEY_MAINNET", + "SOLIS_NODE_URL_SEPOLIA" ] }