Skip to content

CronJob - World Sepolia #2754

CronJob - World Sepolia

CronJob - World Sepolia #2754

name: CronJob - World Sepolia
on:
schedule:
- cron: "30 */1 * * *" # ie. 6:30am, 7:00pm, 7:30pm, etc.
push:
env:
CHAIN_ID: 4801
PRIZE_POOL_ADDRESS: "0xde1d61d479dfc0ba86ec64fd29a636993d625ce4"
OUTPUT_DIRECTORY_NAME: "winners/vaultAccounts"
CLI_VERSION: "2.0.6"
JSON_RPC_URL: ${{ secrets.WORLD_SEPOLIA_RPC_URL }}
CONTRACT_JSON_URL: 'https://raw.githubusercontent.com/GenerationSoftware/pt-v5-testnet/82c266dc50264117bc82d48dacfff1172df2197b/deployments/worldSepolia/contracts.json'
SUBGRAPH_URL: 'https://subgraph.satsuma-prod.com/632659a063b5/charless-team--719469/pt-v5-world-sepolia/api'
REMOTE_STATUS_URL: 'https://raw.githubusercontent.com/GenerationSoftware/pt-v5-winners/refs/heads/main/winners/vaultAccounts'
MULTICALL_ADDRESS: '0xca11bde05977b3631167028862be2a173976ca11'
NODE_OPTIONS: "--max_old_space_size=32768"
permissions: write-all
jobs:
runCLI:
name: Winners Compute
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
node: ["20.11.1"]
os: [ubuntu-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# -------------------------------------------------------- #
# World Sepolia
# -------------------------------------------------------- #
# 1. Install
- name: Install PoolTogether V5 CLI
run: |
npm install -g @generationsoftware/pt-v5-cli@${{ env.CLI_VERSION }}
echo "$(npm -g bin)" >> $GITHUB_PATH
# 2. Find depositors, winners, and output them for each vault to JSON files
- name: World Sepolia - Compile Winners
id: compileWinnersWorldSepolia
uses: chuckbergeron/executable-wrapper@e19cd743c8f0c6af006f6a25bd6715c770569d72
continue-on-error: true
with:
run_command: ptv5 utils compileWinners -o ./${{ env.OUTPUT_DIRECTORY_NAME }} -p ${{ env.PRIZE_POOL_ADDRESS }} -c ${{ env.CHAIN_ID }} -j ${{ env.CONTRACT_JSON_URL }} -s ${{ env.SUBGRAPH_URL }} -r ${{ env.REMOTE_STATUS_URL }} -m ${{ env.MULTICALL_ADDRESS }}
# 3. Commit
- name: Commit World Sepolia
if: steps.compileWinnersWorldSepolia.outputs.runStatus == 'true'
continue-on-error: true
run: |
git config pull.rebase false
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
ls
git add ./${{ env.OUTPUT_DIRECTORY_NAME }}
git commit -m "Add testnet winner results for World Sepolia draw #${{ steps.compileWinnersWorldSepolia.outputs.drawId }}"
# 4. Push
- name: Push changes (if required)
uses: ad-m/github-push-action@master
if: steps.compileWinnersWorldSepolia.outputs.runStatus == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
force: true