-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
190 additions
and
319 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ __pycache__ | |
.env | ||
.history | ||
.hypothesis/ | ||
build/ | ||
.build/ | ||
reports/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
FROM python:3.10-alpine | ||
FROM ghcr.io/apeworx/ape:latest-slim | ||
|
||
RUN apk add --no-cache \ | ||
git npm build-base linux-headers python3-dev tk libc6-compat gcompat cargo | ||
|
||
RUN npm install -g ganache | ||
USER root | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN pip install "cython<3.0.0" && pip install --no-build-isolation pyyaml==5.4.1 | ||
RUN pip install -r requirements.txt | ||
|
||
RUN brownie networks modify optimism-test host=https://sepolia.optimism.io | ||
RUN brownie networks modify optimism-main host=https://optimism-mainnet.wallet.coinbase.com | ||
|
||
RUN brownie networks modify base-main host=https://mainnet.base.org | ||
# TODO: move this into an ENV or sort of... | ||
RUN python -c 'import vvm; vvm.install_vyper("0.4.0", True)' | ||
RUN ape pm install | ||
RUN ape pm compile | ||
|
||
RUN brownie networks add Bob bob-main host=https://rpc.gobob.xyz chainid=60808 | ||
RUN brownie networks add Mode mode-main host=https://mainnet.mode.network chainid=34443 | ||
RUN brownie networks add Lisk lisk-main host=https://lisk.drpc.org chainid=1135 | ||
RUN brownie networks add Fraxtal fraxtal-main host=https://rpc.frax.com chainid=252 | ||
RUN brownie networks add MetalL2 metall2-main host=https://rpc.metall2.com chainid=1750 | ||
ENTRYPOINT [] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Sugar | ||
|
||
vyper: | ||
evm_version: cancun | ||
|
||
dependencies: | ||
- name: snekmate | ||
github: pcaversaccio/snekmate | ||
version: 0.1.0 | ||
|
||
networks: | ||
custom: | ||
- name: mainnet | ||
ecosystem: mode | ||
chain_id: 34443 | ||
- name: mainnet | ||
ecosystem: lisk | ||
chain_id: 1135 | ||
- name: mainnet | ||
ecosystem: metall2 | ||
chain_id: 1750 | ||
|
||
node: | ||
mode: | ||
mainnet: | ||
uri: https://mode.drpc.org | ||
lisk: | ||
mainnet: | ||
uri: https://lisk.drpc.org | ||
metall2: | ||
mainnet: | ||
uri: https://metall2.drpc.org | ||
optimism: | ||
mainnet: | ||
uri: https://optimism-mainnet.wallet.coinbase.com |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
eth-brownie @ git+https://github.com/velodrome-finance/[email protected] | ||
vyper==0.4.0 | ||
flake8 | ||
eth-ape | ||
ape-vyper | ||
ape-etherscan | ||
|
||
black |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,66 @@ | ||
# SPDX-License-Identifier: BUSL-1.1 | ||
import os | ||
|
||
from brownie import ( | ||
accounts, VeSugar, LpSugar, RelaySugar, FactoryRegistry, RewardsSugar | ||
) | ||
from ape import project, accounts | ||
|
||
|
||
def main(): | ||
contract_name = str(os.getenv('CONTRACT')).lower() | ||
chain_id = os.getenv('CHAIN_ID') | ||
contract_name = str(os.getenv("CONTRACT")).lower() | ||
chain_id = os.getenv("CHAIN_ID") | ||
publish = os.getenv("PUBLISH", False) | ||
account = None | ||
|
||
if os.getenv('PROD'): | ||
account = accounts.load('sugar') | ||
if os.getenv("PROD"): | ||
account = accounts.load("sugar") | ||
elif len(accounts) > 0: | ||
account = accounts[0] | ||
|
||
if 'lp' in contract_name: | ||
LpSugar.deploy( | ||
os.getenv(f'VOTER_{chain_id}'), | ||
os.getenv(f'REGISTRY_{chain_id}'), | ||
os.getenv(f'CONVERTOR_{chain_id}'), | ||
os.getenv(f'SLIPSTREAM_HELPER_{chain_id}'), | ||
os.getenv(f'ALM_FACTORY_{chain_id}'), | ||
{'from': account} | ||
if "lp" in contract_name: | ||
project.LpSugar.deploy( | ||
os.getenv(f"VOTER_{chain_id}"), | ||
os.getenv(f"REGISTRY_{chain_id}"), | ||
os.getenv(f"CONVERTOR_{chain_id}"), | ||
os.getenv(f"SLIPSTREAM_HELPER_{chain_id}"), | ||
os.getenv(f"ALM_FACTORY_{chain_id}"), | ||
sender=account, | ||
publish=publish, | ||
) | ||
|
||
elif 'rewards' in contract_name: | ||
RewardsSugar.deploy( | ||
os.getenv(f'VOTER_{chain_id}'), | ||
os.getenv(f'REGISTRY_{chain_id}'), | ||
os.getenv(f'CONVERTOR_{chain_id}'), | ||
{'from': account} | ||
elif "rewards" in contract_name: | ||
project.RewardsSugar.deploy( | ||
os.getenv(f"VOTER_{chain_id}"), | ||
os.getenv(f"REGISTRY_{chain_id}"), | ||
os.getenv(f"CONVERTOR_{chain_id}"), | ||
sender=account, | ||
publish=publish, | ||
) | ||
|
||
elif 've' in contract_name: | ||
VeSugar.deploy( | ||
os.getenv(f'VOTER_{chain_id}'), | ||
os.getenv(f'DIST_{chain_id}'), | ||
os.getenv(f'GOVERNOR_{chain_id}'), | ||
{'from': account} | ||
elif "ve" in contract_name: | ||
project.VeSugar.deploy( | ||
os.getenv(f"VOTER_{chain_id}"), | ||
os.getenv(f"DIST_{chain_id}"), | ||
os.getenv(f"GOVERNOR_{chain_id}"), | ||
sender=account, | ||
publish=publish, | ||
) | ||
|
||
elif 'relay' in contract_name: | ||
RelaySugar.deploy( | ||
str(os.getenv(f'RELAY_REGISTRY_ADDRESSES_{chain_id}')).split(','), | ||
os.getenv(f'VOTER_{chain_id}'), | ||
{'from': account} | ||
elif "relay" in contract_name: | ||
project.RelaySugar.deploy( | ||
str(os.getenv(f"RELAY_REGISTRY_ADDRESSES_{chain_id}")).split(","), | ||
os.getenv(f"VOTER_{chain_id}"), | ||
sender=account, | ||
publish=publish, | ||
) | ||
|
||
elif 'registry' in contract_name: | ||
FactoryRegistry.deploy( | ||
str(os.getenv(f'FACTORIES_{chain_id}')).split(','), | ||
str(os.getenv(f'REWARDS_FACTORIES_{chain_id}')).split(','), | ||
str(os.getenv(f'GAUGE_FACTORIES_{chain_id}')).split(','), | ||
str(os.getenv(f'INIT_HASHES_{chain_id}')).split(','), | ||
{'from': account} | ||
elif "registry" in contract_name: | ||
project.FactoryRegistry.deploy( | ||
str(os.getenv(f"FACTORIES_{chain_id}")).split(","), | ||
str(os.getenv(f"REWARDS_FACTORIES_{chain_id}")).split(","), | ||
str(os.getenv(f"GAUGE_FACTORIES_{chain_id}")).split(","), | ||
str(os.getenv(f"INIT_HASHES_{chain_id}")).split(","), | ||
sender=account, | ||
publish=publish, | ||
) | ||
|
||
else: | ||
print('Set the `CONTRACT` environment variable to deploy a contract.') | ||
print("Set the `CONTRACT` environment variable to deploy a contract.") |
This file contains 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
Oops, something went wrong.