-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'remove_eth_transfers' of https://github.com/bout3fiddy/…
…tricrypto-ng into remove_eth_transfers
- Loading branch information
Showing
11 changed files
with
385 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: deployment-tests-ape | ||
|
||
on: ["push", "pull_request"] | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WEB3_ALCHEMY_API_KEY: ${{ secrets.WEB3_ALCHEMY_API_KEY }} | ||
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | ||
|
||
jobs: | ||
deployment-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Compiler Installations | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.vvm | ||
key: compiler-cache | ||
|
||
- name: Setup Python 3.10.4 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.10.4 | ||
|
||
- name: Install Requirements | ||
run: pip install -r requirements_ape.txt | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Hardcat | ||
run: npm install --save-dev hardhat | ||
|
||
- name: Run Deployment Tests | ||
run: ape test --network ethereum:mainnet-fork:hardhat test_deployment |
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
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 |
---|---|---|
@@ -0,0 +1,154 @@ | ||
aiohttp==3.8.5 | ||
aiosignal==1.3.1 | ||
ape-alchemy==0.6.4 | ||
ape-etherscan==0.6.10 | ||
ape-hardhat==0.6.12 | ||
ape-vyper==0.6.10 | ||
appnope==0.1.3 | ||
asttokens==2.4.0 | ||
async-timeout==4.0.3 | ||
attrs==23.1.0 | ||
backcall==0.2.0 | ||
base58==1.0.3 | ||
bitarray==2.8.1 | ||
black==23.9.1 | ||
build==1.0.3 | ||
cached-property==1.5.2 | ||
certifi==2023.7.22 | ||
cffi==1.15.1 | ||
cfgv==3.4.0 | ||
charset-normalizer==3.2.0 | ||
chompjs==1.2.2 | ||
click==8.1.7 | ||
commonmark==0.9.1 | ||
cryptography==41.0.3 | ||
cytoolz==0.12.2 | ||
dataclassy==0.11.1 | ||
decorator==5.1.1 | ||
Deprecated==1.2.14 | ||
distlib==0.3.7 | ||
eip712==0.2.1 | ||
eth-abi==4.2.0 | ||
eth-account==0.8.0 | ||
eth-ape==0.6.19 | ||
eth-bloom==2.0.0 | ||
eth-hash==0.5.2 | ||
eth-keyfile==0.6.1 | ||
eth-keys==0.4.0 | ||
eth-rlp==0.3.0 | ||
eth-stdlib==0.2.7 | ||
eth-tester==0.9.1b1 | ||
eth-typing==3.4.0 | ||
eth-utils==2.2.0 | ||
ethpm-types==0.5.6 | ||
evm-trace==0.1.0a24 | ||
exceptiongroup==1.1.3 | ||
execnet==2.0.2 | ||
executing==1.2.0 | ||
fancycompleter==0.9.1 | ||
filelock==3.12.3 | ||
flake8==6.1.0 | ||
frozenlist==1.4.0 | ||
hexbytes==0.3.1 | ||
hypothesis==6.84.3 | ||
identify==2.5.27 | ||
idna==3.4 | ||
ijson==3.2.3 | ||
importlib-metadata==6.8.0 | ||
iniconfig==2.0.0 | ||
ipython==8.15.0 | ||
isort==5.12.0 | ||
jedi==0.19.0 | ||
jsonschema==4.19.0 | ||
jsonschema-specifications==2023.7.1 | ||
lark==1.1.7 | ||
lazyasd==0.1.4 | ||
lru-dict==1.2.0 | ||
mamushi==0.0.2a1 | ||
matplotlib-inline==0.1.6 | ||
mccabe==0.7.0 | ||
morphys==1.0 | ||
msgspec==0.18.2 | ||
multidict==6.0.4 | ||
mypy-extensions==1.0.0 | ||
nodeenv==1.8.0 | ||
numpy==1.25.2 | ||
packaging==23.1 | ||
pandas==1.5.3 | ||
parsimonious==0.9.0 | ||
parso==0.8.3 | ||
pathspec==0.11.2 | ||
pdbpp==0.10.3 | ||
pexpect==4.8.0 | ||
pickleshare==0.7.5 | ||
pip-tools==7.3.0 | ||
platformdirs==3.10.0 | ||
pluggy==1.3.0 | ||
pre-commit==3.4.0 | ||
prompt-toolkit==3.0.39 | ||
protobuf==4.24.3 | ||
ptyprocess==0.7.0 | ||
pure-eval==0.2.2 | ||
py==1.11.0 | ||
py-cid==0.3.0 | ||
py-ecc==6.0.0 | ||
py-evm==0.7.0a4 | ||
py-geth==3.13.0 | ||
py-multibase==1.0.3 | ||
py-multicodec==0.2.1 | ||
py-multihash==0.2.3 | ||
pycodestyle==2.11.0 | ||
pycoingecko==3.1.0 | ||
pycparser==2.21 | ||
pycryptodome==3.18.0 | ||
pydantic==1.10.12 | ||
pyethash==0.1.27 | ||
pyflakes==3.1.0 | ||
PyGithub==1.59.1 | ||
Pygments==2.16.1 | ||
PyJWT==2.8.0 | ||
PyNaCl==1.5.0 | ||
pyproject_hooks==1.0.0 | ||
pyrepl==0.9.0 | ||
pytest==7.4.2 | ||
pytest-forked==1.6.0 | ||
pytest-repeat==0.9.1 | ||
pytest-xdist==3.3.1 | ||
python-baseconv==1.2.2 | ||
python-dateutil==2.8.2 | ||
python-dotenv==1.0.0 | ||
pytz==2023.3.post1 | ||
pyunormalize==15.0.0 | ||
PyYAML==6.0.1 | ||
referencing==0.30.2 | ||
regex==2023.8.8 | ||
requests==2.31.0 | ||
rich==12.6.0 | ||
rlp==3.0.0 | ||
rpds-py==0.10.2 | ||
safe-pysha3==1.0.4 | ||
semantic-version==2.10.0 | ||
six==1.16.0 | ||
sortedcontainers==2.4.0 | ||
SQLAlchemy==2.0.20 | ||
stack-data==0.6.2 | ||
titanoboa @ git+https://github.com/vyperlang/titanoboa@c1d741c26b34798ec1620859c7f3d8f42416e4be | ||
tomli==2.0.1 | ||
toolz==0.12.0 | ||
tqdm==4.66.1 | ||
traitlets==5.9.0 | ||
trie==2.1.1 | ||
typing_extensions==4.7.1 | ||
urllib3==2.0.4 | ||
varint==1.0.2 | ||
virtualenv==20.24.5 | ||
vvm==0.1.0 | ||
vyper==0.3.9 | ||
watchdog==3.0.0 | ||
wcwidth==0.2.6 | ||
web3==6.9.0 | ||
websockets==11.0.3 | ||
wmctrl==0.4 | ||
wrapt==1.15.0 | ||
yarl==1.9.2 | ||
zipp==3.16.2 |
Empty file.
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
Empty file.
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,65 @@ | ||
import pytest | ||
from ape import Contract, Project, chain | ||
from ape.contracts import ContractContainer | ||
|
||
from scripts.deploy import deploy_infra | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def admin(): | ||
return "0x40907540d8a6C65c637785e8f8B742ae6b0b9968" | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def deploy(admin, project: Project): | ||
pool, coins, fee_receiver, _account = deploy_infra( | ||
project.network_manager.network.name, admin | ||
) | ||
return Contract(pool), [Contract(c) for c in coins], fee_receiver, _account | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def admin_mint_tokens(admin, project): | ||
# USDC | ||
token_impl = ContractContainer( | ||
Contract("0xB7277a6e95992041568D9391D09d0122023778A2").contract_type | ||
) | ||
token_contract = token_impl.at( | ||
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" | ||
) | ||
token_minter = "0xe982615d461dd5cd06575bbea87624fda4e3de17" | ||
project.provider.set_balance(token_minter, 10**18) | ||
amount = 1000 * 10**6 | ||
token_contract.configureMinter(token_minter, amount, sender=token_minter) | ||
token_contract.mint(admin, amount, sender=token_minter) | ||
assert token_contract.balanceOf(admin) >= amount | ||
|
||
# WETH | ||
project.provider.set_balance(admin, 2 * 10**18) | ||
weth_contract = Contract( | ||
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", | ||
contract_type=chain.contracts._get_contract_type_from_explorer( | ||
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | ||
), | ||
) | ||
weth_contract.deposit(value=1 * 10**18, sender=admin) | ||
assert weth_contract.balanceOf(admin) >= 1 * 10**18 | ||
|
||
# WBTC | ||
wbtc_contract = Contract( | ||
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", | ||
contract_type=chain.contracts._get_contract_type_from_explorer( | ||
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" | ||
), | ||
) | ||
wbtc_owner = wbtc_contract.owner() | ||
project.provider.set_balance(wbtc_owner, 1 * 10**18) | ||
wbtc_contract.mint(admin, 1 * 10**7, sender=wbtc_owner) | ||
assert wbtc_contract.balanceOf(admin) >= 1 * 10**7 | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def approve_admin(admin, deploy): | ||
pool = deploy[0] | ||
for coin in deploy[1]: | ||
coin.approve(pool.address, 2**256 - 1, sender=admin) |
Oops, something went wrong.