Extend Staking #200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Extend Staking | |
| on: | |
| schedule: | |
| # The cron job should run every four weeks from the creation of four year vesting contract | |
| # and only for 52 weeks | |
| - cron: "30 10 * * FRI" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Setup node.js | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: "14.x" | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| # npm cache files are stored in `~/.npm` on Linux/macOS | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Cache compiler installations | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.solcx | |
| ~/.vvm | |
| key: ${{ runner.os }}-compiler-cache | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.10" | |
| - name: Install python dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install -r requirements.txt && brownie pm install OpenZeppelin/[email protected] | |
| - name: Patch py-solc-x to use GitHub releases | |
| run: | | |
| python3 << 'EOF' | |
| import os | |
| import site | |
| # Find py-solc-x install location | |
| site_packages = site.getsitepackages()[0] | |
| install_file = os.path.join(site_packages, "solcx", "install.py") | |
| # Read the file | |
| with open(install_file, 'r') as f: | |
| content = f.read() | |
| # Replace the blocked URL with GitHub releases | |
| # Old py-solc-x 1.1.1 uses solc-bin.ethereum.org | |
| content = content.replace( | |
| 'SOLC_BASE_URL = "https://solc-bin.ethereum.org/"', | |
| 'SOLC_BASE_URL = "https://binaries.soliditylang.org/"' | |
| ) | |
| content = content.replace( | |
| '"https://solc-bin.ethereum.org/"', | |
| '"https://binaries.soliditylang.org/"' | |
| ) | |
| content = content.replace( | |
| 'solc-bin.ethereum.org', | |
| 'binaries.soliditylang.org' | |
| ) | |
| # Write back | |
| with open(install_file, 'w') as f: | |
| f.write(content) | |
| print("✓ Patched py-solc-x to use binaries.soliditylang.org") | |
| EOF | |
| - name: Extend Staking | |
| run: echo $REWARDS_CRON && brownie networks import network-config.yaml true && brownie run scripts/fouryearvesting/extendStakingCron.py --network=rsk-mainnet | |
| env: | |
| REWARDS_CRON: 1 | |
| FEE_CLAIMER: ${{secrets.FEE_CLAIMER}} |