Skip to content

Commit

Permalink
Test deployment of a dummy contract
Browse files Browse the repository at this point in the history
  • Loading branch information
michwill committed Apr 24, 2023
1 parent ad2e723 commit 0681396
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/testing/DummyPriceOracle.vy
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# @version 0.3.7

"""
This contract is for testing only.
If you see it on mainnet - it won't be used for anything except testing the actual deployment
"""

price: public(uint256)
ADMIN: immutable(address)

Expand Down
34 changes: 34 additions & 0 deletions scripts/ape-test-deploy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This script simply tests the deployment process

from ape import project, accounts, networks
from ape.cli import NetworkBoundCommand, network_option
# account_option could be used when in prod?
import click

from dotenv import load_dotenv
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
load_dotenv(Path(BASE_DIR, ".env"))


@click.group()
def cli():
"""
Script for testing the deployment process in ape
"""


@cli.command(
cls=NetworkBoundCommand,
)
@network_option()
def deploy(network):
account = accounts.load('babe')
account.set_autosign(True)

max_fee = networks.active_provider.base_fee * 2
max_priority_fee = '0.5 gwei'

with accounts.use_sender(account):
account.deploy(project.DummyPriceOracle, account, 2000 * 10**18, max_fee=max_fee,
max_priority_fee=max_priority_fee)

0 comments on commit 0681396

Please sign in to comment.