Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/deploy_contract/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Deploy Contract'
description: 'Deploy contract with Hardhat'

inputs:
network:
description: 'The network to deploy the contract on'
required: true
stage:
description: 'The stage for deployment'
required: true
task:
description: 'The task to execute'
required: true

runs:
using: 'composite'
steps:
- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash
- name: Compile contract
run: yarn compile
shell: bash
- name: Deploy contract
run: npx hardhat deploy --network ${{ inputs.network }} --stage ${{ inputs.stage }} --task '${{ inputs.task }}'
shell: bash
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@position.exchange"
git add -A
git commit -m "Update contract deployment artifacts [ci/cd]"
git push
shell: bash


54 changes: 54 additions & 0 deletions .github/workflows/deploy_arb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Futures Adapter to Arbitrum Goerli

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Deploy Futures Adapter
uses: ./.github/actions/deploy_contract
with:
network: arbitrumGoerli
stage: arbitrumGoerli
task: 'deploy futures adapter'
env:
PRIV_TESTNET_ACCOUNT: ${{ secrets.PRIV_TESTNET_ACCOUNT }}
BSC_TESTNET_URL: ${{ secrets.BSC_TESTNET_URL }}
PRIV_MAINNET_ACCOUNT: ${{ secrets.PRIV_MAINNET_ACCOUNT }}
DEFENDER_TEAM_API_KEY: ${{ secrets.DEFENDER_TEAM_API_KEY }}
DEFENDER_TEAM_API_SECRET_KEY: ${{ secrets.DEFENDER_TEAM_API_SECRET_KEY }}
ARB_API_KEY: ${{ secrets.ARB_API_KEY }}
- name: Deploy dptp futures gateway
uses: ./.github/actions/deploy_contract
with:
network: arbitrumGoerli
stage: arbitrumGoerli
task: 'deploy dptp futures gateway'
env:
PRIV_TESTNET_ACCOUNT: ${{ secrets.PRIV_TESTNET_ACCOUNT }}
BSC_TESTNET_URL: ${{ secrets.BSC_TESTNET_URL }}
PRIV_MAINNET_ACCOUNT: ${{ secrets.PRIV_MAINNET_ACCOUNT }}
DEFENDER_TEAM_API_KEY: ${{ secrets.DEFENDER_TEAM_API_KEY }}
DEFENDER_TEAM_API_SECRET_KEY: ${{ secrets.DEFENDER_TEAM_API_SECRET_KEY }}
ARB_API_KEY: ${{ secrets.ARB_API_KEY }}



# Add more migration

3 changes: 2 additions & 1 deletion contracts/protocol/DptpFuturesGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,8 @@ contract DptpFuturesGateway is
pscCrossChainGateway,
uint8(Method.EXECUTE_STORE_POSITION),
abi.encode(
_requestKey
_requestKey,
uint8(0)
)
);
}
Expand Down