Skip to content

Commit bfc9a0a

Browse files
authored
Merge pull request #566 from DistributedCollective/fix/github-action
Fix/GitHub action
2 parents 2e2c05b + d7d2e03 commit bfc9a0a

8 files changed

Lines changed: 166 additions & 14 deletions

File tree

.github/workflows/cron.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,48 @@ jobs:
6262
- name: Setup Python
6363
uses: actions/setup-python@v2
6464
with:
65-
python-version: "3.9"
65+
python-version: "3.10"
6666

6767
- name: Install python dependencies
68-
run: pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
68+
run: |
69+
pip install --upgrade pip
70+
pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
71+
72+
- name: Patch py-solc-x to use GitHub releases
73+
run: |
74+
python3 << 'EOF'
75+
import os
76+
import site
77+
78+
# Find py-solc-x install location
79+
site_packages = site.getsitepackages()[0]
80+
install_file = os.path.join(site_packages, "solcx", "install.py")
81+
82+
# Read the file
83+
with open(install_file, 'r') as f:
84+
content = f.read()
85+
86+
# Replace the blocked URL with GitHub releases
87+
# Old py-solc-x 1.1.1 uses solc-bin.ethereum.org
88+
content = content.replace(
89+
'SOLC_BASE_URL = "https://solc-bin.ethereum.org/"',
90+
'SOLC_BASE_URL = "https://binaries.soliditylang.org/"'
91+
)
92+
content = content.replace(
93+
'"https://solc-bin.ethereum.org/"',
94+
'"https://binaries.soliditylang.org/"'
95+
)
96+
content = content.replace(
97+
'solc-bin.ethereum.org',
98+
'binaries.soliditylang.org'
99+
)
100+
101+
# Write back
102+
with open(install_file, 'w') as f:
103+
f.write(content)
104+
105+
print("✓ Patched py-solc-x to use binaries.soliditylang.org")
106+
EOF
69107
70108
- name: Withdraw Fees
71109
run: echo $REWARDS_CRON && brownie networks import network-config.yaml true && brownie run scripts/contractInteraction/rewards_cron.py --network=rsk-mainnet

.github/workflows/cron_amm.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,48 @@ jobs:
6262
- name: Setup Python
6363
uses: actions/setup-python@v2
6464
with:
65-
python-version: "3.9"
65+
python-version: "3.10"
6666

6767
- name: Install python dependencies
68-
run: pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
68+
run: |
69+
pip install --upgrade pip
70+
pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
71+
72+
- name: Patch py-solc-x to use GitHub releases
73+
run: |
74+
python3 << 'EOF'
75+
import os
76+
import site
77+
78+
# Find py-solc-x install location
79+
site_packages = site.getsitepackages()[0]
80+
install_file = os.path.join(site_packages, "solcx", "install.py")
81+
82+
# Read the file
83+
with open(install_file, 'r') as f:
84+
content = f.read()
85+
86+
# Replace the blocked URL with GitHub releases
87+
# Old py-solc-x 1.1.1 uses solc-bin.ethereum.org
88+
content = content.replace(
89+
'SOLC_BASE_URL = "https://solc-bin.ethereum.org/"',
90+
'SOLC_BASE_URL = "https://binaries.soliditylang.org/"'
91+
)
92+
content = content.replace(
93+
'"https://solc-bin.ethereum.org/"',
94+
'"https://binaries.soliditylang.org/"'
95+
)
96+
content = content.replace(
97+
'solc-bin.ethereum.org',
98+
'binaries.soliditylang.org'
99+
)
100+
101+
# Write back
102+
with open(install_file, 'w') as f:
103+
f.write(content)
104+
105+
print("✓ Patched py-solc-x to use binaries.soliditylang.org")
106+
EOF
69107
70108
- name: Withdraw Fees
71109
run: echo $REWARDS_CRON && brownie networks import network-config.yaml true && brownie run scripts/contractInteraction/rewards_cron_amm.py --network=rsk-mainnet

.github/workflows/extendstakingcron.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,48 @@ jobs:
4545
- name: Setup Python
4646
uses: actions/setup-python@v2
4747
with:
48-
python-version: "3.9"
48+
python-version: "3.10"
4949

5050
- name: Install python dependencies
51-
run: pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
51+
run: |
52+
pip install --upgrade pip
53+
pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
54+
55+
- name: Patch py-solc-x to use GitHub releases
56+
run: |
57+
python3 << 'EOF'
58+
import os
59+
import site
60+
61+
# Find py-solc-x install location
62+
site_packages = site.getsitepackages()[0]
63+
install_file = os.path.join(site_packages, "solcx", "install.py")
64+
65+
# Read the file
66+
with open(install_file, 'r') as f:
67+
content = f.read()
68+
69+
# Replace the blocked URL with GitHub releases
70+
# Old py-solc-x 1.1.1 uses solc-bin.ethereum.org
71+
content = content.replace(
72+
'SOLC_BASE_URL = "https://solc-bin.ethereum.org/"',
73+
'SOLC_BASE_URL = "https://binaries.soliditylang.org/"'
74+
)
75+
content = content.replace(
76+
'"https://solc-bin.ethereum.org/"',
77+
'"https://binaries.soliditylang.org/"'
78+
)
79+
content = content.replace(
80+
'solc-bin.ethereum.org',
81+
'binaries.soliditylang.org'
82+
)
83+
84+
# Write back
85+
with open(install_file, 'w') as f:
86+
f.write(content)
87+
88+
print("✓ Patched py-solc-x to use binaries.soliditylang.org")
89+
EOF
5290
5391
- name: Extend Staking
5492
run: echo $REWARDS_CRON && brownie networks import network-config.yaml true && brownie run scripts/fouryearvesting/extendStakingCron.py --network=rsk-mainnet

.github/workflows/setblockcron.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,48 @@ jobs:
6363
- name: Setup Python
6464
uses: actions/setup-python@v2
6565
with:
66-
python-version: "3.9"
66+
python-version: "3.10"
6767

6868
- name: Install python dependencies
69-
run: pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
69+
run: |
70+
pip install --upgrade pip
71+
pip install -r requirements.txt && brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.5
72+
73+
- name: Patch py-solc-x to use GitHub releases
74+
run: |
75+
python3 << 'EOF'
76+
import os
77+
import site
78+
79+
# Find py-solc-x install location
80+
site_packages = site.getsitepackages()[0]
81+
install_file = os.path.join(site_packages, "solcx", "install.py")
82+
83+
# Read the file
84+
with open(install_file, 'r') as f:
85+
content = f.read()
86+
87+
# Replace the blocked URL with GitHub releases
88+
# Old py-solc-x 1.1.1 uses solc-bin.ethereum.org
89+
content = content.replace(
90+
'SOLC_BASE_URL = "https://solc-bin.ethereum.org/"',
91+
'SOLC_BASE_URL = "https://binaries.soliditylang.org/"'
92+
)
93+
content = content.replace(
94+
'"https://solc-bin.ethereum.org/"',
95+
'"https://binaries.soliditylang.org/"'
96+
)
97+
content = content.replace(
98+
'solc-bin.ethereum.org',
99+
'binaries.soliditylang.org'
100+
)
101+
102+
# Write back
103+
with open(install_file, 'w') as f:
104+
f.write(content)
105+
106+
print("✓ Patched py-solc-x to use binaries.soliditylang.org")
107+
EOF
70108
71109
- name: Set Block
72110
run: echo $REWARDS_CRON && brownie networks import network-config.yaml true && brownie run scripts/contractInteraction/setBlock_cron.py --network=rsk-mainnet

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
eth-brownie==1.12.4
1+
eth-brownie==1.21.0
22
munch==2.5.0
33
slither-analyzer==0.7.0

scripts/contractInteraction/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def withdrawFees():
438438
conf.contracts['SOV'],
439439
conf.contracts['WRBTC'],
440440
conf.contracts['DLLR'],
441-
])
441+
], {'gas_price': '26000000'})
442442

443443
def withdrawFeesAMM():
444444
# Withdraw fees from protocol
@@ -459,7 +459,7 @@ def withdrawFeesAMM():
459459
conf.contracts["ConverterDLLR"],
460460
conf.contracts["ConverterPOWA"],
461461
conf.contracts["ConverterBOS"],
462-
])
462+
], {'gas_price': '26000000'})
463463

464464
def setSupportedToken(tokenAddress):
465465
sovryn = Contract.from_abi(

scripts/contractInteraction/staking_vesting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ def setAverageBlockTime(blockTime):
217217
def setBlockForStakingRewards():
218218
# Get the staking rewards proxy contract instance
219219
stakingRewardsProxy = Contract.from_abi("StakingRewards", address=conf.contracts['StakingRewardsProxy'], abi=StakingRewards.abi, owner=conf.acct)
220-
stakingRewardsProxy.setBlock()
220+
stakingRewardsProxy.setBlock({'gas_price': '26000000'})
221221

222222
def setBlockForStakingRewardsOs():
223223
if conf.contracts['StakingRewardsOsProxy']:
224224
stakingRewardsProxy = Contract.from_abi("StakingRewardsOs", address=conf.contracts['StakingRewardsOsProxy'], abi=StakingRewardsOs.abi, owner=conf.acct)
225-
stakingRewardsProxy.setBlock()
225+
stakingRewardsProxy.setBlock({'gas_price': '26000000'})
226226

227227
# Set Historical Block
228228

scripts/fouryearvesting/extendStakingCron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ def readLockDate(timestamp):
8080
print('timediff:', timediff)
8181
print('-----------------------------------------------------')
8282
if ((result == 0) and (math.floor(newResult) >= 1) and (math.floor(newResult) <= maxIterations) and (timediff < 86400) ):
83-
fourYearVestingLogic.extendStaking()
83+
fourYearVestingLogic.extendStaking({'gas_price': '26000000'})

0 commit comments

Comments
 (0)